diff options
| author | Borislav Petkov <bp@suse.de> | 2019-04-17 17:54:41 -0400 |
|---|---|---|
| committer | Borislav Petkov <bp@suse.de> | 2019-04-17 17:54:41 -0400 |
| commit | 1bddcc645f9b3d81adaf08d86289ebd733affc86 (patch) | |
| tree | 172c5af0b63f2bb7a15ddfa48d47166e00074456 | |
| parent | dc4060a5dc2557e6b5aa813bf5b73677299d62d2 (diff) | |
| parent | a943245adc9ae31942af752e879fbbc182166573 (diff) | |
Merge x86/urgent into x86/cache
Merge it to pick up dependent urgent changes before applying more
resctrl stuff.
Signed-off-by: Borislav Petkov <bp@suse.de>
| -rw-r--r-- | arch/x86/Kconfig | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/resctrl/rdtgroup.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/process.c | 8 | ||||
| -rw-r--r-- | arch/x86/kernel/reboot.c | 21 | ||||
| -rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 2 | ||||
| -rw-r--r-- | arch/x86/mm/dump_pagetables.c | 3 | ||||
| -rw-r--r-- | arch/x86/mm/ioremap.c | 2 | ||||
| -rw-r--r-- | arch/x86/mm/tlb.c | 2 | ||||
| -rw-r--r-- | include/linux/efi.h | 7 |
9 files changed, 41 insertions, 9 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 | ||
| 1505 | config ARCH_HAS_MEM_ENCRYPT | 1505 | config ARCH_HAS_MEM_ENCRYPT |
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 | ||
| 478 | void speculation_ctrl_update(unsigned long tif) | 480 | void 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 | */ | ||
| 88 | static 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 | |||
| 84 | void __noreturn machine_real_restart(unsigned int type) | 97 | void __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/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 | ||
| 1614 | bool efi_runtime_disabled(void); | 1614 | #ifdef CONFIG_EFI |
| 1615 | extern bool efi_runtime_disabled(void); | ||
| 1616 | #else | ||
| 1617 | static inline bool efi_runtime_disabled(void) { return true; } | ||
| 1618 | #endif | ||
| 1619 | |||
| 1615 | extern void efi_call_virt_check_flags(unsigned long flags, const char *call); | 1620 | extern void efi_call_virt_check_flags(unsigned long flags, const char *call); |
| 1616 | extern unsigned long efi_call_virt_save_flags(void); | 1621 | extern unsigned long efi_call_virt_save_flags(void); |
| 1617 | 1622 | ||
