x86: mptable: Fix PCI device number in source bus IRQ
PATCH 1/1 x86: mptable: Fix PCI device number in source bus IRQ
For PCI interrupts, bits 6:2 of srcbusirq identify the source device. Use dev_hdr->dev_num to populate those bits.
Fixes f83cd1611d4b ("kvm tools: irq: replace the x86 irq rbtree with the PCI device tree")
Signed-off-by Dongli Si <[email protected]>
--- x86/mptable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
x86/mptable.c +1 -1
@@ -180,7 +180,7 @@ int mptable__init(struct kvm *kvm)unsigned char srcbusirq;struct pci_device_header *pci_hdr = dev_hdr->data; - srcbusirq = (pci_hdr->subsys_id <<2 ) | (pci_hdr->irq_pin -1 ); + srcbusirq = (dev_hdr->dev_num <<2 ) | (pci_hdr->irq_pin -1 ); mpc_intsrc = last_addr;mptable_add_irq_src (mpc_intsrc, pcibusid, srcbusirq, ioapicid, pci_hdr->irq_line);
Signature · 1 line
2.56.0
Will Deacon
AppliedQuoted 4 lines · Dongli Si
For PCI interrupts, bits 6:2 of srcbusirq identify the source device. Use
dev_hdr->dev_numto populate those bits.
Applied to kvmtool (master), thanks!
[1/1] x86: mptable: Fix PCI device number in source bus IRQ
https://git.kernel.org/will/kvmtool/c/2f3abe56dcd2
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev