Skip to contentSkip to conversation

x86/boot/compressed/64: Do not truncate gdt address

PATCH New Kirill A. Shutemov 1 participant 1 message Feb 13, 2018 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/boot/compressed/64: Do not truncate gdt address

Before going to 32-bit trampoline we need to load GDT to make sure that we have the table with 32-bit code segment.

The load was implemented incorrectly and the table address is truncated to 32-bit. It causes problems if gdt is above 4G.

Reported-and-tested-by Andrei Vagin <[email protected]>
Fixes b4b56015ed1c ("x86/boot/compressed/64: Handle 5-level paging boot if kernel is above 4G")
---
 arch/x86/boot/compressed/head_64.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/compressed/head_64.S +1 -1
index 70b30f2bc9e0..99a0e7993252 100644
@@ -332,7 +332,7 @@ ENTRY(startup_64)
 
 	/* Make sure we have GDT with 32-bit code segment */
 	leaq	gdt(%rip), %rax
-	movl	%eax, gdt64+2(%rip)
+	movq	%rax, gdt64+2(%rip)
 	lgdt	gdt64(%rip)
 
 	/*
Signature · 1 line
2.15.1