[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/23] pcie: Don't try triggering a LSI when not defined
From: |
Daniel Henrique Barboza |
Subject: |
[PULL 20/23] pcie: Don't try triggering a LSI when not defined |
Date: |
Wed, 20 Apr 2022 19:13:26 -0300 |
From: Frederic Barrat <fbarrat@linux.ibm.com>
This patch skips [de]asserting a LSI interrupt if the device doesn't
have any LSI defined. Doing so would trigger an assert in
pci_irq_handler().
The PCIE root port implementation in qemu requests a LSI (INTA), but a
subclass may want to change that behavior since it's a valid
configuration. For example on the POWER8/POWER9/POWER10 systems, the
root bridge doesn't request any LSI.
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220408131303.147840-2-fbarrat@linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/pci/pcie.c | 5 +++--
hw/pci/pcie_aer.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 67a5d67372..68a62da0b5 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -353,7 +353,7 @@ static void hotplug_event_notify(PCIDevice *dev)
msix_notify(dev, pcie_cap_flags_get_vector(dev));
} else if (msi_enabled(dev)) {
msi_notify(dev, pcie_cap_flags_get_vector(dev));
- } else {
+ } else if (pci_intx(dev) != -1) {
pci_set_irq(dev, dev->exp.hpev_notified);
}
}
@@ -361,7 +361,8 @@ static void hotplug_event_notify(PCIDevice *dev)
static void hotplug_event_clear(PCIDevice *dev)
{
hotplug_event_update_event_status(dev);
- if (!msix_enabled(dev) && !msi_enabled(dev) && !dev->exp.hpev_notified) {
+ if (!msix_enabled(dev) && !msi_enabled(dev) && pci_intx(dev) != -1 &&
+ !dev->exp.hpev_notified) {
pci_irq_deassert(dev);
}
}
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index e1a8a88c8c..92bd0530dd 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -290,7 +290,7 @@ static void pcie_aer_root_notify(PCIDevice *dev)
msix_notify(dev, pcie_aer_root_get_vector(dev));
} else if (msi_enabled(dev)) {
msi_notify(dev, pcie_aer_root_get_vector(dev));
- } else {
+ } else if (pci_intx(dev) != -1) {
pci_irq_assert(dev);
}
}
--
2.35.1
- [PULL 10/23] target/ppc: Improve KVM hypercall trace, (continued)
- [PULL 10/23] target/ppc: Improve KVM hypercall trace, Daniel Henrique Barboza, 2022/04/20
- [PULL 11/23] qemu/int128: add int128_urshift, Daniel Henrique Barboza, 2022/04/20
- [PULL 12/23] softfloat: add uint128_to_float128, Daniel Henrique Barboza, 2022/04/20
- [PULL 13/23] softfloat: add int128_to_float128, Daniel Henrique Barboza, 2022/04/20
- [PULL 14/23] softfloat: add float128_to_uint128, Daniel Henrique Barboza, 2022/04/20
- [PULL 15/23] softfloat: add float128_to_int128, Daniel Henrique Barboza, 2022/04/20
- [PULL 16/23] target/ppc: implement xscv[su]qqp, Daniel Henrique Barboza, 2022/04/20
- [PULL 17/23] target/ppc: implement xscvqp[su]qz, Daniel Henrique Barboza, 2022/04/20
- [PULL 18/23] hw/ppc/ppc405_boards: Initialize g_autofree pointer, Daniel Henrique Barboza, 2022/04/20
- [PULL 19/23] ppc/vof: Fix uninitialized string tracing, Daniel Henrique Barboza, 2022/04/20
- [PULL 20/23] pcie: Don't try triggering a LSI when not defined,
Daniel Henrique Barboza <=
- [PULL 21/23] ppc/pnv: Remove LSI on the PCIE host bridge, Daniel Henrique Barboza, 2022/04/20
- [PULL 22/23] target/ppc: Add two missing register callbacks on POWER10, Daniel Henrique Barboza, 2022/04/20
- [PULL 23/23] hw/ppc: change indentation to spaces from TABs, Daniel Henrique Barboza, 2022/04/20
- Re: [PULL 00/23] ppc queue, Richard Henderson, 2022/04/21