From 56c5ee3455256d45eb9cbd4d77b15c10e3ddffa3 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Tue, 26 Sep 2006 10:52:38 +0200 Subject: [PATCH] --- yaml --- r: 35923 b: refs/heads/master c: 26374c7b7dca1ff90607c83d9b82e917119f0456 h: refs/heads/master i: 35921: 7c06247d4cb5d6a057e68c15babd50b63fe5a6c5 35919: 392e53a057a9c501085d1f66cd63813b37f1a279 v: v3 --- [refs] | 2 +- trunk/arch/x86_64/kernel/head.S | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 6cae50895222..4834f9a63b89 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0136611c62e8650e354b95c76dff6d2ce6030eff +refs/heads/master: 26374c7b7dca1ff90607c83d9b82e917119f0456 diff --git a/trunk/arch/x86_64/kernel/head.S b/trunk/arch/x86_64/kernel/head.S index 4a3326ce709c..1e6f80870679 100644 --- a/trunk/arch/x86_64/kernel/head.S +++ b/trunk/arch/x86_64/kernel/head.S @@ -185,12 +185,15 @@ startup_64: /* Finally jump to run C code and to be on real kernel address * Since we are running on identity-mapped space we have to jump - * to the full 64bit address , this is only possible as indirect - * jump + * to the full 64bit address, this is only possible as indirect + * jump. In addition we need to ensure %cs is set so we make this + * a far return. */ movq initial_code(%rip),%rax - pushq $0 # fake return address - jmp *%rax + pushq $0 # fake return address to stop unwinder + pushq $__KERNEL_CS # set correct cs + pushq %rax # target address in negative space + lretq /* SMP bootup changes these two */ .align 8