aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-04-20 13:01:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-04-20 13:01:11 -0400
commit1fd91d719eb1ae83ef500eb4148d11db9db39a41 (patch)
tree6088b6030575f925d81042dbf18387c7eed39198
parent2b4cf5850db6acef2bbef52e3011f9bf93484209 (diff)
parent2ee27796f298b710992a677a7e4d35c8c588b17e (diff)
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Misc fixes all over the place: a console spam fix, section attributes fixes, a KASLR fix, a TLB stack-variable alignment fix, a reboot quirk, boot options related warnings fix, an LTO fix, a deadlock fix and an RDT fix" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu/intel: Lower the "ENERGY_PERF_BIAS: Set to normal" message's log priority x86/cpu/bugs: Use __initconst for 'const' init data x86/mm/KASLR: Fix the size of the direct mapping section x86/Kconfig: Fix spelling mistake "effectivness" -> "effectiveness" x86/mm/tlb: Revert "x86/mm: Align TLB invalidation info" x86/reboot, efi: Use EFI reboot for Acer TravelMate X514-51T x86/mm: Prevent bogus warnings with "noexec=off" x86/build/lto: Fix truncated .bss with -fdata-sections x86/speculation: Prevent deadlock on ssb_state::lock x86/resctrl: Do not repeat rdtgroup mode initialization
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/kernel/cpu/bugs.c6
-rw-r--r--arch/x86/kernel/cpu/intel.c4
-rw-r--r--arch/x86/kernel/cpu/resctrl/rdtgroup.c3
-rw-r--r--arch/x86/kernel/process.c8
-rw-r--r--arch/x86/kernel/reboot.c21
-rw-r--r--arch/x86/kernel/vmlinux.lds.S2
-rw-r--r--arch/x86/mm/dump_pagetables.c3
-rw-r--r--arch/x86/mm/ioremap.c2
-rw-r--r--arch/x86/mm/kaslr.c2
-rw-r--r--arch/x86/mm/tlb.c2
-rw-r--r--include/linux/efi.h7
12 files changed, 47 insertions, 15 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5ad92419be19..62fc3fda1a05 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1499,7 +1499,7 @@ config X86_CPA_STATISTICS
1499 depends on DEBUG_FS 1499 depends on DEBUG_FS
1500 ---help--- 1500 ---help---
1501 Expose statistics about the Change Page Attribute mechanims, which 1501 Expose statistics about the Change Page Attribute mechanims, which
1502 helps to determine the effectivness of preserving large and huge 1502 helps to determine the effectiveness of preserving large and huge
1503 page mappings when mapping protections are changed. 1503 page mappings when mapping protections are changed.
1504 1504
1505config ARCH_HAS_MEM_ENCRYPT 1505config ARCH_HAS_MEM_ENCRYPT
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 2da82eff0eb4..b91b3bfa5cfb 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -275,7 +275,7 @@ static const struct {
275 const char *option; 275 const char *option;
276 enum spectre_v2_user_cmd cmd; 276 enum spectre_v2_user_cmd cmd;
277 bool secure; 277 bool secure;
278} v2_user_options[] __initdata = { 278} v2_user_options[] __initconst = {
279 { "auto", SPECTRE_V2_USER_CMD_AUTO, false }, 279 { "auto", SPECTRE_V2_USER_CMD_AUTO, false },
280 { "off", SPECTRE_V2_USER_CMD_NONE, false }, 280 { "off", SPECTRE_V2_USER_CMD_NONE, false },
281 { "on", SPECTRE_V2_USER_CMD_FORCE, true }, 281 { "on", SPECTRE_V2_USER_CMD_FORCE, true },
@@ -419,7 +419,7 @@ static const struct {
419 const char *option; 419 const char *option;
420 enum spectre_v2_mitigation_cmd cmd; 420 enum spectre_v2_mitigation_cmd cmd;
421 bool secure; 421 bool secure;
422} mitigation_options[] __initdata = { 422} mitigation_options[] __initconst = {
423 { "off", SPECTRE_V2_CMD_NONE, false }, 423 { "off", SPECTRE_V2_CMD_NONE, false },
424 { "on", SPECTRE_V2_CMD_FORCE, true }, 424 { "on", SPECTRE_V2_CMD_FORCE, true },
425 { "retpoline", SPECTRE_V2_CMD_RETPOLINE, false }, 425 { "retpoline", SPECTRE_V2_CMD_RETPOLINE, false },
@@ -658,7 +658,7 @@ static const char * const ssb_strings[] = {
658static const struct { 658static const struct {
659 const char *option; 659 const char *option;
660 enum ssb_mitigation_cmd cmd; 660 enum ssb_mitigation_cmd cmd;
661} ssb_mitigation_options[] __initdata = { 661} ssb_mitigation_options[] __initconst = {
662 { "auto", SPEC_STORE_BYPASS_CMD_AUTO }, /* Platform decides */ 662 { "auto", SPEC_STORE_BYPASS_CMD_AUTO }, /* Platform decides */
663 { "on", SPEC_STORE_BYPASS_CMD_ON }, /* Disable Speculative Store Bypass */ 663 { "on", SPEC_STORE_BYPASS_CMD_ON }, /* Disable Speculative Store Bypass */
664 { "off", SPEC_STORE_BYPASS_CMD_NONE }, /* Don't touch Speculative Store Bypass */ 664 { "off", SPEC_STORE_BYPASS_CMD_NONE }, /* Don't touch Speculative Store Bypass */
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index fc3c07fe7df5..3142fd7a9b32 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -611,8 +611,8 @@ static void init_intel_energy_perf(struct cpuinfo_x86 *c)
611 if ((epb & 0xF) != ENERGY_PERF_BIAS_PERFORMANCE) 611 if ((epb & 0xF) != ENERGY_PERF_BIAS_PERFORMANCE)
612 return; 612 return;
613 613
614 pr_warn_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n"); 614 pr_info_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n");
615 pr_warn_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n"); 615 pr_info_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n");
616 epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL; 616 epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL;
617 wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); 617 wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
618} 618}
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 54b9eef3eea9..85212a32b54d 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -2610,9 +2610,10 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
2610 rdt_last_cmd_puts("Failed to initialize allocations\n"); 2610 rdt_last_cmd_puts("Failed to initialize allocations\n");
2611 return ret; 2611 return ret;
2612 } 2612 }
2613 rdtgrp->mode = RDT_MODE_SHAREABLE;
2614 } 2613 }
2615 2614
2615 rdtgrp->mode = RDT_MODE_SHAREABLE;
2616
2616 return 0; 2617 return 0;
2617} 2618}
2618 2619
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 58ac7be52c7a..957eae13b370 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -426,6 +426,8 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp,
426 u64 msr = x86_spec_ctrl_base; 426 u64 msr = x86_spec_ctrl_base;
427 bool updmsr = false; 427 bool updmsr = false;
428 428
429 lockdep_assert_irqs_disabled();
430
429 /* 431 /*
430 * If TIF_SSBD is different, select the proper mitigation 432 * If TIF_SSBD is different, select the proper mitigation
431 * method. Note that if SSBD mitigation is disabled or permanentely 433 * method. Note that if SSBD mitigation is disabled or permanentely
@@ -477,10 +479,12 @@ static unsigned long speculation_ctrl_update_tif(struct task_struct *tsk)
477 479
478void speculation_ctrl_update(unsigned long tif) 480void speculation_ctrl_update(unsigned long tif)
479{ 481{
482 unsigned long flags;
483
480 /* Forced update. Make sure all relevant TIF flags are different */ 484 /* Forced update. Make sure all relevant TIF flags are different */
481 preempt_disable(); 485 local_irq_save(flags);
482 __speculation_ctrl_update(~tif, tif); 486 __speculation_ctrl_update(~tif, tif);
483 preempt_enable(); 487 local_irq_restore(flags);
484} 488}
485 489
486/* Called from seccomp/prctl update */ 490/* Called from seccomp/prctl update */
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 725624b6c0c0..8fd3cedd9acc 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -81,6 +81,19 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
81 return 0; 81 return 0;
82} 82}
83 83
84/*
85 * Some machines don't handle the default ACPI reboot method and
86 * require the EFI reboot method:
87 */
88static int __init set_efi_reboot(const struct dmi_system_id *d)
89{
90 if (reboot_type != BOOT_EFI && !efi_runtime_disabled()) {
91 reboot_type = BOOT_EFI;
92 pr_info("%s series board detected. Selecting EFI-method for reboot.\n", d->ident);
93 }
94 return 0;
95}
96
84void __noreturn machine_real_restart(unsigned int type) 97void __noreturn machine_real_restart(unsigned int type)
85{ 98{
86 local_irq_disable(); 99 local_irq_disable();
@@ -166,6 +179,14 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = {
166 DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), 179 DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
167 }, 180 },
168 }, 181 },
182 { /* Handle reboot issue on Acer TravelMate X514-51T */
183 .callback = set_efi_reboot,
184 .ident = "Acer TravelMate X514-51T",
185 .matches = {
186 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
187 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
188 },
189 },
169 190
170 /* Apple */ 191 /* Apple */
171 { /* Handle problems with rebooting on Apple MacBook5 */ 192 { /* Handle problems with rebooting on Apple MacBook5 */
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index bad8c51fee6e..a5127b2c195f 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -362,7 +362,7 @@ SECTIONS
362 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { 362 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
363 __bss_start = .; 363 __bss_start = .;
364 *(.bss..page_aligned) 364 *(.bss..page_aligned)
365 *(.bss) 365 *(BSS_MAIN)
366 BSS_DECRYPTED 366 BSS_DECRYPTED
367 . = ALIGN(PAGE_SIZE); 367 . = ALIGN(PAGE_SIZE);
368 __bss_stop = .; 368 __bss_stop = .;
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
index ee8f8ab46941..c0309ea9abee 100644
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -259,7 +259,8 @@ static void note_wx(struct pg_state *st)
259#endif 259#endif
260 /* Account the WX pages */ 260 /* Account the WX pages */
261 st->wx_pages += npages; 261 st->wx_pages += npages;
262 WARN_ONCE(1, "x86/mm: Found insecure W+X mapping at address %pS\n", 262 WARN_ONCE(__supported_pte_mask & _PAGE_NX,
263 "x86/mm: Found insecure W+X mapping at address %pS\n",
263 (void *)st->start_address); 264 (void *)st->start_address);
264} 265}
265 266
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 0029604af8a4..dd73d5d74393 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -825,7 +825,7 @@ void __init __early_set_fixmap(enum fixed_addresses idx,
825 pte = early_ioremap_pte(addr); 825 pte = early_ioremap_pte(addr);
826 826
827 /* Sanitize 'prot' against any unsupported bits: */ 827 /* Sanitize 'prot' against any unsupported bits: */
828 pgprot_val(flags) &= __default_kernel_pte_mask; 828 pgprot_val(flags) &= __supported_pte_mask;
829 829
830 if (pgprot_val(flags)) 830 if (pgprot_val(flags))
831 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags)); 831 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));
diff --git a/arch/x86/mm/kaslr.c b/arch/x86/mm/kaslr.c
index 3f452ffed7e9..d669c5e797e0 100644
--- a/arch/x86/mm/kaslr.c
+++ b/arch/x86/mm/kaslr.c
@@ -94,7 +94,7 @@ void __init kernel_randomize_memory(void)
94 if (!kaslr_memory_enabled()) 94 if (!kaslr_memory_enabled())
95 return; 95 return;
96 96
97 kaslr_regions[0].size_tb = 1 << (__PHYSICAL_MASK_SHIFT - TB_SHIFT); 97 kaslr_regions[0].size_tb = 1 << (MAX_PHYSMEM_BITS - TB_SHIFT);
98 kaslr_regions[1].size_tb = VMALLOC_SIZE_TB; 98 kaslr_regions[1].size_tb = VMALLOC_SIZE_TB;
99 99
100 /* 100 /*
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index bc4bc7b2f075..487b8474c01c 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -728,7 +728,7 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
728{ 728{
729 int cpu; 729 int cpu;
730 730
731 struct flush_tlb_info info __aligned(SMP_CACHE_BYTES) = { 731 struct flush_tlb_info info = {
732 .mm = mm, 732 .mm = mm,
733 .stride_shift = stride_shift, 733 .stride_shift = stride_shift,
734 .freed_tables = freed_tables, 734 .freed_tables = freed_tables,
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 54357a258b35..6ebc2098cfe1 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1611,7 +1611,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg,
1611 struct screen_info *si, efi_guid_t *proto, 1611 struct screen_info *si, efi_guid_t *proto,
1612 unsigned long size); 1612 unsigned long size);
1613 1613
1614bool efi_runtime_disabled(void); 1614#ifdef CONFIG_EFI
1615extern bool efi_runtime_disabled(void);
1616#else
1617static inline bool efi_runtime_disabled(void) { return true; }
1618#endif
1619
1615extern void efi_call_virt_check_flags(unsigned long flags, const char *call); 1620extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
1616extern unsigned long efi_call_virt_save_flags(void); 1621extern unsigned long efi_call_virt_save_flags(void);
1617 1622