stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "x86/smpboot: Init apic mapping before usage" has been added to the 4.8-stable tree
@ 2016-11-08 10:36 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-11-08 10:36 UTC (permalink / raw)
  To: tglx, bp, gregkh, michal.necasek, wbauer; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    x86/smpboot: Init apic mapping before usage

to the 4.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-smpboot-init-apic-mapping-before-usage.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 1e90a13d0c3dc94512af1ccb2b6563e8297838fa Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sat, 29 Oct 2016 13:42:42 +0200
Subject: x86/smpboot: Init apic mapping before usage

From: Thomas Gleixner <tglx@linutronix.de>

commit 1e90a13d0c3dc94512af1ccb2b6563e8297838fa upstream.

The recent changes, which forced the registration of the boot cpu on UP
systems, which do not have ACPI tables, have been fixed for systems w/o
local APIC, but left a wreckage for systems which have neither ACPI nor
mptables, but the CPU has an APIC, e.g. virtualbox.

The boot process crashes in prefill_possible_map() as it wants to register
the boot cpu, which needs to access the local apic, but the local APIC is
not yet mapped.

There is no reason why init_apic_mapping() can't be invoked before
prefill_possible_map(). So instead of playing another silly early mapping
game, as the ACPI/mptables code does, we just move init_apic_mapping()
before the call to prefill_possible_map().

In hindsight, I should have noticed that combination earlier.

Sorry for the churn (also in stable)!

Fixes: ff8560512b8d ("x86/boot/smp: Don't try to poke disabled/non-existent APIC")
Reported-and-debugged-by: Michal Necasek <michal.necasek@oracle.com>
Reported-and-tested-by: Wolfgang Bauer <wbauer@tmo.at>
Cc: prarit@redhat.com
Cc: ville.syrjala@linux.intel.com
Cc: michael.thayer@oracle.com
Cc: knut.osmundsen@oracle.com
Cc: frank.mehnert@oracle.com
Cc: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1610282114380.5053@nanos
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/setup.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1222,11 +1222,16 @@ void __init setup_arch(char **cmdline_p)
 	if (smp_found_config)
 		get_smp_config();
 
+	/*
+	 * Systems w/o ACPI and mptables might not have it mapped the local
+	 * APIC yet, but prefill_possible_map() might need to access it.
+	 */
+	init_apic_mappings();
+
 	prefill_possible_map();
 
 	init_cpu_to_node();
 
-	init_apic_mappings();
 	io_apic_init_mappings();
 
 	kvm_guest_init();


Patches currently in stable-queue which might be from tglx@linutronix.de are

queue-4.8/x86-smpboot-init-apic-mapping-before-usage.patch
queue-4.8/x86-microcode-amd-fix-more-fallout-from-config_randomize_memory-y.patch
queue-4.8/timers-lock-base-for-same-bucket-optimization.patch
queue-4.8/timers-plug-locking-race-vs.-timer-migration.patch
queue-4.8/timers-prevent-base-clock-corruption-when-forwarding.patch
queue-4.8/timers-prevent-base-clock-rewind-when-forwarding-clock.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-08 10:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-08 10:36 Patch "x86/smpboot: Init apic mapping before usage" has been added to the 4.8-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).