[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/9] pci-host: add pcie-msi read method
From: |
P J P |
Subject: |
[PATCH v3 2/9] pci-host: add pcie-msi read method |
Date: |
Tue, 30 Jun 2020 17:57:03 +0530 |
From: Prasad J Pandit <pjp@fedoraproject.org>
Add pcie-msi mmio read method to avoid NULL pointer dereference
issue.
Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
hw/pci-host/designware.c | 9 +++++++++
1 file changed, 9 insertions(+)
Update v3: Add Reviewed-by: ...
-> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09400.html
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 8492c18991..82262bdfdf 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/module.h"
+#include "qemu/log.h"
#include "hw/pci/msi.h"
#include "hw/pci/pci_bridge.h"
#include "hw/pci/pci_host.h"
@@ -63,6 +64,13 @@ designware_pcie_root_to_host(DesignwarePCIERoot *root)
return DESIGNWARE_PCIE_HOST(bus->parent);
}
+static uint64_t designware_pcie_root_msi_read(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__);
+ return 0;
+}
+
static void designware_pcie_root_msi_write(void *opaque, hwaddr addr,
uint64_t val, unsigned len)
{
@@ -77,6 +85,7 @@ static void designware_pcie_root_msi_write(void *opaque,
hwaddr addr,
}
static const MemoryRegionOps designware_pci_host_msi_ops = {
+ .read = designware_pcie_root_msi_read,
.write = designware_pcie_root_msi_write,
.endianness = DEVICE_LITTLE_ENDIAN,
.valid = {
--
2.26.2
- [PATCH v3 0/9] memory: assert and define MemoryRegionOps callbacks, P J P, 2020/06/30
- [PATCH v3 1/9] hw/pci-host: add pci-intack write method, P J P, 2020/06/30
- [PATCH v3 2/9] pci-host: add pcie-msi read method,
P J P <=
- [PATCH v3 3/9] vfio: add quirk device write method, P J P, 2020/06/30
- [PATCH v3 4/9] prep: add ppc-parity write method, P J P, 2020/06/30
- [PATCH v3 5/9] nvram: add nrf51_soc flash read method, P J P, 2020/06/30
- [PATCH v3 6/9] spapr_pci: add spapr msi read method, P J P, 2020/06/30
- [PATCH v3 7/9] tz-ppc: add dummy read/write methods, P J P, 2020/06/30
- [PATCH v3 8/9] imx7-ccm: add digprog mmio write method, P J P, 2020/06/30
- [PATCH v3 9/9] memory: assert MemoryRegionOps callbacks are defined, P J P, 2020/06/30
- Re: [PATCH v3 0/9] memory: assert and define MemoryRegionOps callbacks, no-reply, 2020/06/30