[PATCH kvmtool 2/4] x86: Add the ISA I/O interrupt assignment entries of mptable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



According to Intel MultiProcessor Specification:
"There is one entry for each I/O APIC interrupt input that is connected."

Missing this will cause the guest kernel to report some
warnings or errors when enabling the io apic.

Fixes: 0c7c14a7 ("kvm tools: Add MP tables support")
Signed-off-by: Dongli Si <sidongli1997@xxxxxxxxx>
---
 x86/mptable.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/x86/mptable.c b/x86/mptable.c
index f4753bd..82b692e 100644
--- a/x86/mptable.c
+++ b/x86/mptable.c
@@ -171,10 +171,8 @@ int mptable__init(struct kvm *kvm)
 	nentries++;
 
 	/*
-	 * IRQ sources.
-	 * Also note we use PCI irqs here, no for ISA bus yet.
+	 * PCI IRQ sources.
 	 */
-
 	dev_hdr = device__first_dev(DEVICE_BUS_PCI);
 	while (dev_hdr) {
 		unsigned char srcbusirq;
@@ -189,6 +187,23 @@ int mptable__init(struct kvm *kvm)
 		dev_hdr = device__next_dev(dev_hdr);
 	}
 
+	/*
+	 * ISA IRQ sources.
+	 */
+	for (i = 0; i < 16; i++) {
+		if (i == 2)
+			continue;
+
+		mpc_intsrc = last_addr;
+		if (i == 0)
+			mptable_add_irq_src(mpc_intsrc, isabusid, i, ioapicid, 2);
+		else
+			mptable_add_irq_src(mpc_intsrc, isabusid, i, ioapicid, i);
+
+		last_addr = (void *)&mpc_intsrc[1];
+		nentries++;
+	}
+
 	/*
 	 * Local IRQs assignment (LINT0, LINT1)
 	 */
-- 
2.44.0





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux