[x86] boot/smp: Don't try to poke disabled/non-existent APIC

Closes: #841850
This commit is contained in:
Salvatore Bonaccorso 2016-10-26 08:14:56 +02:00
parent 8d9687d592
commit f86bc88075
3 changed files with 80 additions and 0 deletions

5
debian/changelog vendored
View File

@ -1,10 +1,15 @@
linux (4.8.4-1~exp2) UNRELEASED; urgency=medium
[ Ben Hutchings ]
* cpufreq: Re-enable CPU_FREQ_STAT, which can no longer be modular
* [armhf] dts: imx53: add support for USB armory board (Closes: #840137)
* kconfig: Renumber SYMBOL_NEW, fixing regression of allnoconfig
(Closes: #841357)
[ Salvatore Bonaccorso ]
* [x86] boot/smp: Don't try to poke disabled/non-existent APIC
(Closes: #841850)
-- Ben Hutchings <ben@decadent.org.uk> Mon, 24 Oct 2016 02:25:26 +0100
linux (4.8.4-1~exp1) experimental; urgency=medium

View File

@ -0,0 +1,74 @@
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
Date: Sat, 22 Oct 2016 05:18:04 +0300
Subject: x86/boot/smp: Don't try to poke disabled/non-existent APIC
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Origin: https://git.kernel.org/linus/ff8560512b8d4b7ca3ef4fd69166634ac30b2525
Bug-Debian: https://bugs.debian.org/841850
Apparently trying to poke a disabled or non-existent APIC
leads to a box that doesn't even boot. Let's not do that.
No real clue if this is the right fix, but at least my
P3 machine boots again.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: dyoung@redhat.com
Cc: kexec@lists.infradead.org
Cc: stable@vger.kernel.org
Fixes: 2a51fe083eba ("arch/x86: Handle non enumerated CPU after physical hotplug")
Link: http://lkml.kernel.org/r/1477102684-5092-1-git-send-email-ville.syrjala@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/smpboot.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 951f093..42f5eb7 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1409,15 +1409,17 @@ __init void prefill_possible_map(void)
/* No boot processor was found in mptable or ACPI MADT */
if (!num_processors) {
- int apicid = boot_cpu_physical_apicid;
- int cpu = hard_smp_processor_id();
+ if (boot_cpu_has(X86_FEATURE_APIC)) {
+ int apicid = boot_cpu_physical_apicid;
+ int cpu = hard_smp_processor_id();
- pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
+ pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu);
- /* Make sure boot cpu is enumerated */
- if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
- apic->apic_id_valid(apicid))
- generic_processor_info(apicid, boot_cpu_apic_version);
+ /* Make sure boot cpu is enumerated */
+ if (apic->cpu_present_to_apicid(0) == BAD_APICID &&
+ apic->apic_id_valid(apicid))
+ generic_processor_info(apicid, boot_cpu_apic_version);
+ }
if (!num_processors)
num_processors = 1;
--
2.10.1

View File

@ -48,6 +48,7 @@ debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch
# Arch bug fixes
bugfix/powerpc/powerpc-xmon-don-t-use-ld-on-32-bit.patch
bugfix/arm64/arm64-mm-limit-task_size_64-for-compatibility.patch
bugfix/x86/x86-boot-smp-Don-t-try-to-poke-disabled-non-existent.patch
# Arch features
features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch