Skip to contentSkip to conversation

Dovetail boot hang on x86, kvm

DISCUSSION Florian Bezdeka 2 participants 2 messages Feb 26, 2025

lore
Share & tools
lore
#0 lore raw

Hi all,

Jan recently reported the following boot hang on his KVM system when the host was running at high load:

[    0.005000] x2apic enabled
[    0.008000] APIC: Switched APIC routing to: cluster x2apic
[    0.009000] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.012000] Kernel panic - not syncing: timer doesn't work through Interrupt-remapped IO-APIC
[    0.012000] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.12.8+ #136
[    0.012000] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
[    0.012000] IRQ stage: Linux
[    0.012000] Call Trace:
[    0.012000]  <TASK>
[    0.012000]  dump_stack_lvl+0x8b/0xd0
[    0.012000]  panic+0x112/0x2e0
[    0.012000]  panic_if_irq_remap+0x19/0x20
[    0.012000]  check_timer+0x1fd/0x620
[    0.012000]  ? lock_release+0x214/0x2a0
[    0.012000]  setup_IO_APIC+0x17a/0x1d0
[    0.012000]  apic_intr_mode_init+0xd0/0xe0
[    0.012000]  x86_late_time_init+0x20/0x40
[    0.012000]  start_kernel+0x8d7/0x970
[    0.012000]  x86_64_start_reservations+0x20/0x20
[    0.012000]  x86_64_start_kernel+0x87/0x90
[    0.012000]  common_startup_64+0x13e/0x148
[    0.012000]  </TASK>

I revisited timer_irq_works() and friends, where the necessary Dovetail specific changes are in place.

If my interpretation is correct the Dovetail enabled guest does not receive a timer IRQ while making progress (reading TSC).

Is there something we could do? Seems the KVM (host) was too busy to inject the timer IRQs and that this could happen on vanilla Linux the same way...

Best regards,
Florian

#1 lore raw
Quoted 28 lines · Florian Bezdeka

Hi all,

Jan recently reported the following boot hang on his KVM system when the host was running at high load:

[    0.005000] x2apic enabled
[    0.008000] APIC: Switched APIC routing to: cluster x2apic
[    0.009000] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.012000] Kernel panic - not syncing: timer doesn't work through Interrupt-remapped IO-APIC
[    0.012000] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.12.8+ #136
[    0.012000] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
[    0.012000] IRQ stage: Linux
[    0.012000] Call Trace:
[    0.012000]  <TASK>
[    0.012000]  dump_stack_lvl+0x8b/0xd0
[    0.012000]  panic+0x112/0x2e0
[    0.012000]  panic_if_irq_remap+0x19/0x20
[    0.012000]  check_timer+0x1fd/0x620
[    0.012000]  ? lock_release+0x214/0x2a0
[    0.012000]  setup_IO_APIC+0x17a/0x1d0
[    0.012000]  apic_intr_mode_init+0xd0/0xe0
[    0.012000]  x86_late_time_init+0x20/0x40
[    0.012000]  start_kernel+0x8d7/0x970
[    0.012000]  x86_64_start_reservations+0x20/0x20
[    0.012000]  x86_64_start_kernel+0x87/0x90
[    0.012000]  common_startup_64+0x13e/0x148
[    0.012000]  </TASK>
Quoted 6 lines

I revisited timer_irq_works() and friends, where the necessary Dovetail specific changes are in place.

If my interpretation is correct the Dovetail enabled guest does not receive a timer IRQ while making progress (reading TSC).

So no tick was received after 4 jiffies? What if this delay is significantly extended, is it the host actually too slowed down to send it on time, or the interrupt request not making its way on the guest side? Typically, could a tick be lingering in the interrupt log of the CPU running timer_irq_works()?

To check the latter, we could poll for the log state along the following lines, inside the readtsc() loop, e.g.

	struct irq_stage_data *p;
	unsigned long flags;

        flags = hard_local_irq_save();
	p = this_inband_staged();
	if (stage_irqs_pending(p)) {
                /* Houston, we have a problem. */
        }
	hard_local_irq_restore(flags);

Since we are running with hard irqs on, inband stage unstalled, except while polling the log, no IRQ should be lingering in the latter.

Signature · 1 line
Philippe.