@@ -166,6 +166,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
@@ -193,14 +201,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