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
This commit is contained in:
Linus Torvalds 2019-04-20 10:01:11 -07:00
commit 1fd91d719e
12 changed files with 47 additions and 15 deletions

View File

@ -1499,7 +1499,7 @@ config X86_CPA_STATISTICS
depends on DEBUG_FS depends on DEBUG_FS
---help--- ---help---
Expose statistics about the Change Page Attribute mechanims, which Expose statistics about the Change Page Attribute mechanims, which
helps to determine the effectivness of preserving large and huge helps to determine the effectiveness of preserving large and huge
page mappings when mapping protections are changed. page mappings when mapping protections are changed.
config ARCH_HAS_MEM_ENCRYPT config ARCH_HAS_MEM_ENCRYPT

View File

@ -275,7 +275,7 @@ static const struct {
const char *option; const char *option;
enum spectre_v2_user_cmd cmd; enum spectre_v2_user_cmd cmd;
bool secure; bool secure;
} v2_user_options[] __initdata = { } v2_user_options[] __initconst = {
{ "auto", SPECTRE_V2_USER_CMD_AUTO, false }, { "auto", SPECTRE_V2_USER_CMD_AUTO, false },
{ "off", SPECTRE_V2_USER_CMD_NONE, false }, { "off", SPECTRE_V2_USER_CMD_NONE, false },
{ "on", SPECTRE_V2_USER_CMD_FORCE, true }, { "on", SPECTRE_V2_USER_CMD_FORCE, true },
@ -419,7 +419,7 @@ static const struct {
const char *option; const char *option;
enum spectre_v2_mitigation_cmd cmd; enum spectre_v2_mitigation_cmd cmd;
bool secure; bool secure;
} mitigation_options[] __initdata = { } mitigation_options[] __initconst = {
{ "off", SPECTRE_V2_CMD_NONE, false }, { "off", SPECTRE_V2_CMD_NONE, false },
{ "on", SPECTRE_V2_CMD_FORCE, true }, { "on", SPECTRE_V2_CMD_FORCE, true },
{ "retpoline", SPECTRE_V2_CMD_RETPOLINE, false }, { "retpoline", SPECTRE_V2_CMD_RETPOLINE, false },
@ -658,7 +658,7 @@ static const char * const ssb_strings[] = {
static const struct { static const struct {
const char *option; const char *option;
enum ssb_mitigation_cmd cmd; enum ssb_mitigation_cmd cmd;
} ssb_mitigation_options[] __initdata = { } ssb_mitigation_options[] __initconst = {
{ "auto", SPEC_STORE_BYPASS_CMD_AUTO }, /* Platform decides */ { "auto", SPEC_STORE_BYPASS_CMD_AUTO }, /* Platform decides */
{ "on", SPEC_STORE_BYPASS_CMD_ON }, /* Disable Speculative Store Bypass */ { "on", SPEC_STORE_BYPASS_CMD_ON }, /* Disable Speculative Store Bypass */
{ "off", SPEC_STORE_BYPASS_CMD_NONE }, /* Don't touch Speculative Store Bypass */ { "off", SPEC_STORE_BYPASS_CMD_NONE }, /* Don't touch Speculative Store Bypass */

View File

@ -611,8 +611,8 @@ static void init_intel_energy_perf(struct cpuinfo_x86 *c)
if ((epb & 0xF) != ENERGY_PERF_BIAS_PERFORMANCE) if ((epb & 0xF) != ENERGY_PERF_BIAS_PERFORMANCE)
return; return;
pr_warn_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n"); pr_info_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n");
pr_warn_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n"); pr_info_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n");
epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL; epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL;
wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
} }

View File

@ -2610,9 +2610,10 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
rdt_last_cmd_puts("Failed to initialize allocations\n"); rdt_last_cmd_puts("Failed to initialize allocations\n");
return ret; return ret;
} }
rdtgrp->mode = RDT_MODE_SHAREABLE;
} }
rdtgrp->mode = RDT_MODE_SHAREABLE;
return 0; return 0;
} }

View File

@ -426,6 +426,8 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp,
u64 msr = x86_spec_ctrl_base; u64 msr = x86_spec_ctrl_base;
bool updmsr = false; bool updmsr = false;
lockdep_assert_irqs_disabled();
/* /*
* If TIF_SSBD is different, select the proper mitigation * If TIF_SSBD is different, select the proper mitigation
* method. Note that if SSBD mitigation is disabled or permanentely * 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)
void speculation_ctrl_update(unsigned long tif) void speculation_ctrl_update(unsigned long tif)
{ {
unsigned long flags;
/* Forced update. Make sure all relevant TIF flags are different */ /* Forced update. Make sure all relevant TIF flags are different */
preempt_disable(); local_irq_save(flags);
__speculation_ctrl_update(~tif, tif); __speculation_ctrl_update(~tif, tif);
preempt_enable(); local_irq_restore(flags);
} }
/* Called from seccomp/prctl update */ /* Called from seccomp/prctl update */

View File

@ -81,6 +81,19 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
return 0; return 0;
} }
/*
* Some machines don't handle the default ACPI reboot method and
* require the EFI reboot method:
*/
static int __init set_efi_reboot(const struct dmi_system_id *d)
{
if (reboot_type != BOOT_EFI && !efi_runtime_disabled()) {
reboot_type = BOOT_EFI;
pr_info("%s series board detected. Selecting EFI-method for reboot.\n", d->ident);
}
return 0;
}
void __noreturn machine_real_restart(unsigned int type) void __noreturn machine_real_restart(unsigned int type)
{ {
local_irq_disable(); local_irq_disable();
@ -166,6 +179,14 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = {
DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
}, },
}, },
{ /* Handle reboot issue on Acer TravelMate X514-51T */
.callback = set_efi_reboot,
.ident = "Acer TravelMate X514-51T",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
},
},
/* Apple */ /* Apple */
{ /* Handle problems with rebooting on Apple MacBook5 */ { /* Handle problems with rebooting on Apple MacBook5 */

View File

@ -362,7 +362,7 @@ SECTIONS
.bss : AT(ADDR(.bss) - LOAD_OFFSET) { .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
__bss_start = .; __bss_start = .;
*(.bss..page_aligned) *(.bss..page_aligned)
*(.bss) *(BSS_MAIN)
BSS_DECRYPTED BSS_DECRYPTED
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__bss_stop = .; __bss_stop = .;

View File

@ -259,7 +259,8 @@ static void note_wx(struct pg_state *st)
#endif #endif
/* Account the WX pages */ /* Account the WX pages */
st->wx_pages += npages; st->wx_pages += npages;
WARN_ONCE(1, "x86/mm: Found insecure W+X mapping at address %pS\n", WARN_ONCE(__supported_pte_mask & _PAGE_NX,
"x86/mm: Found insecure W+X mapping at address %pS\n",
(void *)st->start_address); (void *)st->start_address);
} }

View File

@ -825,7 +825,7 @@ void __init __early_set_fixmap(enum fixed_addresses idx,
pte = early_ioremap_pte(addr); pte = early_ioremap_pte(addr);
/* Sanitize 'prot' against any unsupported bits: */ /* Sanitize 'prot' against any unsupported bits: */
pgprot_val(flags) &= __default_kernel_pte_mask; pgprot_val(flags) &= __supported_pte_mask;
if (pgprot_val(flags)) if (pgprot_val(flags))
set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags)); set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));

View File

@ -94,7 +94,7 @@ void __init kernel_randomize_memory(void)
if (!kaslr_memory_enabled()) if (!kaslr_memory_enabled())
return; return;
kaslr_regions[0].size_tb = 1 << (__PHYSICAL_MASK_SHIFT - TB_SHIFT); kaslr_regions[0].size_tb = 1 << (MAX_PHYSMEM_BITS - TB_SHIFT);
kaslr_regions[1].size_tb = VMALLOC_SIZE_TB; kaslr_regions[1].size_tb = VMALLOC_SIZE_TB;
/* /*

View File

@ -728,7 +728,7 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
{ {
int cpu; int cpu;
struct flush_tlb_info info __aligned(SMP_CACHE_BYTES) = { struct flush_tlb_info info = {
.mm = mm, .mm = mm,
.stride_shift = stride_shift, .stride_shift = stride_shift,
.freed_tables = freed_tables, .freed_tables = freed_tables,

View File

@ -1611,7 +1611,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg,
struct screen_info *si, efi_guid_t *proto, struct screen_info *si, efi_guid_t *proto,
unsigned long size); unsigned long size);
bool efi_runtime_disabled(void); #ifdef CONFIG_EFI
extern bool efi_runtime_disabled(void);
#else
static inline bool efi_runtime_disabled(void) { return true; }
#endif
extern void efi_call_virt_check_flags(unsigned long flags, const char *call); extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
extern unsigned long efi_call_virt_save_flags(void); extern unsigned long efi_call_virt_save_flags(void);