Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Thu, 10 Nov 2016, Michael Thayer wrote: > On 03.11.2016 21:02, Michal Necasek wrote: > > Sorry for the delay. I can confirm that the problem is fixed in > > 4.9.0-rc3 and prefill_possible_map no longer crashes (as it did in > > 4.9.0-rc2). Thank you! > > > > Just a side question, is the previous fix in commit ff8560512b > > (x86/boot/smp: Don't try to poke disabled/non-existent APIC) actually > > still required or would the no-op APIC driver take care of it? > > Sorry for the delay too (holiday-related). I tested 4.9.0rc4 on a 32-bit No problem. I hope you enjoyed your well earned vacation :) > VirtualBox virtual machine without I/O-APIC and can confirm that it now boots. > Since I am at it, the OHCI timer wheel-related problems are also no longer > reproducible. Thanks for reporting back! tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Thu, 10 Nov 2016, Michael Thayer wrote: > On 03.11.2016 21:02, Michal Necasek wrote: > > Sorry for the delay. I can confirm that the problem is fixed in > > 4.9.0-rc3 and prefill_possible_map no longer crashes (as it did in > > 4.9.0-rc2). Thank you! > > > > Just a side question, is the previous fix in commit ff8560512b > > (x86/boot/smp: Don't try to poke disabled/non-existent APIC) actually > > still required or would the no-op APIC driver take care of it? > > Sorry for the delay too (holiday-related). I tested 4.9.0rc4 on a 32-bit No problem. I hope you enjoyed your well earned vacation :) > VirtualBox virtual machine without I/O-APIC and can confirm that it now boots. > Since I am at it, the OHCI timer wheel-related problems are also no longer > reproducible. Thanks for reporting back! tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hello, On 03.11.2016 21:02, Michal Necasek wrote: Sorry for the delay. I can confirm that the problem is fixed in 4.9.0-rc3 and prefill_possible_map no longer crashes (as it did in 4.9.0-rc2). Thank you! Just a side question, is the previous fix in commit ff8560512b (x86/boot/smp: Don't try to poke disabled/non-existent APIC) actually still required or would the no-op APIC driver take care of it? Sorry for the delay too (holiday-related). I tested 4.9.0rc4 on a 32-bit VirtualBox virtual machine without I/O-APIC and can confirm that it now boots. Since I am at it, the OHCI timer wheel-related problems are also no longer reproducible. Regards and thanks, Michael Regards, Michal - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: pra...@redhat.com, ville.syrj...@linux.intel.com, michael.tha...@oracle.com, knut.osmund...@oracle.com, frank.mehn...@oracle.com, linux-kernel@vger.kernel.org Sent: Friday, October 28, 2016 9:37:31 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Fri, 28 Oct 2016, Thomas Gleixner wrote: On Fri, 28 Oct 2016, Michal Necasek wrote: Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d commit fixes the APIC poking on machines where there is no local APIC available (and thus fixes the committer's machine), but it doesn't work in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, and no MP tables. In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the APIC has not been set up yet because init_apic_mappings() hasn't been run. Right. That mapping setup is an utter trainwreck as we do it from multiple places, but there is no reason why we can't move it before the call to prefill_possible_map(). Thanks, tglx diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index bbfbca5fea0c..b59fdba3cbdf 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) */ get_smp_config(); + /* Make sure apic is mapped before prefill_possible_map() */ + init_apic_mappings(); + prefill_possible_map(); init_cpu_to_node(); - init_apic_mappings(); io_apic_init_mappings(); kvm_guest_init(); -- Michael Thayer | VirtualBox engineer ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt ORACLE Deutschland B.V. & Co. KG Hauptverwaltung: Riesstraße 25, D-80992 München Registergericht: Amtsgericht München, HRA 95603 Komplementärin: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697 Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hello, On 03.11.2016 21:02, Michal Necasek wrote: Sorry for the delay. I can confirm that the problem is fixed in 4.9.0-rc3 and prefill_possible_map no longer crashes (as it did in 4.9.0-rc2). Thank you! Just a side question, is the previous fix in commit ff8560512b (x86/boot/smp: Don't try to poke disabled/non-existent APIC) actually still required or would the no-op APIC driver take care of it? Sorry for the delay too (holiday-related). I tested 4.9.0rc4 on a 32-bit VirtualBox virtual machine without I/O-APIC and can confirm that it now boots. Since I am at it, the OHCI timer wheel-related problems are also no longer reproducible. Regards and thanks, Michael Regards, Michal - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: pra...@redhat.com, ville.syrj...@linux.intel.com, michael.tha...@oracle.com, knut.osmund...@oracle.com, frank.mehn...@oracle.com, linux-kernel@vger.kernel.org Sent: Friday, October 28, 2016 9:37:31 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Fri, 28 Oct 2016, Thomas Gleixner wrote: On Fri, 28 Oct 2016, Michal Necasek wrote: Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d commit fixes the APIC poking on machines where there is no local APIC available (and thus fixes the committer's machine), but it doesn't work in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, and no MP tables. In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the APIC has not been set up yet because init_apic_mappings() hasn't been run. Right. That mapping setup is an utter trainwreck as we do it from multiple places, but there is no reason why we can't move it before the call to prefill_possible_map(). Thanks, tglx diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index bbfbca5fea0c..b59fdba3cbdf 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) */ get_smp_config(); + /* Make sure apic is mapped before prefill_possible_map() */ + init_apic_mappings(); + prefill_possible_map(); init_cpu_to_node(); - init_apic_mappings(); io_apic_init_mappings(); kvm_guest_init(); -- Michael Thayer | VirtualBox engineer ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt ORACLE Deutschland B.V. & Co. KG Hauptverwaltung: Riesstraße 25, D-80992 München Registergericht: Amtsgericht München, HRA 95603 Komplementärin: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697 Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hi Thomas, Sorry for the delay. I can confirm that the problem is fixed in 4.9.0-rc3 and prefill_possible_map no longer crashes (as it did in 4.9.0-rc2). Thank you! Just a side question, is the previous fix in commit ff8560512b (x86/boot/smp: Don't try to poke disabled/non-existent APIC) actually still required or would the no-op APIC driver take care of it? Regards, Michal - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: pra...@redhat.com, ville.syrj...@linux.intel.com, michael.tha...@oracle.com, knut.osmund...@oracle.com, frank.mehn...@oracle.com, linux-kernel@vger.kernel.org Sent: Friday, October 28, 2016 9:37:31 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Fri, 28 Oct 2016, Thomas Gleixner wrote: > On Fri, 28 Oct 2016, Michal Necasek wrote: > > > > Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d > > commit fixes the APIC poking on machines where there is no local APIC > > available (and thus fixes the committer's machine), but it doesn't work > > in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, > > and no MP tables. > > > In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the > > APIC has not been set up yet because init_apic_mappings() hasn't been > > run. Right. That mapping setup is an utter trainwreck as we do it from multiple places, but there is no reason why we can't move it before the call to prefill_possible_map(). Thanks, tglx diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index bbfbca5fea0c..b59fdba3cbdf 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) */ get_smp_config(); + /* Make sure apic is mapped before prefill_possible_map() */ + init_apic_mappings(); + prefill_possible_map(); init_cpu_to_node(); - init_apic_mappings(); io_apic_init_mappings(); kvm_guest_init();
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hi Thomas, Sorry for the delay. I can confirm that the problem is fixed in 4.9.0-rc3 and prefill_possible_map no longer crashes (as it did in 4.9.0-rc2). Thank you! Just a side question, is the previous fix in commit ff8560512b (x86/boot/smp: Don't try to poke disabled/non-existent APIC) actually still required or would the no-op APIC driver take care of it? Regards, Michal - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: pra...@redhat.com, ville.syrj...@linux.intel.com, michael.tha...@oracle.com, knut.osmund...@oracle.com, frank.mehn...@oracle.com, linux-kernel@vger.kernel.org Sent: Friday, October 28, 2016 9:37:31 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Fri, 28 Oct 2016, Thomas Gleixner wrote: > On Fri, 28 Oct 2016, Michal Necasek wrote: > > > > Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d > > commit fixes the APIC poking on machines where there is no local APIC > > available (and thus fixes the committer's machine), but it doesn't work > > in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, > > and no MP tables. > > > In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the > > APIC has not been set up yet because init_apic_mappings() hasn't been > > run. Right. That mapping setup is an utter trainwreck as we do it from multiple places, but there is no reason why we can't move it before the call to prefill_possible_map(). Thanks, tglx diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index bbfbca5fea0c..b59fdba3cbdf 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) */ get_smp_config(); + /* Make sure apic is mapped before prefill_possible_map() */ + init_apic_mappings(); + prefill_possible_map(); init_cpu_to_node(); - init_apic_mappings(); io_apic_init_mappings(); kvm_guest_init();
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, Oct 28, 2016 at 09:34:53PM +0200, Thomas Gleixner wrote: > Right. That mapping setup is an utter trainwreck as we do it from multiple > places, but there is no reason why we can't move it before the call to > prefill_possible_map(). > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index bbfbca5fea0c..b59fdba3cbdf 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) >*/ > get_smp_config(); > > + /* Make sure apic is mapped before prefill_possible_map() */ > + init_apic_mappings(); > + > prefill_possible_map(); > > init_cpu_to_node(); > > - init_apic_mappings(); > io_apic_init_mappings(); > > kvm_guest_init(); FWIW, I got another user's confirmation that this works with his virtual box: https://bugzilla.suse.com/show_bug.cgi?id=1006417#c32 https://bugzilla.suse.com/show_bug.cgi?id=1006417#c33 Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, Oct 28, 2016 at 09:34:53PM +0200, Thomas Gleixner wrote: > Right. That mapping setup is an utter trainwreck as we do it from multiple > places, but there is no reason why we can't move it before the call to > prefill_possible_map(). > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index bbfbca5fea0c..b59fdba3cbdf 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) >*/ > get_smp_config(); > > + /* Make sure apic is mapped before prefill_possible_map() */ > + init_apic_mappings(); > + > prefill_possible_map(); > > init_cpu_to_node(); > > - init_apic_mappings(); > io_apic_init_mappings(); > > kvm_guest_init(); FWIW, I got another user's confirmation that this works with his virtual box: https://bugzilla.suse.com/show_bug.cgi?id=1006417#c32 https://bugzilla.suse.com/show_bug.cgi?id=1006417#c33 Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, 28 Oct 2016, Thomas Gleixner wrote: > On Fri, 28 Oct 2016, Michal Necasek wrote: > > > > Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d > > commit fixes the APIC poking on machines where there is no local APIC > > available (and thus fixes the committer's machine), but it doesn't work > > in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, > > and no MP tables. > > > In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the > > APIC has not been set up yet because init_apic_mappings() hasn't been > > run. Right. That mapping setup is an utter trainwreck as we do it from multiple places, but there is no reason why we can't move it before the call to prefill_possible_map(). Thanks, tglx diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index bbfbca5fea0c..b59fdba3cbdf 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) */ get_smp_config(); + /* Make sure apic is mapped before prefill_possible_map() */ + init_apic_mappings(); + prefill_possible_map(); init_cpu_to_node(); - init_apic_mappings(); io_apic_init_mappings(); kvm_guest_init();
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, 28 Oct 2016, Thomas Gleixner wrote: > On Fri, 28 Oct 2016, Michal Necasek wrote: > > > > Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d > > commit fixes the APIC poking on machines where there is no local APIC > > available (and thus fixes the committer's machine), but it doesn't work > > in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, > > and no MP tables. > > > In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the > > APIC has not been set up yet because init_apic_mappings() hasn't been > > run. Right. That mapping setup is an utter trainwreck as we do it from multiple places, but there is no reason why we can't move it before the call to prefill_possible_map(). Thanks, tglx diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index bbfbca5fea0c..b59fdba3cbdf 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1221,11 +1221,13 @@ void __init setup_arch(char **cmdline_p) */ get_smp_config(); + /* Make sure apic is mapped before prefill_possible_map() */ + init_apic_mappings(); + prefill_possible_map(); init_cpu_to_node(); - init_apic_mappings(); io_apic_init_mappings(); kvm_guest_init();
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, 28 Oct 2016, Michal Necasek wrote: > > Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d > commit fixes the APIC poking on machines where there is no local APIC > available (and thus fixes the committer's machine), but it doesn't work > in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, > and no MP tables. > In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the > APIC has not been set up yet because init_apic_mappings() hasn't been > run. Gah. Sorry, misunderstood you. Lemme stare in the code. Thanks, tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, 28 Oct 2016, Michal Necasek wrote: > > Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d > commit fixes the APIC poking on machines where there is no local APIC > available (and thus fixes the committer's machine), but it doesn't work > in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, > and no MP tables. > In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the > APIC has not been set up yet because init_apic_mappings() hasn't been > run. Gah. Sorry, misunderstood you. Lemme stare in the code. Thanks, tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hi Thomas, Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d commit fixes the APIC poking on machines where there is no local APIC available (and thus fixes the committer's machine), but it doesn't work in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, and no MP tables. In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the APIC has not been set up yet because init_apic_mappings() hasn't been run. Regards, Michal - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: linux-kernel@vger.kernel.org, pra...@redhat.com, ville.syrj...@linux.intel.com, michael.tha...@oracle.com, frank.mehn...@oracle.com, knut.osmund...@oracle.com Sent: Friday, October 28, 2016 8:41:46 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Fri, 28 Oct 2016, Michal Necasek wrote: > I suspect that either init_apic_mappings() needs to be called earlier or > the initial fix from commit 2a51fe08 needs to be done later. Linus tree has a fix for this: ff8560512b8d x86/boot/smp: Don't try to poke disabled/non-existent APIC It's on the way to stable as well. Can you try whether that works for you? Thanks, tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hi Thomas, Sorry if I wasn't clear. No, it doesn't work for us. The ff8560512b8d commit fixes the APIC poking on machines where there is no local APIC available (and thus fixes the committer's machine), but it doesn't work in our case, where there is a local APIC but no I/O APIC, no ACPI MADT, and no MP tables. In other words, for us boot_cpu_has(X86_FEATURE_APIC) is true but the APIC has not been set up yet because init_apic_mappings() hasn't been run. Regards, Michal - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: linux-kernel@vger.kernel.org, pra...@redhat.com, ville.syrj...@linux.intel.com, michael.tha...@oracle.com, frank.mehn...@oracle.com, knut.osmund...@oracle.com Sent: Friday, October 28, 2016 8:41:46 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Fri, 28 Oct 2016, Michal Necasek wrote: > I suspect that either init_apic_mappings() needs to be called earlier or > the initial fix from commit 2a51fe08 needs to be done later. Linus tree has a fix for this: ff8560512b8d x86/boot/smp: Don't try to poke disabled/non-existent APIC It's on the way to stable as well. Can you try whether that works for you? Thanks, tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, 28 Oct 2016, Michal Necasek wrote: > I suspect that either init_apic_mappings() needs to be called earlier or > the initial fix from commit 2a51fe08 needs to be done later. Linus tree has a fix for this: ff8560512b8d x86/boot/smp: Don't try to poke disabled/non-existent APIC It's on the way to stable as well. Can you try whether that works for you? Thanks, tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
On Fri, 28 Oct 2016, Michal Necasek wrote: > I suspect that either init_apic_mappings() needs to be called earlier or > the initial fix from commit 2a51fe08 needs to be done later. Linus tree has a fix for this: ff8560512b8d x86/boot/smp: Don't try to poke disabled/non-existent APIC It's on the way to stable as well. Can you try whether that works for you? Thanks, tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hi Thomas, In case you haven't had a chance to take a look yet... We had to dig a bit because the problem introduced by commit 2a51fe08 (arch/x86: Handle non enumerated CPU after physical hotplug) <1> is not fixed for us by commit ff856051 (arch/x86: Handle non enumerated CPU after physical hotplug) <2>. To recap, after the initial commit, systems with no local APIC panicked <4> early during boot. That showed up for us in VirtualBox, but not surprisingly, physical systems are also affected <3>. The second patch fixes systems with no local APIC, but not systems which have no ACPI MADT (or no ACPI), no MP tables, yet do have an APIC. The core problem is init ordering. In setup_arch() in arch/x86/kernel/setup.c, prefill_possible_map() is called *before* init_apic_mappings(). On typical modern systems, the local APIC will be set up either through ACPI or MP tables by the time prefill_possible_map() runs, but it is incorrect to assume that the APIC must be initialized by the time prefill_possible_map() is entered. That's why the APIC callbacks aren't no-ops there, they simply haven't been set up yet. I suspect that either init_apic_mappings() needs to be called earlier or the initial fix from commit 2a51fe08 needs to be done later. Regards, Michal <1> https://patchwork.kernel.org/patch/9366095/ <2> https://patchwork.kernel.org/patch/9390349/ <3> https://bugs.archlinux.org/task/51506 <4> Using APIC driver default ACPI: PM-Timer IO Port: 0x4008 BUG: unable to handle kernel paging request at c020 IP: [] native_apic_mem_read+0xd/0x10 *pde = 08b8a063 *pte = Oops: [#1] SMP Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.0-040900rc1-generic #201610151630 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 task: c89fda80 task.stack: c89f8000 EIP: 0060:[] EFLAGS: 00210046 CPU: 0 EIP is at native_apic_mem_read+0xd/0x10 EAX: c020 EBX: ECX: c89f9f40 EDX: f000 ESI: c8b8d000 EDI: c8b89400 EBP: c89f9f88 ESP: c89f9f84 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 CR0: 80050033 CR2: c020 CR3: 08b8c000 CR4: 00040690 Stack: c8040eb6 c89f9fb8 c8accc5e c89f9fb8 c8b8d000 c8ac424a 3312 35888000 00033120 c80ba5f7 00174f46 00174f46 0008f800 c8b8d800 08e34003 c8abe7f5 c88f4b62 Call Trace: [] ? hard_smp_processor_id+0x16/0x30 [] ? prefill_possible_map+0x16/0x137 [] ? setup_arch+0xaf3/0xbdf [] ? vprintk_default+0x37/0x40 [] ? start_kernel+0x8d/0x3d7 Code: a1 d8 89 b9 c8 5d c3 66 90 66 90 66 90 90 8b 0d b0 f5 a0 c8 8d 84 08 00 d0 ff ff 89 10 c3 8b 15 b0 f5 a0 c8 8d 84 10 00 d0 ff ff <8b> 00 c3 8b 15 20 94 9a c8 53 89 c3 b8 30 00 00 00 ff 52 78 3c EIP: [] native_apic_mem_read+0xd/0x10 SS:ESP 0068:c89f9f84 CR2: c020 ---[ end trace f68728a0d3053b52 ]--- - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: michael.tha...@oracle.com, frank.mehn...@oracle.com, knut.osmund...@oracle.com Sent: Monday, October 24, 2016 9:39:45 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Mon, 24 Oct 2016, Michal Necasek wrote: > > To explain a bit, disabling the I/O APIC also prevents the MP tables > from being created in the VirtualBox VM (historical reasons) and there > will likewise be no ACPI MADT. > > I believe the panic is triggered when neither ACPI nor MPS does any CPU > discovery. Then the local APIC isn't mapped and prefill_possible_map() > will page fault and panic because num_processors is zero and it just > assumes that the local APIC is present and accessible. > On systems with no MP tables, 'acpi=off' or 'nolapic' kernel arguments > trigger the same panic. I didn't find a way to prevent Linux from looking > at the MP tables if they're present. Hmm. In both cases we should end up with apic == apic_noop() so any access to the apic should not result in a panic. I'll have a look. Thanks, tglx
Re: 4.8.2 not booting in 32-bit VM without I/O-APIC
Hi Thomas, In case you haven't had a chance to take a look yet... We had to dig a bit because the problem introduced by commit 2a51fe08 (arch/x86: Handle non enumerated CPU after physical hotplug) <1> is not fixed for us by commit ff856051 (arch/x86: Handle non enumerated CPU after physical hotplug) <2>. To recap, after the initial commit, systems with no local APIC panicked <4> early during boot. That showed up for us in VirtualBox, but not surprisingly, physical systems are also affected <3>. The second patch fixes systems with no local APIC, but not systems which have no ACPI MADT (or no ACPI), no MP tables, yet do have an APIC. The core problem is init ordering. In setup_arch() in arch/x86/kernel/setup.c, prefill_possible_map() is called *before* init_apic_mappings(). On typical modern systems, the local APIC will be set up either through ACPI or MP tables by the time prefill_possible_map() runs, but it is incorrect to assume that the APIC must be initialized by the time prefill_possible_map() is entered. That's why the APIC callbacks aren't no-ops there, they simply haven't been set up yet. I suspect that either init_apic_mappings() needs to be called earlier or the initial fix from commit 2a51fe08 needs to be done later. Regards, Michal <1> https://patchwork.kernel.org/patch/9366095/ <2> https://patchwork.kernel.org/patch/9390349/ <3> https://bugs.archlinux.org/task/51506 <4> Using APIC driver default ACPI: PM-Timer IO Port: 0x4008 BUG: unable to handle kernel paging request at c020 IP: [] native_apic_mem_read+0xd/0x10 *pde = 08b8a063 *pte = Oops: [#1] SMP Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.0-040900rc1-generic #201610151630 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 task: c89fda80 task.stack: c89f8000 EIP: 0060:[] EFLAGS: 00210046 CPU: 0 EIP is at native_apic_mem_read+0xd/0x10 EAX: c020 EBX: ECX: c89f9f40 EDX: f000 ESI: c8b8d000 EDI: c8b89400 EBP: c89f9f88 ESP: c89f9f84 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 CR0: 80050033 CR2: c020 CR3: 08b8c000 CR4: 00040690 Stack: c8040eb6 c89f9fb8 c8accc5e c89f9fb8 c8b8d000 c8ac424a 3312 35888000 00033120 c80ba5f7 00174f46 00174f46 0008f800 c8b8d800 08e34003 c8abe7f5 c88f4b62 Call Trace: [] ? hard_smp_processor_id+0x16/0x30 [] ? prefill_possible_map+0x16/0x137 [] ? setup_arch+0xaf3/0xbdf [] ? vprintk_default+0x37/0x40 [] ? start_kernel+0x8d/0x3d7 Code: a1 d8 89 b9 c8 5d c3 66 90 66 90 66 90 90 8b 0d b0 f5 a0 c8 8d 84 08 00 d0 ff ff 89 10 c3 8b 15 b0 f5 a0 c8 8d 84 10 00 d0 ff ff <8b> 00 c3 8b 15 20 94 9a c8 53 89 c3 b8 30 00 00 00 ff 52 78 3c EIP: [] native_apic_mem_read+0xd/0x10 SS:ESP 0068:c89f9f84 CR2: c020 ---[ end trace f68728a0d3053b52 ]--- - Original Message - From: t...@linutronix.de To: michal.neca...@oracle.com Cc: michael.tha...@oracle.com, frank.mehn...@oracle.com, knut.osmund...@oracle.com Sent: Monday, October 24, 2016 9:39:45 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: 4.8.2 not booting in 32-bit VM without I/O-APIC On Mon, 24 Oct 2016, Michal Necasek wrote: > > To explain a bit, disabling the I/O APIC also prevents the MP tables > from being created in the VirtualBox VM (historical reasons) and there > will likewise be no ACPI MADT. > > I believe the panic is triggered when neither ACPI nor MPS does any CPU > discovery. Then the local APIC isn't mapped and prefill_possible_map() > will page fault and panic because num_processors is zero and it just > assumes that the local APIC is present and accessible. > On systems with no MP tables, 'acpi=off' or 'nolapic' kernel arguments > trigger the same panic. I didn't find a way to prevent Linux from looking > at the MP tables if they're present. Hmm. In both cases we should end up with apic == apic_noop() so any access to the apic should not result in a panic. I'll have a look. Thanks, tglx