[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159972974006.20229.13724907581434195856.tip-bot2@tip-bot2>
Date: Thu, 10 Sep 2020 09:22:20 -0000
From: "tip-bot2 for Joerg Roedel" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Joerg Roedel <jroedel@...e.de>, Borislav Petkov <bp@...e.de>,
Kees Cook <keescook@...omium.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: x86/seves] x86/head/64: Load GDT after switch to virtual addresses
The following commit has been merged into the x86/seves branch of tip:
Commit-ID: e04b88336360e101329add0c05e5cb1cebae64fd
Gitweb: https://git.kernel.org/tip/e04b88336360e101329add0c05e5cb1cebae64fd
Author: Joerg Roedel <jroedel@...e.de>
AuthorDate: Mon, 07 Sep 2020 15:15:31 +02:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Mon, 07 Sep 2020 21:35:54 +02:00
x86/head/64: Load GDT after switch to virtual addresses
Load the GDT right after switching to virtual addresses to make sure
there is a defined GDT for exception handling.
Signed-off-by: Joerg Roedel <jroedel@...e.de>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Kees Cook <keescook@...omium.org>
Link: https://lkml.kernel.org/r/20200907131613.12703-31-joro@8bytes.org
---
arch/x86/kernel/head_64.S | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 2b2e916..03b03f2 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -158,6 +158,14 @@ SYM_CODE_START(secondary_startup_64)
1:
UNWIND_HINT_EMPTY
+ /*
+ * We must switch to a new descriptor in kernel space for the GDT
+ * because soon the kernel won't have access anymore to the userspace
+ * addresses where we're currently running on. We have to do that here
+ * because in 32bit we couldn't load a 64bit linear address.
+ */
+ lgdt early_gdt_descr(%rip)
+
/* Check if nx is implemented */
movl $0x80000001, %eax
cpuid
@@ -185,14 +193,6 @@ SYM_CODE_START(secondary_startup_64)
pushq $0
popfq
- /*
- * We must switch to a new descriptor in kernel space for the GDT
- * because soon the kernel won't have access anymore to the userspace
- * addresses where we're currently running on. We have to do that here
- * because in 32bit we couldn't load a 64bit linear address.
- */
- lgdt early_gdt_descr(%rip)
-
/* set up data segments */
xorl %eax,%eax
movl %eax,%ds
Powered by blists - more mailing lists