diff options
-rw-r--r-- | arch/x86/boot/compressed/eboot.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index cbf4b87f55b9..1d5093d1f319 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -1049,6 +1049,7 @@ struct boot_params *efi_main(struct efi_config *c, | |||
1049 | /* The first GDT is a dummy and the second is unused. */ | 1049 | /* The first GDT is a dummy and the second is unused. */ |
1050 | desc += 2; | 1050 | desc += 2; |
1051 | 1051 | ||
1052 | /* __KERNEL_CS */ | ||
1052 | desc->limit0 = 0xffff; | 1053 | desc->limit0 = 0xffff; |
1053 | desc->base0 = 0x0000; | 1054 | desc->base0 = 0x0000; |
1054 | desc->base1 = 0x0000; | 1055 | desc->base1 = 0x0000; |
@@ -1062,8 +1063,9 @@ struct boot_params *efi_main(struct efi_config *c, | |||
1062 | desc->d = SEG_OP_SIZE_32BIT; | 1063 | desc->d = SEG_OP_SIZE_32BIT; |
1063 | desc->g = SEG_GRANULARITY_4KB; | 1064 | desc->g = SEG_GRANULARITY_4KB; |
1064 | desc->base2 = 0x00; | 1065 | desc->base2 = 0x00; |
1065 | |||
1066 | desc++; | 1066 | desc++; |
1067 | |||
1068 | /* __KERNEL_DS */ | ||
1067 | desc->limit0 = 0xffff; | 1069 | desc->limit0 = 0xffff; |
1068 | desc->base0 = 0x0000; | 1070 | desc->base0 = 0x0000; |
1069 | desc->base1 = 0x0000; | 1071 | desc->base1 = 0x0000; |
@@ -1077,24 +1079,25 @@ struct boot_params *efi_main(struct efi_config *c, | |||
1077 | desc->d = SEG_OP_SIZE_32BIT; | 1079 | desc->d = SEG_OP_SIZE_32BIT; |
1078 | desc->g = SEG_GRANULARITY_4KB; | 1080 | desc->g = SEG_GRANULARITY_4KB; |
1079 | desc->base2 = 0x00; | 1081 | desc->base2 = 0x00; |
1080 | |||
1081 | #ifdef CONFIG_X86_64 | ||
1082 | /* Task segment value */ | ||
1083 | desc++; | 1082 | desc++; |
1084 | desc->limit0 = 0x0000; | 1083 | |
1085 | desc->base0 = 0x0000; | 1084 | if (IS_ENABLED(CONFIG_X86_64)) { |
1086 | desc->base1 = 0x0000; | 1085 | /* Task segment value */ |
1087 | desc->type = SEG_TYPE_TSS; | 1086 | desc->limit0 = 0x0000; |
1088 | desc->s = 0; | 1087 | desc->base0 = 0x0000; |
1089 | desc->dpl = 0; | 1088 | desc->base1 = 0x0000; |
1090 | desc->p = 1; | 1089 | desc->type = SEG_TYPE_TSS; |
1091 | desc->limit = 0x0; | 1090 | desc->s = 0; |
1092 | desc->avl = 0; | 1091 | desc->dpl = 0; |
1093 | desc->l = 0; | 1092 | desc->p = 1; |
1094 | desc->d = 0; | 1093 | desc->limit = 0x0; |
1095 | desc->g = SEG_GRANULARITY_4KB; | 1094 | desc->avl = 0; |
1096 | desc->base2 = 0x00; | 1095 | desc->l = 0; |
1097 | #endif /* CONFIG_X86_64 */ | 1096 | desc->d = 0; |
1097 | desc->g = SEG_GRANULARITY_4KB; | ||
1098 | desc->base2 = 0x00; | ||
1099 | desc++; | ||
1100 | } | ||
1098 | 1101 | ||
1099 | asm volatile("cli"); | 1102 | asm volatile("cli"); |
1100 | asm volatile ("lgdt %0" : : "m" (*gdt)); | 1103 | asm volatile ("lgdt %0" : : "m" (*gdt)); |