Skip to contentSkip to conversation

x86: mptable: Fix PCI device number in source bus IRQ

PATCH Applied Dongli Si 2 participants 2 messages Nov 11 – Nov 26 KVM

lore
Share & tools
lore

Dongli Si

author
#0 lore raw

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")
---
 x86/mptable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/mptable.c +1 -1
index f13cf0f..f4753bd 100644
@@ -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
Applied
#1 lore raw
Quoted 4 lines · Dongli Si

For PCI interrupts, bits 6:2 of srcbusirq identify the source device. Use dev_hdr->dev_num to 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