summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot')
-rw-r--r--arch/x86/boot/compressed/head_32.S9
-rw-r--r--arch/x86/boot/compressed/head_64.S4
2 files changed, 6 insertions, 7 deletions
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 356060c5332c..2f8138b71ea9 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -139,12 +139,11 @@ SYM_FUNC_START(startup_32)
/*
* The GDT may get overwritten either during the copy we just did or
* during extract_kernel below. To avoid any issues, repoint the GDTR
- * to the new copy of the GDT. EAX still contains the previously
- * calculated relocation offset of init_size - _end.
+ * to the new copy of the GDT.
*/
- leal gdt(%ebx), %edx
- addl %eax, 2(%edx)
- lgdt (%edx)
+ leal gdt(%ebx), %eax
+ movl %eax, 2(%eax)
+ lgdt (%eax)
/*
* Jump to the relocated address.
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index f7bacc4c1494..fcf8feaa57ea 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -456,8 +456,8 @@ trampoline_return:
* to the new copy of the GDT.
*/
leaq gdt64(%rbx), %rax
- subq %rbp, 2(%rax)
- addq %rbx, 2(%rax)
+ leaq gdt(%rbx), %rdx
+ movq %rdx, 2(%rax)
lgdt (%rax)
/*