]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2018 05:44:30 +0000 (07:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2018 05:44:30 +0000 (07:44 +0200)
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

queue-4.9/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/x86-init-fix-build-with-config_swap-n.patch [new file with mode: 0644]
queue-4.9/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch [new file with mode: 0644]

diff --git a/queue-4.9/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch b/queue-4.9/cpu-hotplug-non-smp-machines-do-not-make-use-of-booted_once.patch
new file mode 100644 (file)
index 0000000..b6d2d2c
--- /dev/null
@@ -0,0 +1,39 @@
+From 269777aa530f3438ec1781586cdac0b5fe47b061 Mon Sep 17 00:00:00 2001
+From: Abel Vesa <abelvesa@linux.com>
+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 <abelvesa@linux.com>
+
+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 <dave.hansen@intel.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Tony Luck <tony.luck@intel.com>
+Signed-off-by: Abel Vesa <abelvesa@linux.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/cpu.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/kernel/cpu.c
++++ b/kernel/cpu.c
+@@ -2201,6 +2201,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);
+ }
index 483f457640f95aaebd7959bf33cd40af2195f409..4181ed3d392481eba82b74e1a9ed43cbbe4afddc 100644 (file)
@@ -105,3 +105,6 @@ x86-mm-kmmio-make-the-tracer-robust-against-l1tf.patch
 tools-headers-synchronise-x86-cpufeatures.h-for-l1tf-additions.patch
 x86-microcode-do-not-upload-microcode-if-cpus-are-offline.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.9/x86-init-fix-build-with-config_swap-n.patch b/queue-4.9/x86-init-fix-build-with-config_swap-n.patch
new file mode 100644 (file)
index 0000000..3a7b767
--- /dev/null
@@ -0,0 +1,40 @@
+From 792adb90fa724ce07c0171cbc96b9215af4b1045 Mon Sep 17 00:00:00 2001
+From: Vlastimil Babka <vbabka@suse.cz>
+Date: Tue, 14 Aug 2018 20:50:47 +0200
+Subject: x86/init: fix build with CONFIG_SWAP=n
+
+From: Vlastimil Babka <vbabka@suse.cz>
+
+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 <pruzinat@gmail.com>
+Fixes: 377eeaa8e11f ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2")
+Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
+Cc: stable@vger.kernel.org
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/mm/init.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/x86/mm/init.c
++++ b/arch/x86/mm/init.c
+@@ -783,6 +783,7 @@ void update_cache_mode_entry(unsigned en
+       __pte2cachemode_tbl[entry] = cache;
+ }
++#ifdef CONFIG_SWAP
+ unsigned long max_swapfile_size(void)
+ {
+       unsigned long pages;
+@@ -803,3 +804,4 @@ unsigned long max_swapfile_size(void)
+       }
+       return pages;
+ }
++#endif
diff --git a/queue-4.9/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch b/queue-4.9/x86-smp-fix-non-smp-broken-build-due-to-redefinition-of-apic_id_is_primary_thread.patch
new file mode 100644 (file)
index 0000000..6cdbda2
--- /dev/null
@@ -0,0 +1,46 @@
+From d0055f351e647f33f3b0329bff022213bf8aa085 Mon Sep 17 00:00:00 2001
+From: Vlastimil Babka <vbabka@suse.cz>
+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 <vbabka@suse.cz>
+
+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 <vbabka@suse.cz>
+Fixes: 6a4d2657e048 ("x86/smp: Provide topology_is_primary_thread()")
+Cc: stable@vger.kernel.org
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -2043,6 +2043,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
+@@ -2057,6 +2058,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