Re: [PATCH 1/2] DM: Fix pci_irq_assert/deassert


Kaige Fu
 

Ping ...

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of Kaige Fu
Sent: Thursday, January 2, 2020 11:33 PM
To: acrn-dev@...
Subject: [acrn-dev] [PATCH 1/2] DM: Fix pci_irq_assert/deassert

DM ACPI provides the guest with 'active low' for INTx polarity.
So, we should set 'LOW' to assert one interrupt and 'HIGH' to deassert one
interrupt.

Signed-off-by: Shuo Liu <shuo.a.liu@...>
Signed-off-by: Kaige Fu <kaige.fu@...>
---
devicemodel/hw/pci/irq.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/devicemodel/hw/pci/irq.c b/devicemodel/hw/pci/irq.c index
9d4ea323..0ebcbe6d 100644
--- a/devicemodel/hw/pci/irq.c
+++ b/devicemodel/hw/pci/irq.c
@@ -147,13 +147,21 @@ void pci_irq_deinit(struct vmctx *ctx) void
pci_irq_assert(struct pci_vdev *dev) {
- vm_set_gsi_irq(dev->vmctx, dev->lintr.ioapic_irq, GSI_SET_HIGH);
+ /*
+ * DM ACPI provides the guest with 'active low' for INTx polarity.
+ * Set 'LOW' to assert the interrupt.
+ */
+ vm_set_gsi_irq(dev->vmctx, dev->lintr.ioapic_irq, GSI_SET_LOW);
}

void
pci_irq_deassert(struct pci_vdev *dev)
{
- vm_set_gsi_irq(dev->vmctx, dev->lintr.ioapic_irq, GSI_SET_LOW);
+ /*
+ * DM ACPI provides the guest with 'active low' for INTx polarity.
+ * Set 'HIGH' to deassert the interrupt.
+ */
+ vm_set_gsi_irq(dev->vmctx, dev->lintr.ioapic_irq, GSI_SET_HIGH);
}

int
--
2.20.0


Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.