Thread (9 messages) 9 messages, 5 authors, 2015-06-22
STALE4050d

[PATCH v2] x86: Load __USER_DS into DS/ES after resume

From: Ingo Molnar <mingo@kernel.org>
Date: 2015-06-14 07:49:27
Subsystem: acpi, suspend to ram, the rest, x86 architecture (32-bit and 64-bit) · Maintainers: "Rafael J. Wysocki", Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen

* Linus Torvalds [off-list ref] wrote:
On Jun 13, 2015 8:56 PM, "Ingo Molnar" [off-list ref] wrote:
quoted
Ok, so something like the patch below, right?

        movw    $__KERNEL_DS, %ax
        movw    %ax, %ss
-       movw    %ax, %ds
-       movw    %ax, %es
        movw    %ax, %fs
        movw    %ax, %gs

+       movw    $__KERNEL_DS, %ax
+       movw    %ax, %ds
+       movw    %ax, %es
.. except with less cut-and-paste bugs.

That second KERNEL should be USER.
Yeah, doh :-/ Updated patch below.

Thanks,

	Ingo

=====
 arch/x86/kernel/acpi/wakeup_32.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index 665c6b7d2ea9..0c26b1b44e51 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -12,11 +12,13 @@ ENTRY(wakeup_pmode_return)
 wakeup_pmode_return:
 	movw	$__KERNEL_DS, %ax
 	movw	%ax, %ss
-	movw	%ax, %ds
-	movw	%ax, %es
 	movw	%ax, %fs
 	movw	%ax, %gs
 
+	movw	$__USER_DS, %ax
+	movw	%ax, %ds
+	movw	%ax, %es
+
 	# reload the gdt, as we need the full 32 bit address
 	lidt	saved_idt
 	lldt	saved_ldt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help