[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 1/6] include/hw/pci: Add a callback to set the downstream mem
From: |
Jason Chien |
Subject: |
[RFC PATCH 1/6] include/hw/pci: Add a callback to set the downstream memory region of a pci bus |
Date: |
Mon, 16 Dec 2024 08:48:52 +0800 |
PCIIOMMUOps.set_memory_region() is introduced to set the downstream memory
region of a pci bus. When PCIIOMMUOps.get_address_space() is already
registered by the pci host(e.g. TYPE_DESIGNWARE_PCIE_HOST),
PCIIOMMUOps.set_memory_region() should be registered as well, so an IOMMU
can designate the downstream memory region for the pci bus.
Signed-off-by: Jason Chien <jason.chien@sifive.com>
---
include/hw/pci/pci.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index c0717e3121..cb3039bce8 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -388,6 +388,19 @@ typedef struct PCIIOMMUOps {
* @devfn: device and function number
*/
AddressSpace * (*get_address_space)(PCIBus *bus, void *opaque, int devfn);
+ /**
+ * @set_memory_region: set the downstream memory region for a set of
+ * devices on a PCI bus.
+ *
+ * Optional callback, which should be implemented when get_address_space()
+ * is registered by the PCI host(e.g. TYPE_DESIGNWARE_PCIE_HOST), which
+ * makes an IOMMU not able to register get_address_space() again.
+ *
+ * @opaque: the data passed to pci_setup_iommu().
+ *
+ * @mr: the downsteam memory region
+ */
+ void (*set_memory_region)(void *opaque, MemoryRegion *mr);
/**
* @set_iommu_device: attach a HostIOMMUDevice to a vIOMMU
*
--
2.43.2
- [RFC PATCH 0/6] Avoid contention for PCIIOMMUOps between IOMMU and PCIe host, Jason Chien, 2024/12/15
- [RFC PATCH 1/6] include/hw/pci: Add a callback to set the downstream memory region of a pci bus,
Jason Chien <=
- [RFC PATCH 2/6] hw/pci: Add an API to set the downstream memory region of a PCI bus, Jason Chien, 2024/12/15
- [RFC PATCH 3/6] hw/pci-host: Enable DW PCIe host to send memory transactions over specific mr, Jason Chien, 2024/12/15
- [RFC PATCH 4/6] hw/riscv/riscv-iommu: Allow PCI hosts with iommu_ops registered connecting to the IOMMU, Jason Chien, 2024/12/15
- [RFC PATCH 5/6] hw/riscv/riscv-iommu: Acquire device IDs dynamically, Jason Chien, 2024/12/15
- [RFC PATCH 6/6] include/hw/pci: Send PCI dma requests with memory attributes containing BDF, Jason Chien, 2024/12/15