RE: arch/x86/kernel/apic/apic.c: calibrate_APIC_clock() soft hangs when PIC is not configured by BIOS before kernel is launched.
From: Kirkendall, Garrett
Date: Thu May 09 2019 - 10:16:46 EST
1. Is it correct to probe the 8259 before it is initialized by the kernel? The 8259 will not respond properly to the probe unless it is properly initialized.
2. Should IOAPIC interrupts 0-15 require the legacy PIC be available and initialized by the BIOS?
2. The kernel will not boot if there is no legacy 8259 PIC even if all the other factors stated are provided.
I want to understand why a preinitialized 8259 is a requirement for a system configured to use the IOAPIC?
SMTS Firmware Engineer | CTE
7171 Southwest Parkway, Austin, TX 78735 USA
AMD facebook | amd.com
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Sent: Thursday, May 9, 2019 8:32 AM
To: Kirkendall, Garrett <Garrett.Kirkendall@xxxxxxx>
Cc: nstange@xxxxxxx; luto@xxxxxxxxxx; natechancellor@xxxxxxxxx; x86@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: arch/x86/kernel/apic/apic.c: calibrate_APIC_clock() soft hangs when PIC is not configured by BIOS before kernel is launched.
[CAUTION: External Email]
On Thu, 9 May 2019, Kirkendall, Garrett wrote:
> I am trying to boot a UEFI BIOS with minimal legacy hardware support.
> The Linux kernel soft hangs when the PIC is not configured by the BIOS
> because it is using IOAPIC. Hopefully, this provides enough information.
> Soft hang occurs in calibrate_APIC_clock():
> If 8259A PIC is not configured before kernel is launched, HPET IRQ 0
> registration fails because probe_8259A returns PIC as not available
> and therefore interrupt descriptors 0-15 are not allocated. This
> happens when BIOS does not configure 8259A PIC because it uses IOAPIC.
Right. Works as designed.
There is not much we can do at that point, unless your platform has other means to provide the TSC frequency (cpuid or MSR) along with the bus frequency which is fed into the local apic timer.