我正在用我的新 pci 设备运行 qemu-system-x86_64。我想使用 IRQ 17(因为来自内核的驱动程序监听 IRQ 17)。但我的 PCI 设备采用 IRQ 10 或 11。基于 interrupt_pin(A,B,C,E)。然后我想通过 qemu_irq_pulse 将 irq 发送到内核模块。
这就是我分配 irq 的方式:
pci_config_set_interrupt_pin(pci_dev->config, 1);
d->irq = pci_allocate_irq(pci_dev)
root@hostname:~# cat /proc/interrupts
CPU0
0: 48 IO-APIC 2-edge timer
1: 9 IO-APIC 1-edge i8042
4: 1440 IO-APIC 4-edge ttyS0
8: 1 IO-APIC 8-edge rtc0
9: 0 IO-APIC 9-fasteoi acpi
12: 125 IO-APIC 12-edge i8042
24: 773 PCI-MSI 512000-edge ahci[0000:00:1f.2]
25: 355 PCI-MSI 32768-edge eth0-rx-0
26: 160 PCI-MSI 32769-edge eth0-tx-0
27: 1 PCI-MSI 32770-edge eth0
lspci -nk -vv:
00:1f.3 0880: 10de:0101 (rev 01)
Subsystem: 1af4:1100
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 10
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+
Address: 0000000000000000 Data: 0000
内核驱动程序未能请求 irq,因为它试图附加到 IRQ 17。我不想更改内核端。
This is what i want to see:
root@hostname:~# cat /proc/interrupts
CPU0
0: 2213 IO-APIC
17: 0 IO-APIC 17-fasteoi some_kernel_driver_name
如何为qemu中的PCI设备分配中断17?