From: Greg Kroah-Hartman Date: Wed, 15 Aug 2018 05:44:00 +0000 (+0200) Subject: 4.18-stable patches X-Git-Tag: v4.18.1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e29d2f474f644d8c7451c8401c64c9fdf2a519ce;p=thirdparty%2Fkernel%2Fstable-queue.git 4.18-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 --- diff --git a/queue-4.18/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch b/queue-4.18/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch new file mode 100644 index 00000000000..f4739d91b58 --- /dev/null +++ b/queue-4.18/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 +@@ -2267,6 +2267,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.18/series b/queue-4.18/series index 84f5b4c4c2e..125130e6383 100644 --- a/queue-4.18/series +++ b/queue-4.18/series @@ -77,3 +77,6 @@ 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 diff --git a/queue-4.18/x86-init-fix-build-with-config_swap-n.patch b/queue-4.18/x86-init-fix-build-with-config_swap-n.patch new file mode 100644 index 00000000000..247bf41bf26 --- /dev/null +++ b/queue-4.18/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.18/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch b/queue-4.18/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch new file mode 100644 index 00000000000..25401f6da77 --- /dev/null +++ b/queue-4.18/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 +@@ -2193,6 +2193,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 +@@ -2207,6 +2208,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