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

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

From: Pavel Machek <hidden>
Date: 2015-06-14 08:57:38
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

On Sun 2015-06-14 09:49:22, Ingo Molnar wrote:
* Linus Torvalds [off-list ref] wrote:
quoted
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.
Do we want similar patch for 64-bit, too?

Signed-off-by: Pavel Machek <redacted>
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index ae693b5..2ac2bc7 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -18,10 +18,12 @@ ENTRY(wakeup_long64)
 	cmpq	%rdx, %rax
 	jne	bogus_64_magic
 
-	movw	$__KERNEL_DS, %ax
-	movw	%ax, %ss	
+	movw	$__USER_DS, %ax
 	movw	%ax, %ds
 	movw	%ax, %es
+
+	movw	$__KERNEL_DS, %ax
+	movw	%ax, %ss	
 	movw	%ax, %fs
 	movw	%ax, %gs
 	movq	saved_rsp, %rsp

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help