From: Greg Kroah-Hartman Date: Wed, 15 Aug 2018 05:43:25 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.18.1~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1b7efe07f75c6342c39c4ce8ff69d8e792fc9be;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch x86-init-fix-build-with-config_swap-n.patch x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch x86-speculation-l1tf-unbreak-__have_arch_pfn_modify_allowed-architectures.patch --- diff --git a/queue-4.14/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch b/queue-4.14/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch new file mode 100644 index 00000000000..f064a9994c4 --- /dev/null +++ b/queue-4.14/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch @@ -0,0 +1,39 @@ +From 269777aa530f3438ec1781586cdac0b5fe47b061 Mon Sep 17 00:00:00 2001 +From: Abel Vesa +Date: Wed, 15 Aug 2018 00:26:00 +0300 +Subject: cpu/hotplug: Non-SMP machines do not make use of booted_once + +From: Abel Vesa + +commit 269777aa530f3438ec1781586cdac0b5fe47b061 upstream. + +Commit 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once") +breaks non-SMP builds. + +[ I suspect the 'bool' fields should just be made to be bitfields and be + exposed regardless of configuration, but that's a separate cleanup + that I'll leave to the owners of this file for later. - Linus ] + +Fixes: 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once") +Cc: Dave Hansen +Cc: Thomas Gleixner +Cc: Tony Luck +Signed-off-by: Abel Vesa +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/cpu.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -2279,6 +2279,8 @@ void __init boot_cpu_init(void) + */ + void __init boot_cpu_hotplug_init(void) + { ++#ifdef CONFIG_SMP + this_cpu_write(cpuhp_state.booted_once, true); ++#endif + this_cpu_write(cpuhp_state.state, CPUHP_ONLINE); + } diff --git a/queue-4.14/series b/queue-4.14/series index 4a1fbef7733..0c23cb84945 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -102,3 +102,7 @@ x86-mm-pat-make-set_memory_np-l1tf-safe.patch x86-mm-kmmio-make-the-tracer-robust-against-l1tf.patch tools-headers-synchronise-x86-cpufeatures.h-for-l1tf-additions.patch x86-microcode-allow-late-microcode-loading-with-smt-disabled.patch +x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch +cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch +x86-init-fix-build-with-config_swap-n.patch +x86-speculation-l1tf-unbreak-__have_arch_pfn_modify_allowed-architectures.patch diff --git a/queue-4.14/x86-init-fix-build-with-config_swap-n.patch b/queue-4.14/x86-init-fix-build-with-config_swap-n.patch new file mode 100644 index 00000000000..247bf41bf26 --- /dev/null +++ b/queue-4.14/x86-init-fix-build-with-config_swap-n.patch @@ -0,0 +1,40 @@ +From 792adb90fa724ce07c0171cbc96b9215af4b1045 Mon Sep 17 00:00:00 2001 +From: Vlastimil Babka +Date: Tue, 14 Aug 2018 20:50:47 +0200 +Subject: x86/init: fix build with CONFIG_SWAP=n + +From: Vlastimil Babka + +commit 792adb90fa724ce07c0171cbc96b9215af4b1045 upstream. + +The introduction of generic_max_swapfile_size and arch-specific versions has +broken linking on x86 with CONFIG_SWAP=n due to undefined reference to +'generic_max_swapfile_size'. Fix it by compiling the x86-specific +max_swapfile_size() only with CONFIG_SWAP=y. + +Reported-by: Tomas Pruzina +Fixes: 377eeaa8e11f ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2") +Signed-off-by: Vlastimil Babka +Cc: stable@vger.kernel.org +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/mm/init.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/x86/mm/init.c ++++ b/arch/x86/mm/init.c +@@ -883,6 +883,7 @@ void update_cache_mode_entry(unsigned en + __pte2cachemode_tbl[entry] = cache; + } + ++#ifdef CONFIG_SWAP + unsigned long max_swapfile_size(void) + { + unsigned long pages; +@@ -903,3 +904,4 @@ unsigned long max_swapfile_size(void) + } + return pages; + } ++#endif diff --git a/queue-4.14/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch b/queue-4.14/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch new file mode 100644 index 00000000000..3c768b654ec --- /dev/null +++ b/queue-4.14/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch @@ -0,0 +1,46 @@ +From d0055f351e647f33f3b0329bff022213bf8aa085 Mon Sep 17 00:00:00 2001 +From: Vlastimil Babka +Date: Tue, 14 Aug 2018 23:38:57 +0200 +Subject: x86/smp: fix non-SMP broken build due to redefinition of apic_id_is_primary_thread +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Vlastimil Babka + +commit d0055f351e647f33f3b0329bff022213bf8aa085 upstream. + +The function has an inline "return false;" definition with CONFIG_SMP=n +but the "real" definition is also visible leading to "redefinition of +‘apic_id_is_primary_thread’" compiler error. + +Guard it with #ifdef CONFIG_SMP + +Signed-off-by: Vlastimil Babka +Fixes: 6a4d2657e048 ("x86/smp: Provide topology_is_primary_thread()") +Cc: stable@vger.kernel.org +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/apic/apic.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/x86/kernel/apic/apic.c ++++ b/arch/x86/kernel/apic/apic.c +@@ -2094,6 +2094,7 @@ static int cpuid_to_apicid[] = { + [0 ... NR_CPUS - 1] = -1, + }; + ++#ifdef CONFIG_SMP + /** + * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread + * @id: APIC ID to check +@@ -2108,6 +2109,7 @@ bool apic_id_is_primary_thread(unsigned + mask = (1U << (fls(smp_num_siblings) - 1)) - 1; + return !(apicid & mask); + } ++#endif + + /* + * Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids diff --git a/queue-4.14/x86-speculation-l1tf-unbreak-__have_arch_pfn_modify_allowed-architectures.patch b/queue-4.14/x86-speculation-l1tf-unbreak-__have_arch_pfn_modify_allowed-architectures.patch new file mode 100644 index 00000000000..10dbf5f0105 --- /dev/null +++ b/queue-4.14/x86-speculation-l1tf-unbreak-__have_arch_pfn_modify_allowed-architectures.patch @@ -0,0 +1,72 @@ +From 6c26fcd2abfe0a56bbd95271fce02df2896cfd24 Mon Sep 17 00:00:00 2001 +From: Jiri Kosina +Date: Sat, 14 Jul 2018 21:56:13 +0200 +Subject: x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures + +From: Jiri Kosina + +commit 6c26fcd2abfe0a56bbd95271fce02df2896cfd24 upstream. + +pfn_modify_allowed() and arch_has_pfn_modify_check() are outside of the +!__ASSEMBLY__ section in include/asm-generic/pgtable.h, which confuses +assembler on archs that don't have __HAVE_ARCH_PFN_MODIFY_ALLOWED (e.g. +ia64) and breaks build: + + include/asm-generic/pgtable.h: Assembler messages: + include/asm-generic/pgtable.h:538: Error: Unknown opcode `static inline bool pfn_modify_allowed(unsigned long pfn,pgprot_t prot)' + include/asm-generic/pgtable.h:540: Error: Unknown opcode `return true' + include/asm-generic/pgtable.h:543: Error: Unknown opcode `static inline bool arch_has_pfn_modify_check(void)' + include/asm-generic/pgtable.h:545: Error: Unknown opcode `return false' + arch/ia64/kernel/entry.S:69: Error: `mov' does not fit into bundle + +Move those two static inlines into the !__ASSEMBLY__ section so that they +don't confuse the asm build pass. + +Fixes: 42e4089c7890 ("x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings") +Signed-off-by: Jiri Kosina +Signed-off-by: Thomas Gleixner +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + include/asm-generic/pgtable.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +--- a/include/asm-generic/pgtable.h ++++ b/include/asm-generic/pgtable.h +@@ -1055,6 +1055,18 @@ int phys_mem_access_prot_allowed(struct + static inline void init_espfix_bsp(void) { } + #endif + ++#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED ++static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot) ++{ ++ return true; ++} ++ ++static inline bool arch_has_pfn_modify_check(void) ++{ ++ return false; ++} ++#endif /* !_HAVE_ARCH_PFN_MODIFY_ALLOWED */ ++ + #endif /* !__ASSEMBLY__ */ + + #ifndef io_remap_pfn_range +@@ -1069,16 +1081,4 @@ static inline void init_espfix_bsp(void) + #endif + #endif + +-#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED +-static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot) +-{ +- return true; +-} +- +-static inline bool arch_has_pfn_modify_check(void) +-{ +- return false; +-} +-#endif +- + #endif /* _ASM_GENERIC_PGTABLE_H */