]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/riscv/virt: Add the BDF of IOMMU to RISCVVirtState structure
authorSunil V L <sunilvl@ventanamicro.com>
Sat, 22 Mar 2025 04:31:37 +0000 (10:01 +0530)
committerAlistair Francis <alistair.francis@wdc.com>
Mon, 19 May 2025 01:07:13 +0000 (11:07 +1000)
When the IOMMU is implemented as a PCI device, its BDF is created
locally in virt.c. However, the same BDF is also required in
virt-acpi-build.c to support ACPI. Therefore, make this information part
of the global RISCVVirtState structure so that it can be accessed
outside of virt.c as well.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20250322043139.2003479-2-sunilvl@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/virt.c
include/hw/riscv/virt.h

index be1bf0f64688901c17ff55b25019b40d046828ba..5958ad1f7d7298d7ccda5415cb65bb65f1df4cb0 100644 (file)
@@ -1117,6 +1117,7 @@ static void create_fdt_iommu(RISCVVirtState *s, uint16_t bdf)
     qemu_fdt_setprop_cells(fdt, pci_node, "iommu-map",
                            0, iommu_phandle, 0, bdf,
                            bdf + 1, iommu_phandle, bdf + 1, 0xffff - bdf);
+    s->pci_iommu_bdf = bdf;
 }
 
 static void finalize_fdt(RISCVVirtState *s)
index 48a14bea2ed97ad3bef3729f191a85f31643f644..7b4c2c8b7de34461709ae5e48e249e1a46cdd781 100644 (file)
@@ -63,6 +63,7 @@ struct RISCVVirtState {
     const MemMapEntry *memmap;
     struct GPEXHost *gpex_host;
     OnOffAuto iommu_sys;
+    uint16_t pci_iommu_bdf;
 };
 
 enum {