From: Jeremy Fitzhardinge Date: Wed, 25 Jun 2008 04:19:25 +0000 (-0400) Subject: x86: use __KERNEL_DS as SS when returning to a kernel thread X-Git-Tag: v2.6.27-rc1~1106^2~127 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e04e0a630d8b5c621b3a8e70ff20db737d3a5728;p=linux-2.6 x86: use __KERNEL_DS as SS when returning to a kernel thread This is needed when the kernel is running on RING3, such as under Xen. x86_64 has a weird feature that makes it #GP on iret when SS is a null descriptor. This need to be tested on bare metal to make sure it doesn't cause any problems. AMD specs say SS is always ignored (except on iret?). Signed-off-by: Eduardo Habkost Signed-off-by: Jeremy Fitzhardinge Cc: xen-devel Cc: Stephen Tweedie Cc: Eduardo Habkost Cc: Mark McLoughlin Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index ff15ab5522..6d1101469e 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -104,7 +104,7 @@ ENTRY(native_irq_enable_syscall_ret) .macro FAKE_STACK_FRAME child_rip /* push in order ss, rsp, eflags, cs, rip */ xorl %eax, %eax - pushq %rax /* ss */ + pushq $__KERNEL_DS /* ss */ CFI_ADJUST_CFA_OFFSET 8 /*CFI_REL_OFFSET ss,0*/ pushq %rax /* rsp */