dovetail: IO-APIC IRQ storm
Hi Philippe,
it seems I'm facing a problem with dovetail on x86 related to IRQs routed through the IO-APIC.
Note the stack trace below, it seems that once we ACK the IRQ in ioapic_ack_level() by calling __ack_APIC_irq() we immediately get the next IRQ.
cat /proc/interrupts delivers (minimized to the relevant IRQ):
CPU0 CPU1 CPU2 CPU3
21: 0 2392 0 0 IO-APIC 21 -fasteoi ahci[0000:00:0d.0], snd_intel8x0
Seems IRQ masking does not work as expected. I have to add more debugging code but it looks like an IRQ storm for now. I have the following options in mind right now, but there might be more:
- Masking of the AHCI IRQ does not work as expected
- HW IRQs are ON where they should be OFF
I'm using a VirtualBox based environment for reproducing this issue. KVM or qemu based setups are normally not affected. There is no level triggered IRQ that is routed through IO-APIC.
The following stack trace was triggered by calling stress-ng with the --iomix parameter. The --iomix stressor is the root cause. Handling the AHCI controller IRQs causes the kernel splat after some time.
[ 250.001238] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: [ 250.006135] rcu: 1-...0: (0 ticks this GP) idle=5d2c/1/0x4000000000000000 softirq=13252/13252 fqs=41 [ 250.014785] (detected by 3, t=5267 jiffies, g=4317, q=58979 ncpus=4) [ 250.018606] Sending NMI from CPU 3 to CPUs 1: [ 250.021755] NMI backtrace for cpu 1 [ 250.021759] CPU: 1 PID: 732 Comm: stress-ng-vm Not tainted 6.1.34-xenomai-1 #1 [ 250.021764] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 250.021765] IRQ stage: Xenomai [ 250.021767] RIP: 0010:native_apic_mem_write+0x8/0x10 [ 250.021775] Code: 9b 00 0f 1f 44 00 00 be 01 00 00 00 e9 e1 07 0b 00 90 0f 1f 44 00 00 b8 01 00 00 00 c3 cc cc cc cc cc 89 ff 89 b7 00 d0 5f ff <c3> cc cc cc cc 0f 1f 00 89 ff 8b 87 00 d0 5f ff c3 cc cc cc cc 0f [ 250.021777] RSP: 0000:ffffb401400e0db8 EFLAGS: 00010046 [ 250.021780] RAX: ffffffff91a5cdf0 RBX: ffff8a6e82901428 RCX: 0000000000000000 [ 250.021783] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 00000000000000b0 [ 250.021784] RBP: ffff8a6eaf5b7d80 R08: 0000000000000000 R09: 0000000000000000 [ 250.021786] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000004 [ 250.021787] R13: 0000000000000022 R14: ffff8a6efdcd0210 R15: ffff8a6e82901400 [ 250.021789] FS: 00007f7808535740(0000) GS:ffff8a6efdc80000(0000) knlGS:0000000000000000 [ 250.021792] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 250.021794] CR2: 00007f78085356b8 CR3: 0000000004190002 CR4: 00000000000306e0 [ 250.021796] Call Trace: [ 250.021798] <NMI> [ 250.021802] ? nmi_cpu_backtrace.cold+0x1b/0x91 [ 250.021808] ? native_apic_mem_write+0x8/0x10 [ 250.021811] ? nmi_cpu_backtrace_handler+0xd/0x20 [ 250.021813] ? nmi_handle+0x62/0x130 [ 250.021817] ? native_apic_mem_write+0x8/0x10 [ 250.021820] ? default_do_nmi+0x69/0x170 [ 250.021823] ? exc_nmi+0x119/0x150 [ 250.021826] ? end_repeat_nmi+0x16/0x67 [ 250.021829] ? arch_restore_msi_irqs+0x10/0x10 [ 250.021834] ? native_apic_mem_write+0x8/0x10 [ 250.021836] ? native_apic_mem_write+0x8/0x10 [ 250.021839] ? native_apic_mem_write+0x8/0x10 [ 250.021841] </NMI> [ 250.021842] <IRQ> [ 250.021843] ioapic_ack_level+0x91/0xc0 [ 250.021846] handle_fasteoi_irq+0x90/0x280 [ 250.021851] generic_pipeline_irq_desc+0xb0/0x160 [ 250.021856] arch_handle_irq+0x5d/0x1e0 [ 250.021860] arch_pipeline_entry+0x3b/0x110 [ 250.021864] asm_common_interrupt+0x22/0x40 [ 250.021867] RIP: 0010:iowrite32+0x1e/0x60 [ 250.021871] Code: cc cc cc 66 0f 1f 84 00 00 00 00 00 48 81 fe ff ff 03 00 76 07 89 3e c3 cc cc cc cc 48 81 fe 00 00 01 00 76 0a 89 f8 89 f2 ef <c3> cc cc cc cc 8b 05 17 0e e6 01 85 c0 75 05 c3 cc cc cc cc 83 e8 [ 250.021873] RSP: 0000:ffffb401400e0f30 EFLAGS: 00010206 [ 250.021875] RAX: 0000000000000100 RBX: ffff8a6e84404900 RCX: 0000000000000000 [ 250.021876] RDX: 000000000001d230 RSI: 000000000001d230 RDI: 0000000000000100 [ 250.021878] RBP: 0000000000000000 R08: ffff8a6e814017a0 R09: ffffffff93ccf5e0 [ 250.021879] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 250.021881] R13: 0000000000000100 R14: ffff8a6e82901400 R15: ffff8a6e8403e928 [ 250.021888] snd_intel8x0_interrupt+0x1f9/0x260 [snd_intel8x0] [ 250.021898] __handle_irq_event_percpu+0x4e/0x180 [ 250.021903] handle_irq_event+0x46/0xc0 [ 250.021906] handle_fasteoi_irq+0x119/0x280 [ 250.021909] arch_do_IRQ_pipelined+0x136/0x770 [ 250.021912] </IRQ> [ 250.021913] <TASK> [ 250.021915] sync_current_irq_stage+0x1b5/0x260 [ 250.021919] handle_irq_pipelined_finish+0x9f/0x190 [ 250.021923] arch_pipeline_entry+0xd6/0x110 [ 250.021926] asm_common_interrupt+0x22/0x40 [ 250.021928] RIP: 0033:0x5595ca6bdbb4 [ 250.021931] Code: Unable to access opcode bytes at 0x5595ca6bdb8a. [ 250.021932] RSP: 002b:00007ffcbc3f74d0 EFLAGS: 00010202 [ 250.021934] RAX: 000000000000003f RBX: 0000000002000000 RCX: 0000000000000006 [ 250.021935] RDX: 00007f78077e814c RSI: 0000000042856595 RDI: c40021cdadb0a14c [ 250.021937] RBP: 00007f7805cde000 R08: ffffffffffffffff R09: 8f0000000017116d [ 250.021938] R10: 0000000000000040 R11: 8f0000000017116d R12: 00007ffcbc3f76e0 [ 250.021939] R13: 00000000430e4299 R14: 0000000000000001 R15: 0000000000000000 [ 250.021943] </TASK>
Any ideas, thoughts? Would love to hear them!
Best regards,
Florian
Quoted 11 lines · Florian Bezdeka
Hi Philippe,
it seems I'm facing a problem with dovetail on x86 related to IRQs routed through the IO-APIC.
Note the stack trace below, it seems that once we ACK the IRQ in
ioapic_ack_level()by calling__ack_APIC_irq()we immediately get the next IRQ.cat
/proc/interruptsdelivers (minimized to the relevant IRQ):
Quoted 8 lines
CPU0 CPU1 CPU2 CPU3
21: 0 2392 0 0 IO-APIC 21 -fasteoi ahci[0000:00:0d.0],snd_intel8x0Seems IRQ masking does not work as expected. I have to add more debugging code but it looks like an IRQ storm for now. I have the following options in mind right now, but there might be more:
- Masking of the AHCI IRQ does not work as expected
The ioapic backend code is unchanged for mask_ioapic_irq() aside of the conversion to hard spinlocking, so maybe the generic portion there unexpectedly detecting a masked line, blocking the actual masking?
void mask_irq(struct irq_desc *desc)
{
if (irqd_irq_masked(&desc->irq_data))
return;Quoted 1 line
- HW IRQs are ON where they should be OFF
It does not seem so. Looking at the backtrace, the kernel would most likely have entered a deadlock on this instead:
void handle_fasteoi_irq(struct irq_desc *desc)
{
struct irq_chip *chip = desc->irq_data.chip;
raw_spin_lock(&desc->lock);- IRQ migration in ioapic_ack_level()? Something unexpected due to preparing/completing it? There is some Dovetail-specific code there, which defers the migration from oob context to a workqueue.
Signature · 1 line
Philippe.
Quoted 22 lines · Philippe Gerum
Quoted 11 lines · Florian Bezdeka
Hi Philippe,
it seems I'm facing a problem with dovetail on x86 related to IRQs routed through the IO-APIC.
Note the stack trace below, it seems that once we ACK the IRQ in
ioapic_ack_level()by calling__ack_APIC_irq()we immediately get the next IRQ.cat
/proc/interruptsdelivers (minimized to the relevant IRQ):Quoted 8 lines
CPU0 CPU1 CPU2 CPU3
21: 0 2392 0 0 IO-APIC 21 -fasteoi ahci[0000:00:0d.0],snd_intel8x0Seems IRQ masking does not work as expected. I have to add more debugging code but it looks like an IRQ storm for now. I have the following options in mind right now, but there might be more:
- Masking of the AHCI IRQ does not work as expected
Quoted 8 lines
The ioapic backend code is unchanged for
mask_ioapic_irq()aside of the conversion to hard spinlocking, so maybe the generic portion there unexpectedly detecting a masked line, blocking the actual masking?void
mask_irq(struct irq_desc *desc){ if (irqd_irq_masked(&desc->irq_data)) return;
I added a WARN() here, so whenever we skip calling the low level chip.irq_mask() function I get notified.
This happens from time to time for my affected IRQ 21.
When it happens, the unmask_irq() also skips calling the chip.irq_unmask() function.
Warning from mask_irq:
[ 1914.059288] ------------[ cut here ]------------ [ 1914.059304] IRQ(21) already masked. [ 1914.059330] WARNING: CPU: 2 PID: 567 at kernel/irq/chip.c:430 mask_irq+0x4b/0x60 [ 1914.059375] Modules linked in: intel_rapl_msr intel_rapl_common ghash_clmulni_intel sha512_ssse3 sha512_generic vmwgfx snd_pcm drm_ttm_helper ttm snd_timer snd drm_kms_helper soundcore aesni_intel crypto_simd fb_sys_fops cryptd pcspkr syscopyarea sysfillrect sysimgblt vboxguest ac button joydev evdev serio_raw sg binfmt_misc loop dm_mod fuse efi_pstore drm dax configfs ip_tables x_tables autofs4 ext4 crc32c_generic crc16 mbcache jbd2 hid_generic usbhid hid sd_mod t10_pi crc64_rocksoft crc64 crc_t10dif sr_mod cdrom crct10dif_generic ata_generic ohci_pci ahci ata_piix libahci crct10dif_pclmul crct10dif_common libata crc32_pclmul ehci_pci ohci_hcd ehci_hcd crc32c_intel psmouse scsi_mod e1000 usbcore i2c_piix4 usb_common scsi_common video wmi [ 1914.060573] CPU: 2 PID: 567 Comm: stress-ng-cpu Tainted: G W 6.1.37-xenomai-1 #1 [ 1914.060587] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 1914.060598] IRQ stage: Xenomai [ 1914.060621] RIP: 0010:mask_irq+0x4b/0x60 [ 1914.060635] Code: 74 13 48 8d 7f 28 e8 b4 94 cf 00 48 8b 43 38 81 08 00 00 02 00 5b e9 e4 96 cf 00 8b 77 2c 48 c7 c7 ee 47 4f 9a e8 85 ff f7 ff <0f> 0b 5b e9 cd 96 cf 00 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f [ 1914.060638] RSP: 0000:ffffc1420103bd78 EFLAGS: 00010082 [ 1914.060737] RAX: 0000000000000000 RBX: ffffa061f6252200 RCX: 0000000000000000 [ 1914.060750] RDX: 0000000003000002 RSI: ffffffff9a533156 RDI: 00000000ffffffff [ 1914.060763] RBP: ffffa061f62522c8 R08: 8000000100000356 R09: 0000000000000001 [ 1914.060842] R10: 3fffffffffffffff R11: ffffffff9c194a16 R12: ffffffff9ae3c8c0 [ 1914.060855] R13: ffffa061f6252200 R14: 0000000000000000 R15: ffffa061f6252200 [ 1914.060932] FS: 00007f41397e6740(0000) GS:ffffa0623dd00000(0000) knlGS:0000000000000000 [ 1914.060947] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1914.060960] CR2: 00007fff3e274dc3 CR3: 0000000002d7c000 CR4: 00000000000506e0 [ 1914.061010] Call Trace: [ 1914.061038] <TASK> [ 1914.061053] ? __warn+0x7d/0xc0 [ 1914.061071] ? mask_irq+0x4b/0x60 [ 1914.061084] ? report_bug+0xe6/0x170 [ 1914.061130] ? handle_bug+0x4e/0xb0 [ 1914.061146] ? exc_invalid_op+0xca/0xe0 [ 1914.061191] ? asm_exc_invalid_op+0x16/0x20 [ 1914.061252] ? mask_irq+0x4b/0x60 [ 1914.061268] ? mask_irq+0x4b/0x60 [ 1914.061295] handle_fasteoi_irq+0x1ba/0x200 [ 1914.061311] generic_pipeline_irq_desc+0xb0/0x160 [ 1914.061327] arch_handle_irq+0x5d/0x1e0 [ 1914.061375] arch_pipeline_entry+0x3b/0x110 [ 1914.061399] asm_common_interrupt+0x22/0x40 [ 1914.061414] RIP: 0010:arch_do_IRQ_pipelined+0x0/0x770 [ 1914.061428] Code: 96 0d 36 01 53 48 89 fb 31 f6 bf b0 00 00 00 48 8b 00 e8 c3 be d9 00 48 89 df 5b e9 ca 80 0a 00 31 ff e9 d3 3f ff ff 0f 1f 00 <0f> 1f 44 00 00 41 55 65 48 8b 04 25 00 ed 01 00 41 54 55 48 c7 c5 [ 1914.061441] RSP: 0000:ffffc1420103bed0 EFLAGS: 00000246 [ 1914.061488] RAX: 00000000cd4094af RBX: ffffffff9accfdf0 RCX: 00000000e6765107 [ 1914.061500] RDX: 0000000000e2d1cb RSI: 000000005e7e250c RDI: ffffa061f6252200 [ 1914.061520] RBP: 00000000000501e0 R08: 0000000000000000 R09: 0000000000000040 [ 1914.061527] R10: 0000000000000000 R11: 0000000000000000 R12: ffffa061c25f4bc0 [ 1914.061527] R13: 0000000000000015 R14: 000000000000002f R15: 0000000000000000 [ 1914.061527] sync_current_irq_stage+0x1b5/0x260 [ 1914.061527] handle_irq_pipelined_finish+0x9f/0x190 [ 1914.061527] arch_pipeline_entry+0xd6/0x110 [ 1914.061527] asm_common_interrupt+0x22/0x40 [ 1914.061527] RIP: 0033:0x55f685717ff1 [ 1914.061527] Code: Unable to access opcode bytes at 0x55f685717fc7. [ 1914.061527] RSP: 002b:00007fff3e272940 EFLAGS: 00000202 [ 1914.061527] RAX: 400fe7a4791f144c RBX: 0000000000000176 RCX: 000fffffffffffff [ 1914.061527] RDX: 8000000000000000 RSI: 0000000000000400 RDI: 0000000000000020 [ 1914.061527] RBP: 00007fff3e2729c0 R08: ffff000000000000 R09: 0000000000000001 [ 1914.061527] R10: 000fe7a4791f144c R11: 000c4a0f3df91177 R12: 00007fff3e2729d0 [ 1914.061527] R13: 000000000000001f R14: 8000000000000000 R15: 00007fff3e272b90 [ 1914.061527] </TASK> [ 1914.061527] ---[ end trace 0000000000000000 ]---
Warning from unmask_irq:
[ 1914.061527] ------------[ cut here ]------------ [ 1914.061527] IRQ(21) already unmasked. [ 1914.061527] WARNING: CPU: 2 PID: 567 at kernel/irq/chip.c:443 unmask_irq+0x4b/0x60 [ 1914.061527] Modules linked in: intel_rapl_msr intel_rapl_common ghash_clmulni_intel sha512_ssse3 sha512_generic vmwgfx snd_pcm drm_ttm_helper ttm snd_timer snd drm_kms_helper soundcore aesni_intel crypto_simd fb_sys_fops cryptd pcspkr syscopyarea sysfillrect sysimgblt vboxguest ac button joydev evdev serio_raw sg binfmt_misc loop dm_mod fuse efi_pstore drm dax configfs ip_tables x_tables autofs4 ext4 crc32c_generic crc16 mbcache jbd2 hid_generic usbhid hid sd_mod t10_pi crc64_rocksoft crc64 crc_t10dif sr_mod cdrom crct10dif_generic ata_generic ohci_pci ahci ata_piix libahci crct10dif_pclmul crct10dif_common libata crc32_pclmul ehci_pci ohci_hcd ehci_hcd crc32c_intel psmouse scsi_mod e1000 usbcore i2c_piix4 usb_common scsi_common video wmi [ 1914.061527] CPU: 2 PID: 567 Comm: stress-ng-cpu Tainted: G W 6.1.37-xenomai-1 #1 [ 1914.061527] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 1914.061527] IRQ stage: Linux [ 1914.061527] RIP: 0010:unmask_irq+0x4b/0x60 [ 1914.061527] Code: 74 13 48 8d 7f 28 e8 44 93 cf 00 48 8b 43 38 81 20 ff ff fd ff 5b e9 74 95 cf 00 8b 77 2c 48 c7 c7 07 48 4f 9a e8 15 fe f7 ff <0f> 0b 5b e9 5d 95 cf 00 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f [ 1914.061527] RSP: 0000:ffffc1420010cee8 EFLAGS: 00010082 [ 1914.061527] RAX: 0000000000000000 RBX: ffffa061f6252200 RCX: 0000000000000000 [ 1914.061527] RDX: 0000000000010103 RSI: ffffffff9a533156 RDI: 00000000ffffffff [ 1914.061527] RBP: ffffa061f62522c8 R08: 800000010000038d R09: 0000000000000001 [ 1914.061527] R10: 3fffffffffffffff R11: ffffffff9c195a8e R12: ffffffff9ae3c8c0 [ 1914.061527] R13: 0000000000000000 R14: 000000000000002f R15: 0000000000000000 [ 1914.061527] FS: 00007f41397e6740(0000) GS:ffffa0623dd00000(0000) knlGS:0000000000000000 [ 1914.061527] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1914.061527] CR2: 00007fff3e274dc3 CR3: 0000000002d7c000 CR4: 00000000000506e0 [ 1914.061527] Call Trace: [ 1914.061527] <IRQ> [ 1914.061527] ? __warn+0x7d/0xc0 [ 1914.061527] ? unmask_irq+0x4b/0x60 [ 1914.061527] ? report_bug+0xe6/0x170 [ 1914.061527] ? handle_bug+0x4e/0xb0 [ 1914.061527] ? exc_invalid_op+0xca/0xe0 [ 1914.061527] ? asm_exc_invalid_op+0x16/0x20 [ 1914.061527] ? unmask_irq+0x4b/0x60 [ 1914.061527] ? unmask_irq+0x4b/0x60 [ 1914.061527] handle_fasteoi_irq+0x15a/0x200 [ 1914.061527] arch_do_IRQ_pipelined+0xc3/0x770 [ 1914.061527] sync_current_irq_stage+0x1b5/0x260 [ 1914.061527] inband_irq_enable+0x46/0x60 [ 1914.061527] __do_softirq+0x84/0x2fc [ 1914.061527] __irq_exit_rcu+0xdc/0x140 [ 1914.061527] arch_do_IRQ_pipelined+0x13b/0x770 [ 1914.061527] </IRQ> [ 1914.061527] <TASK> [ 1914.061527] sync_current_irq_stage+0x1b5/0x260 [ 1914.061527] handle_irq_pipelined_finish+0x9f/0x190 [ 1914.061527] arch_pipeline_entry+0xd6/0x110 [ 1914.061527] asm_common_interrupt+0x22/0x40 [ 1914.061527] RIP: 0033:0x55f685717ff1 [ 1914.061527] Code: ff 7f 00 00 31 c0 e9 8e f0 ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 f3 0f 1e fa 48 83 ec 28 0f 29 04 24 0f ae 5c 24 1c <48> 8b 4c 24 08 4c 8b 04 24 48 b8 ff ff ff ff ff ff 00 00 48 21 c8 [ 1914.061527] RSP: 002b:00007fff3e272940 EFLAGS: 00000202 [ 1914.061527] RAX: 400fe7a4791f144c RBX: 0000000000000176 RCX: 000fffffffffffff [ 1914.061527] RDX: 8000000000000000 RSI: 0000000000000400 RDI: 0000000000000020 [ 1914.061527] RBP: 00007fff3e2729c0 R08: ffff000000000000 R09: 0000000000000001 [ 1914.061527] R10: 000fe7a4791f144c R11: 000c4a0f3df91177 R12: 00007fff3e2729d0 [ 1914.061527] R13: 000000000000001f R14: 8000000000000000 R15: 00007fff3e272b90 [ 1914.061527] </TASK> [ 1914.061527] ---[ end trace 0000000000000000 ]---
It seems that for some reason the "software state" runs out of sync, we skip the IRQ masking, call the io-apic EOI function, ACK the IRQ at the IO-APIC and with some luck we immediately have to handle the next IRQ.
Philippe, do you agree?
Quoted 7 lines
Quoted 2 lines
- HW IRQs are ON where they should be OFF
It does not seem so. Looking at the backtrace, the kernel would most likely have entered a deadlock on this instead:
void
handle_fasteoi_irq(struct irq_desc *desc)
Quoted 8 lines
{ struct irq_chip *chip = desc->irq_data.chip; raw_spin_lock(&desc->lock);- IRQ migration in
ioapic_ack_level()? Something unexpected due to preparing/completing it? There is some Dovetail-specific code there, which defers the migration from oob context to a workqueue.
I did not observe any migration yet.
Quoted 1 line
Quoted 174 lines · Florian Bezdeka
Quoted 22 lines · Philippe Gerum
Quoted 11 lines · Florian Bezdeka
Hi Philippe,
it seems I'm facing a problem with dovetail on x86 related to IRQs routed through the IO-APIC.
Note the stack trace below, it seems that once we ACK the IRQ in
ioapic_ack_level()by calling__ack_APIC_irq()we immediately get the next IRQ.cat
/proc/interruptsdelivers (minimized to the relevant IRQ):Quoted 8 lines
CPU0 CPU1 CPU2 CPU3
21: 0 2392 0 0 IO-APIC 21 -fasteoi ahci[0000:00:0d.0],snd_intel8x0Seems IRQ masking does not work as expected. I have to add more debugging code but it looks like an IRQ storm for now. I have the following options in mind right now, but there might be more:
- Masking of the AHCI IRQ does not work as expected
Quoted 8 lines
The ioapic backend code is unchanged for
mask_ioapic_irq()aside of the conversion to hard spinlocking, so maybe the generic portion there unexpectedly detecting a masked line, blocking the actual masking?void
mask_irq(struct irq_desc *desc){ if (irqd_irq_masked(&desc->irq_data)) return;I added a
WARN()here, so whenever we skip calling the low levelchip.irq_mask()function I get notified.This happens from time to time for my affected IRQ 21.
When it happens, the
unmask_irq()also skips calling thechip.irq_unmask()function.Warning from
mask_irq:[ 1914.059288] ------------[ cut here ]------------ [ 1914.059304] IRQ(21) already masked. [ 1914.059330] WARNING: CPU: 2 PID: 567 at kernel/irq/chip.c:430 mask_irq+0x4b/0x60 [ 1914.059375] Modules linked in: intel_rapl_msr intel_rapl_common
ghash_clmulni_intelsha512_ssse3sha512_genericvmwgfxsnd_pcmdrm_ttm_helperttmsnd_timersnddrm_kms_helpersoundcoreaesni_intelcrypto_simdfb_sys_fopscryptd pcspkr syscopyarea sysfillrect sysimgblt vboxguest ac button joydev evdevserio_rawsgbinfmt_miscloopdm_modfuseefi_pstoredrm dax configfsip_tablesx_tablesautofs4 ext4crc32c_genericcrc16 mbcache jbd2hid_genericusbhid hidsd_modt10_picrc64_rocksoftcrc64crc_t10difsr_modcdromcrct10dif_genericata_genericohci_pciahciata_piixlibahcicrct10dif_pclmulcrct10dif_commonlibatacrc32_pclmulehci_pciohci_hcdehci_hcdcrc32c_intelpsmousescsi_mode1000 usbcorei2c_piix4usb_commonscsi_commonvideo wmi[ 1914.060573] CPU: 2 PID: 567 Comm: stress-ng-cpu Tainted: G W 6.1.37-xenomai-1 #1 [ 1914.060587] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 1914.060598] IRQ stage: Xenomai [ 1914.060621] RIP: 0010:mask_irq+0x4b/0x60 [ 1914.060635] Code: 74 13 48 8d 7f 28 e8 b4 94 cf 00 48 8b 43 38 81 08 00 00 02 00 5b e9 e4 96 cf 00 8b 77 2c 48 c7 c7 ee 47 4f 9a e8 85 ff f7 ff <0f> 0b 5b e9 cd 96 cf 00 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f [ 1914.060638] RSP: 0000:ffffc1420103bd78 EFLAGS: 00010082 [ 1914.060737] RAX: 0000000000000000 RBX: ffffa061f6252200 RCX: 0000000000000000 [ 1914.060750] RDX: 0000000003000002 RSI: ffffffff9a533156 RDI: 00000000ffffffff [ 1914.060763] RBP: ffffa061f62522c8 R08: 8000000100000356 R09: 0000000000000001 [ 1914.060842] R10: 3fffffffffffffff R11: ffffffff9c194a16 R12: ffffffff9ae3c8c0 [ 1914.060855] R13: ffffa061f6252200 R14: 0000000000000000 R15: ffffa061f6252200 [ 1914.060932] FS: 00007f41397e6740(0000) GS:ffffa0623dd00000(0000) knlGS:0000000000000000 [ 1914.060947] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1914.060960] CR2: 00007fff3e274dc3 CR3: 0000000002d7c000 CR4: 00000000000506e0 [ 1914.061010] Call Trace: [ 1914.061038] <TASK> [ 1914.061053] ? __warn+0x7d/0xc0 [ 1914.061071] ? mask_irq+0x4b/0x60 [ 1914.061084] ? report_bug+0xe6/0x170 [ 1914.061130] ? handle_bug+0x4e/0xb0 [ 1914.061146] ? exc_invalid_op+0xca/0xe0 [ 1914.061191] ? asm_exc_invalid_op+0x16/0x20 [ 1914.061252] ? mask_irq+0x4b/0x60 [ 1914.061268] ? mask_irq+0x4b/0x60 [ 1914.061295] handle_fasteoi_irq+0x1ba/0x200 [ 1914.061311] generic_pipeline_irq_desc+0xb0/0x160 [ 1914.061327] arch_handle_irq+0x5d/0x1e0 [ 1914.061375] arch_pipeline_entry+0x3b/0x110 [ 1914.061399] asm_common_interrupt+0x22/0x40 [ 1914.061414] RIP: 0010:arch_do_IRQ_pipelined+0x0/0x770 [ 1914.061428] Code: 96 0d 36 01 53 48 89 fb 31 f6 bf b0 00 00 00 48 8b 00 e8 c3 be d9 00 48 89 df 5b e9 ca 80 0a 00 31 ff e9 d3 3f ff ff 0f 1f 00 <0f> 1f 44 00 00 41 55 65 48 8b 04 25 00 ed 01 00 41 54 55 48 c7 c5 [ 1914.061441] RSP: 0000:ffffc1420103bed0 EFLAGS: 00000246 [ 1914.061488] RAX: 00000000cd4094af RBX: ffffffff9accfdf0 RCX: 00000000e6765107 [ 1914.061500] RDX: 0000000000e2d1cb RSI: 000000005e7e250c RDI: ffffa061f6252200 [ 1914.061520] RBP: 00000000000501e0 R08: 0000000000000000 R09: 0000000000000040 [ 1914.061527] R10: 0000000000000000 R11: 0000000000000000 R12: ffffa061c25f4bc0 [ 1914.061527] R13: 0000000000000015 R14: 000000000000002f R15: 0000000000000000 [ 1914.061527] sync_current_irq_stage+0x1b5/0x260 [ 1914.061527] handle_irq_pipelined_finish+0x9f/0x190 [ 1914.061527] arch_pipeline_entry+0xd6/0x110 [ 1914.061527] asm_common_interrupt+0x22/0x40 [ 1914.061527] RIP: 0033:0x55f685717ff1 [ 1914.061527] Code: Unable to access opcode bytes at 0x55f685717fc7. [ 1914.061527] RSP: 002b:00007fff3e272940 EFLAGS: 00000202 [ 1914.061527] RAX: 400fe7a4791f144c RBX: 0000000000000176 RCX: 000fffffffffffff [ 1914.061527] RDX: 8000000000000000 RSI: 0000000000000400 RDI: 0000000000000020 [ 1914.061527] RBP: 00007fff3e2729c0 R08: ffff000000000000 R09: 0000000000000001 [ 1914.061527] R10: 000fe7a4791f144c R11: 000c4a0f3df91177 R12: 00007fff3e2729d0 [ 1914.061527] R13: 000000000000001f R14: 8000000000000000 R15: 00007fff3e272b90 [ 1914.061527] </TASK> [ 1914.061527] ---[ end trace 0000000000000000 ]---Warning from
unmask_irq:[ 1914.061527] ------------[ cut here ]------------ [ 1914.061527] IRQ(21) already unmasked. [ 1914.061527] WARNING: CPU: 2 PID: 567 at kernel/irq/chip.c:443 unmask_irq+0x4b/0x60 [ 1914.061527] Modules linked in: intel_rapl_msr intel_rapl_common
ghash_clmulni_intelsha512_ssse3sha512_genericvmwgfxsnd_pcmdrm_ttm_helperttmsnd_timersnddrm_kms_helpersoundcoreaesni_intelcrypto_simdfb_sys_fopscryptd pcspkr syscopyarea sysfillrect sysimgblt vboxguest ac button joydev evdevserio_rawsgbinfmt_miscloopdm_modfuseefi_pstoredrm dax configfsip_tablesx_tablesautofs4 ext4crc32c_genericcrc16 mbcache jbd2hid_genericusbhid hidsd_modt10_picrc64_rocksoftcrc64crc_t10difsr_modcdromcrct10dif_genericata_genericohci_pciahciata_piixlibahcicrct10dif_pclmulcrct10dif_commonlibatacrc32_pclmulehci_pciohci_hcdehci_hcdcrc32c_intelpsmousescsi_mode1000 usbcorei2c_piix4usb_commonscsi_commonvideo wmi[ 1914.061527] CPU: 2 PID: 567 Comm: stress-ng-cpu Tainted: G W 6.1.37-xenomai-1 #1 [ 1914.061527] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 1914.061527] IRQ stage: Linux [ 1914.061527] RIP: 0010:unmask_irq+0x4b/0x60 [ 1914.061527] Code: 74 13 48 8d 7f 28 e8 44 93 cf 00 48 8b 43 38 81 20 ff ff fd ff 5b e9 74 95 cf 00 8b 77 2c 48 c7 c7 07 48 4f 9a e8 15 fe f7 ff <0f> 0b 5b e9 5d 95 cf 00 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f [ 1914.061527] RSP: 0000:ffffc1420010cee8 EFLAGS: 00010082 [ 1914.061527] RAX: 0000000000000000 RBX: ffffa061f6252200 RCX: 0000000000000000 [ 1914.061527] RDX: 0000000000010103 RSI: ffffffff9a533156 RDI: 00000000ffffffff [ 1914.061527] RBP: ffffa061f62522c8 R08: 800000010000038d R09: 0000000000000001 [ 1914.061527] R10: 3fffffffffffffff R11: ffffffff9c195a8e R12: ffffffff9ae3c8c0 [ 1914.061527] R13: 0000000000000000 R14: 000000000000002f R15: 0000000000000000 [ 1914.061527] FS: 00007f41397e6740(0000) GS:ffffa0623dd00000(0000) knlGS:0000000000000000 [ 1914.061527] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1914.061527] CR2: 00007fff3e274dc3 CR3: 0000000002d7c000 CR4: 00000000000506e0 [ 1914.061527] Call Trace: [ 1914.061527] <IRQ> [ 1914.061527] ? __warn+0x7d/0xc0 [ 1914.061527] ? unmask_irq+0x4b/0x60 [ 1914.061527] ? report_bug+0xe6/0x170 [ 1914.061527] ? handle_bug+0x4e/0xb0 [ 1914.061527] ? exc_invalid_op+0xca/0xe0 [ 1914.061527] ? asm_exc_invalid_op+0x16/0x20 [ 1914.061527] ? unmask_irq+0x4b/0x60 [ 1914.061527] ? unmask_irq+0x4b/0x60 [ 1914.061527] handle_fasteoi_irq+0x15a/0x200 [ 1914.061527] arch_do_IRQ_pipelined+0xc3/0x770 [ 1914.061527] sync_current_irq_stage+0x1b5/0x260 [ 1914.061527] inband_irq_enable+0x46/0x60 [ 1914.061527] __do_softirq+0x84/0x2fc [ 1914.061527] __irq_exit_rcu+0xdc/0x140 [ 1914.061527] arch_do_IRQ_pipelined+0x13b/0x770 [ 1914.061527] </IRQ> [ 1914.061527] <TASK> [ 1914.061527] sync_current_irq_stage+0x1b5/0x260 [ 1914.061527] handle_irq_pipelined_finish+0x9f/0x190 [ 1914.061527] arch_pipeline_entry+0xd6/0x110 [ 1914.061527] asm_common_interrupt+0x22/0x40 [ 1914.061527] RIP: 0033:0x55f685717ff1 [ 1914.061527] Code: ff 7f 00 00 31 c0 e9 8e f0 ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 f3 0f 1e fa 48 83 ec 28 0f 29 04 24 0f ae 5c 24 1c <48> 8b 4c 24 08 4c 8b 04 24 48 b8 ff ff ff ff ff ff 00 00 48 21 c8 [ 1914.061527] RSP: 002b:00007fff3e272940 EFLAGS: 00000202 [ 1914.061527] RAX: 400fe7a4791f144c RBX: 0000000000000176 RCX: 000fffffffffffff [ 1914.061527] RDX: 8000000000000000 RSI: 0000000000000400 RDI: 0000000000000020 [ 1914.061527] RBP: 00007fff3e2729c0 R08: ffff000000000000 R09: 0000000000000001 [ 1914.061527] R10: 000fe7a4791f144c R11: 000c4a0f3df91177 R12: 00007fff3e2729d0 [ 1914.061527] R13: 000000000000001f R14: 8000000000000000 R15: 00007fff3e272b90 [ 1914.061527] </TASK> [ 1914.061527] ---[ end trace 0000000000000000 ]---
Quoted 5 lines
It seems that for some reason the "software state" runs out of sync, we skip the IRQ masking, call the io-apic EOI function, ACK the IRQ at the IO-APIC and with some luck we immediately have to handle the next IRQ.
Philippe, do you agree?
The issue seems different than a virtual state breakage: for some reason IRQ21 is delivered by the hw although it was supposedly masked which is not depending on the inband stall bit. From that point, the whole logic runs amok.
I have not been able to reproduce the issue so far with the xenomai4/evl core on top of dovetail 6.1.37 running on my fresh virtualbox install here. Can you share the kernel config and maybe the OVA export file of your VM? Also, does the issue happen without enabling Cobalt?
Signature · 1 line
Philippe.
Quoted 11 lines · Philippe Gerum
Quoted 5 lines
It seems that for some reason the "software state" runs out of sync, we skip the IRQ masking, call the io-apic EOI function, ACK the IRQ at the IO-APIC and with some luck we immediately have to handle the next IRQ.
Philippe, do you agree?
The issue seems different than a virtual state breakage: for some reason IRQ21 is delivered by the hw although it was supposedly masked which is not depending on the inband stall bit. From that point, the whole logic runs amok.
Quoted 4 lines
I have not been able to reproduce the issue so far with the xenomai4/evl core on top of dovetail 6.1.37 running on my fresh virtualbox install here. Can you share the kernel config and maybe the OVA export file of your VM? Also, does the issue happen without enabling Cobalt?
Thanks for your help! Let me try to hand over an export of my VM here.
I have to repeat some of my tests. I can't say yet if "dovetail only" is OK or not. My tests didn't have the fix for the page fault handling inside, so the situation is different now.
What I can say: The problem did not occur on "Linux only" builds, so Linux itself was fine.
"Dovetail only" and "Dovetail + cobalt" was crashing. "Dovetail + Cobalt" is still crashing (even with the exception handling fix), "Dovetail only" has to be re-tested on my end.
Florian
Quoted 3 lines
--
Philippe.