From 480c680899ff2e22897fc8fea1c7ca9c53315649 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Fri, 4 Jan 2008 11:35:15 -0200 Subject: [PATCH] Use __KERNEL_DS as SS when returning to a kernel thread (VERIFY) 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 --- arch/x86/kernel/entry_64.S | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index db76caa..9f31c00 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -104,7 +104,8 @@ 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 */ + /*FIXME: check if this causes problems on bare metal */ + pushq $__KERNEL_DS /* ss */ CFI_ADJUST_CFA_OFFSET 8 /*CFI_REL_OFFSET ss,0*/ pushq %rax /* rsp */ -- 1.5.4.1