mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
hw/arm/virt: Check bypass iommu is not set for iommu-map DT property
default_bus_bypass_iommu tells us whether the bypass_iommu is set
for the default PCIe root bus. Make sure we check that before adding
the "iommu-map" DT property.
Cc: qemu-stable@nongnu.org
Fixes: 6d7a85483a
("hw/arm/virt: Add default_bus_bypass_iommu machine option")
Suggested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Donald Dutile <ddutile@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20250602114655.42920-1-shameerali.kolothum.thodi@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
d9ce74873a
commit
f5ec751ee7
1 changed files with 10 additions and 5 deletions
|
@ -1487,9 +1487,12 @@ static void create_virtio_iommu_dt_bindings(VirtMachineState *vms)
|
||||||
qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle);
|
qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle);
|
||||||
g_free(node);
|
g_free(node);
|
||||||
|
|
||||||
qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map",
|
if (!vms->default_bus_bypass_iommu) {
|
||||||
0x0, vms->iommu_phandle, 0x0, bdf,
|
qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map",
|
||||||
bdf + 1, vms->iommu_phandle, bdf + 1, 0xffff - bdf);
|
0x0, vms->iommu_phandle, 0x0, bdf,
|
||||||
|
bdf + 1, vms->iommu_phandle, bdf + 1,
|
||||||
|
0xffff - bdf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_pcie(VirtMachineState *vms)
|
static void create_pcie(VirtMachineState *vms)
|
||||||
|
@ -1612,8 +1615,10 @@ static void create_pcie(VirtMachineState *vms)
|
||||||
switch (vms->iommu) {
|
switch (vms->iommu) {
|
||||||
case VIRT_IOMMU_SMMUV3:
|
case VIRT_IOMMU_SMMUV3:
|
||||||
create_smmu(vms, vms->bus);
|
create_smmu(vms, vms->bus);
|
||||||
qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map",
|
if (!vms->default_bus_bypass_iommu) {
|
||||||
0x0, vms->iommu_phandle, 0x0, 0x10000);
|
qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map",
|
||||||
|
0x0, vms->iommu_phandle, 0x0, 0x10000);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue