Skip to content

Commit 4c94117

Browse files
kirylIngo Molnar
authored andcommitted
x86/boot/efi: Fix __KERNEL_CS definition of GDT entry on 64-bit configurations
Define __KERNEL_CS GDT entry as long mode (.L=1, .D=0) on 64-bit configurations. Signed-off-by: Kirill A. Shutemov <[email protected]> Reviewed-by: Matt Fleming <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent f8fceac commit 4c94117

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/x86/boot/compressed/eboot.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,13 @@ struct boot_params *efi_main(struct efi_config *c,
10591059
desc->p = 1;
10601060
desc->limit = 0xf;
10611061
desc->avl = 0;
1062-
desc->l = 0;
1063-
desc->d = SEG_OP_SIZE_32BIT;
1062+
if (IS_ENABLED(CONFIG_X86_64)) {
1063+
desc->l = 1;
1064+
desc->d = 0;
1065+
} else {
1066+
desc->l = 0;
1067+
desc->d = SEG_OP_SIZE_32BIT;
1068+
}
10641069
desc->g = SEG_GRANULARITY_4KB;
10651070
desc->base2 = 0x00;
10661071
desc++;

0 commit comments

Comments
 (0)