diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/cpu/bugs.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/head_64.S | 8 | ||||
-rw-r--r-- | arch/x86/kernel/hpet.c | 12 | ||||
-rw-r--r-- | arch/x86/kernel/stacktrace.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/sysfb_efi.c | 46 |
5 files changed, 60 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 66ca906aa790..801ecd1c3fd5 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c | |||
@@ -1226,7 +1226,7 @@ static ssize_t l1tf_show_state(char *buf) | |||
1226 | 1226 | ||
1227 | static ssize_t mds_show_state(char *buf) | 1227 | static ssize_t mds_show_state(char *buf) |
1228 | { | 1228 | { |
1229 | if (!hypervisor_is_type(X86_HYPER_NATIVE)) { | 1229 | if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) { |
1230 | return sprintf(buf, "%s; SMT Host state unknown\n", | 1230 | return sprintf(buf, "%s; SMT Host state unknown\n", |
1231 | mds_strings[mds_mitigation]); | 1231 | mds_strings[mds_mitigation]); |
1232 | } | 1232 | } |
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index a6342c899be5..f3d3e9646a99 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -193,10 +193,10 @@ ENTRY(secondary_startup_64) | |||
193 | 193 | ||
194 | /* Set up %gs. | 194 | /* Set up %gs. |
195 | * | 195 | * |
196 | * The base of %gs always points to the bottom of the irqstack | 196 | * The base of %gs always points to fixed_percpu_data. If the |
197 | * union. If the stack protector canary is enabled, it is | 197 | * stack protector canary is enabled, it is located at %gs:40. |
198 | * located at %gs:40. Note that, on SMP, the boot cpu uses | 198 | * Note that, on SMP, the boot cpu uses init data section until |
199 | * init data section till per cpu areas are set up. | 199 | * the per cpu areas are set up. |
200 | */ | 200 | */ |
201 | movl $MSR_GS_BASE,%ecx | 201 | movl $MSR_GS_BASE,%ecx |
202 | movl initial_gs(%rip),%eax | 202 | movl initial_gs(%rip),%eax |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index c43e96a938d0..c6f791bc481e 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -827,10 +827,6 @@ int __init hpet_enable(void) | |||
827 | if (!hpet_cfg_working()) | 827 | if (!hpet_cfg_working()) |
828 | goto out_nohpet; | 828 | goto out_nohpet; |
829 | 829 | ||
830 | /* Validate that the counter is counting */ | ||
831 | if (!hpet_counting()) | ||
832 | goto out_nohpet; | ||
833 | |||
834 | /* | 830 | /* |
835 | * Read the period and check for a sane value: | 831 | * Read the period and check for a sane value: |
836 | */ | 832 | */ |
@@ -896,6 +892,14 @@ int __init hpet_enable(void) | |||
896 | } | 892 | } |
897 | hpet_print_config(); | 893 | hpet_print_config(); |
898 | 894 | ||
895 | /* | ||
896 | * Validate that the counter is counting. This needs to be done | ||
897 | * after sanitizing the config registers to properly deal with | ||
898 | * force enabled HPETs. | ||
899 | */ | ||
900 | if (!hpet_counting()) | ||
901 | goto out_nohpet; | ||
902 | |||
899 | clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq); | 903 | clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq); |
900 | 904 | ||
901 | if (id & HPET_ID_LEGSUP) { | 905 | if (id & HPET_ID_LEGSUP) { |
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index 4f36d3241faf..2d6898c2cb64 100644 --- a/arch/x86/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c | |||
@@ -100,7 +100,7 @@ copy_stack_frame(const void __user *fp, struct stack_frame_user *frame) | |||
100 | { | 100 | { |
101 | int ret; | 101 | int ret; |
102 | 102 | ||
103 | if (!access_ok(fp, sizeof(*frame))) | 103 | if (__range_not_ok(fp, sizeof(*frame), TASK_SIZE)) |
104 | return 0; | 104 | return 0; |
105 | 105 | ||
106 | ret = 1; | 106 | ret = 1; |
diff --git a/arch/x86/kernel/sysfb_efi.c b/arch/x86/kernel/sysfb_efi.c index 8eb67a670b10..653b7f617b61 100644 --- a/arch/x86/kernel/sysfb_efi.c +++ b/arch/x86/kernel/sysfb_efi.c | |||
@@ -230,9 +230,55 @@ static const struct dmi_system_id efifb_dmi_system_table[] __initconst = { | |||
230 | {}, | 230 | {}, |
231 | }; | 231 | }; |
232 | 232 | ||
233 | /* | ||
234 | * Some devices have a portrait LCD but advertise a landscape resolution (and | ||
235 | * pitch). We simply swap width and height for these devices so that we can | ||
236 | * correctly deal with some of them coming with multiple resolutions. | ||
237 | */ | ||
238 | static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { | ||
239 | { | ||
240 | /* | ||
241 | * Lenovo MIIX310-10ICR, only some batches have the troublesome | ||
242 | * 800x1280 portrait screen. Luckily the portrait version has | ||
243 | * its own BIOS version, so we match on that. | ||
244 | */ | ||
245 | .matches = { | ||
246 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
247 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"), | ||
248 | DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"), | ||
249 | }, | ||
250 | }, | ||
251 | { | ||
252 | /* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */ | ||
253 | .matches = { | ||
254 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
255 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
256 | "Lenovo MIIX 320-10ICR"), | ||
257 | }, | ||
258 | }, | ||
259 | { | ||
260 | /* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */ | ||
261 | .matches = { | ||
262 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
263 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
264 | "Lenovo ideapad D330-10IGM"), | ||
265 | }, | ||
266 | }, | ||
267 | {}, | ||
268 | }; | ||
269 | |||
233 | __init void sysfb_apply_efi_quirks(void) | 270 | __init void sysfb_apply_efi_quirks(void) |
234 | { | 271 | { |
235 | if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || | 272 | if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || |
236 | !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS)) | 273 | !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS)) |
237 | dmi_check_system(efifb_dmi_system_table); | 274 | dmi_check_system(efifb_dmi_system_table); |
275 | |||
276 | if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI && | ||
277 | dmi_check_system(efifb_dmi_swap_width_height)) { | ||
278 | u16 temp = screen_info.lfb_width; | ||
279 | |||
280 | screen_info.lfb_width = screen_info.lfb_height; | ||
281 | screen_info.lfb_height = temp; | ||
282 | screen_info.lfb_linelength = 4 * screen_info.lfb_width; | ||
283 | } | ||
238 | } | 284 | } |