[PATCH RFC v2 4/6] hw/arm/virt-acpi-build: Add explicit idmap info in IORT table

2021-03-24 Thread Wang Xingang
From: Xingang Wang The idmap of smmuv3 and root complex covers the whole RID space for now, this patch add explicit idmap info according to root bus number range. This add smmuv3 idmap for certain bus which has enabled the iommu property. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen -

[PATCH RFC v2 3/6] hw/pci: Add pci_root_bus_max_bus

2021-03-24 Thread Wang Xingang
From: Xingang Wang This helps to find max bus number of a root bus. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c | 34 ++ include/hw/pci/pci.h | 1 + 2 files changed, 35 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c

[PATCH RFC v2 2/6] hw/pci: Add iommu option for pci root bus

2021-03-24 Thread Wang Xingang
From: Xingang Wang This add iommu option for pci root bus, including primary bus and pxb root bus. The option is valid only if there is a virtual iommu device. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/arm/virt.c | 25 + hw/i386

[PATCH RFC v2 6/6] hw/i386/acpi-build: Add iommu filter in IVRS table

2021-03-24 Thread Wang Xingang
From: Xingang Wang When building amd IVRS table, only devices attached to root bus with IOMMU flag should be scanned. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i3

[PATCH RFC v2 1/6] hw/pci/pci_host: Add iommu property for pci host

2021-03-24 Thread Wang Xingang
From: Xingang Wang The pci host iommu property is useful to check whether the iommu is enabled on the pci root bus. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c | 18 +- hw/pci/pci_host.c | 2 ++ include/hw/pci/pci.h | 1 +

[PATCH RFC v2 5/6] hw/i386/acpi-build: Add explicit scope in DMAR table

2021-03-24 Thread Wang Xingang
From: Xingang Wang In DMAR table, the drhd is set to cover all pci devices when intel_iommu is on. This patch add explicit scope data, including only the pci devices that go through iommu. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/i386/acpi-build.c | 68

[PATCH RFC v2 0/6] Introduce IOMMU Option For PCI Root Bus

2021-03-24 Thread Wang Xingang
From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including primary bus and pxb root bus. At present, All root bus will go through iommu when iommu is configured, which is not flexible. So this add option to enable/disable iommu for primary bus and pxb roo

[PATCH RFC RESEND v2 3/6] hw/pci: Add pci_root_bus_max_bus

2021-03-25 Thread Wang Xingang
From: Xingang Wang This helps to find max bus number of a root bus. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c | 34 ++ include/hw/pci/pci.h | 1 + 2 files changed, 35 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c

[PATCH RFC RESEND v2 2/6] hw/pci: Add iommu option for pci root bus

2021-03-25 Thread Wang Xingang
From: Xingang Wang This add iommu option for pci root bus, including primary bus and pxb root bus. The option is valid only if there is a virtual iommu device. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/arm/virt.c | 25 + hw/i386

[PATCH RFC RESEND v2 1/6] hw/pci/pci_host: Add iommu property for pci host

2021-03-25 Thread Wang Xingang
From: Xingang Wang The pci host iommu property is useful to check whether the iommu is enabled on the pci root bus. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c | 18 +- hw/pci/pci_host.c | 2 ++ include/hw/pci/pci.h | 1 +

[PATCH RFC RESEND v2 0/6] Introduce IOMMU Option For PCI Root Bus

2021-03-25 Thread Wang Xingang
From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including primary bus and pxb root bus. At present, All root bus will go through iommu when iommu is configured, which is not flexible. So this add option to enable/disable iommu for primary bus and pxb roo

[PATCH RFC RESEND v2 4/6] hw/arm/virt-acpi-build: Add explicit idmap info in IORT table

2021-03-25 Thread Wang Xingang
From: Xingang Wang The idmap of smmuv3 and root complex covers the whole RID space for now, this patch add explicit idmap info according to root bus number range. This add smmuv3 idmap for certain bus which has enabled the iommu property. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen -

[PATCH RFC RESEND v2 6/6] hw/i386/acpi-build: Add iommu filter in IVRS table

2021-03-25 Thread Wang Xingang
From: Xingang Wang When building amd IVRS table, only devices attached to root bus with IOMMU flag should be scanned. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i3

[PATCH RFC RESEND v2 5/6] hw/i386/acpi-build: Add explicit scope in DMAR table

2021-03-25 Thread Wang Xingang
From: Xingang Wang In DMAR table, the drhd is set to cover all pci devices when intel_iommu is on. This patch add explicit scope data, including only the pci devices that go through iommu. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/i386/acpi-build.c | 68

Re: [PATCH RFC RESEND v2 0/6] Introduce IOMMU Option For PCI Root Bus

2021-03-31 Thread Wang Xingang
Hi, everyone! Do you have any suggestions about this iommu configuration feature? Please help review these patches, thanks very much. On 2021/3/25 15:22, Wang Xingang wrote: From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including primary bus and

Re: [PATCH RFC RESEND v2 1/6] hw/pci/pci_host: Add iommu property for pci host

2021-04-12 Thread Wang Xingang
Hi Eric, On 2021/4/13 1:36, Auger Eric wrote: Hi Wang, On 3/25/21 8:22 AM, Wang Xingang wrote: From: Xingang Wang The pci host iommu property is useful to check whether the iommu is enabled on the pci root bus. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c

Re: [PATCH RFC RESEND v2 2/6] hw/pci: Add iommu option for pci root bus

2021-04-12 Thread Wang Xingang
Hi Eric, On 2021/4/13 1:36, Auger Eric wrote: Hi Wang, On 3/25/21 8:22 AM, Wang Xingang wrote: From: Xingang Wang This add iommu option for pci root bus, including primary bus and pxb root bus. The option is valid only if there is a virtual iommu device. Signed-off-by: Xingang Wang Signed

Re: [RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-03-11 Thread Wang Xingang
Hi Eric, On 2021/3/10 18:18, Auger Eric wrote: Hi Xingang, On 3/10/21 3:13 AM, Wang Xingang wrote: Hi Eric, On 2021/3/9 22:36, Auger Eric wrote: Hi, On 2/27/21 9:33 AM, Wang Xingang wrote: From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including

Re: [RFC RESEND PATCH 1/4] pci: Add PCI_BUS_IOMMU property

2021-03-11 Thread Wang Xingang
Hi Eric, On 2021/3/10 18:25, Auger Eric wrote: Hi Xingang, On 2/27/21 9:33 AM, Wang Xingang wrote: From: Xingang Wang This Property can be useful to check whether this bus is attached to iommu. Strictly speaking this is not a Property (QEMU property) but a flag Signed-off-by: Xingang

Re: [RFC RESEND PATCH 2/4] hw/pci: Add iommu option for pci root bus

2021-03-11 Thread Wang Xingang
Hi Eric, On 2021/3/10 18:24, Auger Eric wrote: Hi Xingang, On 2/27/21 9:33 AM, Wang Xingang wrote: From: Xingang Wang This add iommu option for pci root bus, including primary bus and pxb root bus. Default option is set to true, and the option is valid only if the iommu option for machine

[PATCH v4 2/8] hw/pxb: Add a bypass iommu property

2021-05-24 Thread Wang Xingang
From: Xingang Wang This add a bypass_iommu property for pci_expander_bridge. The property can be used as: qemu -device pxb-pcie,bus_nr=0x10,addr=0x1,bypass_iommu=true Signed-off-by: Xingang Wang --- hw/pci-bridge/pci_expander_bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/p

[PATCH v4 3/8] hw/arm/virt: Add a machine option to bypass iommu for primary bus

2021-05-24 Thread Wang Xingang
From: Xingang Wang This add a bypass_iommu option for arm virt machine, the option can be used in this manner: qemu -machine virt,iommu=smmuv3,bypass_iommu=true Signed-off-by: Xingang Wang --- hw/arm/virt.c | 26 ++ include/hw/arm/virt.h | 1 + 2 files changed,

[PATCH v4 5/8] hw/pci: Add pci_bus_range to get bus number range

2021-05-24 Thread Wang Xingang
From: Xingang Wang This helps to get the bus number range of a pci bridge hierarchy. Signed-off-by: Xingang Wang --- hw/pci/pci.c | 15 +++ include/hw/pci/pci.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 27d588e268..7f18ea5ef5

[PATCH v4 8/8] hw/i386/acpi-build: Add bypass_iommu check when building IVRS table

2021-05-24 Thread Wang Xingang
From: Xingang Wang When building IVRS table, only devices which go through iommu will be scanned, and the corresponding ivhd will be inserted. Signed-off-by: Xingang Wang --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386

[PATCH v4 1/8] hw/pci/pci_host: Allow bypass iommu for pci host

2021-05-24 Thread Wang Xingang
From: Xingang Wang This add a bypass_iommu property for pci host, which indicates whether devices attached to the pci root bus will bypass iommu. In pci_device_iommu_address_space(), add a bypass_iommu check to avoid getting iommu address space for devices bypass iommu. Signed-off-by: Xingang Wa

[PATCH v4 0/8] IOMMU: Add support for IOMMU Bypass Feature

2021-05-24 Thread Wang Xingang
From: Xingang Wang These patches add support for configure bypass_iommu on/off for pci root bus, including primary bus and pxb root bus. At present, all root bus will go through iommu when iommu is configured, which is not flexible, because in many situations the need for using iommu and bypass i

[PATCH v4 4/8] hw/i386: Add a pc machine option to bypass iommu for primary bus

2021-05-24 Thread Wang Xingang
From: Xingang Wang Add a bypass_iommu pc machine option to bypass iommu translation for the primary root bus. The option can be used as manner: qemu-system-x86_64 -machine q35,bypass_iommu=true Signed-off-by: Xingang Wang --- hw/i386/pc.c | 18 ++ hw/pci-host/q35.c|

[PATCH v4 7/8] hw/i386/acpi-build: Add explicit scope in DMAR table

2021-05-24 Thread Wang Xingang
From: Xingang Wang In DMAR table, the drhd is set to cover all pci devices when intel_iommu is on. This patch add explicit scope data, including only the pci devices that go through iommu. Signed-off-by: Xingang Wang --- hw/i386/acpi-build.c | 68 ++-- 1

[PATCH v4 6/8] hw/arm/virt-acpi-build: Add explicit IORT idmap for smmuv3 node

2021-05-24 Thread Wang Xingang
From: Xingang Wang This add explicit IORT idmap info according to pci root bus number range, and only add smmu idmap for those which does not bypass iommu. For idmap directly to ITS node, this split the whole RID mapping to smmu idmap and its idmap. So this should cover the whole idmap for throu

Re: [RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-03-09 Thread Wang Xingang
Hi, everyone! Do you have any suggestions? Please help review these patches, thanks very much. On 2021/2/27 16:33, Wang Xingang wrote: From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including primary bus and pxb root bus. At present, All root bus

Re: [RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-03-09 Thread Wang Xingang
Hi Eric, On 2021/3/9 22:36, Auger Eric wrote: Hi, On 2/27/21 9:33 AM, Wang Xingang wrote: From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including primary bus and pxb root bus. At present, All root bus will go through iommu when iommu is configured

[PATCH RFC v3 0/8] Introduce Bypass IOMMU Feature

2021-04-21 Thread Wang Xingang
From: Xingang Wang These patches add support for configure bypass_iommu on/off for pci root bus, including primary bus and pxb root bus. At present, All root bus will go through iommu when iommu is configured, which is not flexible, because in many situations the need for using iommu and bypass i

[PATCH RFC v3 1/8] hw/pci/pci_host: Allow bypass iommu for pci host

2021-04-21 Thread Wang Xingang
From: Xingang Wang This add a bypass_iommu property for pci host, which indicates whether devices attached to the pci root bus will bypass iommu. In pci_device_iommu_address_space(), add a bypass_iommu check to avoid getting iommu address space for devices bypass iommu. Signed-off-by: Xingang Wa

[PATCH RFC v3 4/8] hw/i386: Add a pc machine option to bypass iommu for primary bus

2021-04-21 Thread Wang Xingang
From: Xingang Wang Add a bypass_iommu pc machine option to bypass iommu translation for the primary root bus. The option can be used as manner: qemu-system-x86_64 -machine q35,bypass_iommu=true Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/i386/pc.c | 18 +++

[PATCH RFC v3 3/8] hw/arm/virt: Add a machine option to bypass iommu for primary bus

2021-04-21 Thread Wang Xingang
From: Xingang Wang This add a bypass_iommu option for arm virt machine, the option can be used in this manner: qemu -machine virt,iommu=smmuv3,bypass_iommu=true Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/arm/virt.c | 26 ++ include/hw/arm/virt

[PATCH RFC v3 8/8] hw/i386/acpi-build: Add bypass_iommu check when building IVRS table

2021-04-21 Thread Wang Xingang
From: Xingang Wang When building IVRS table, only devices which go through iommu will be scanned, and the corresponding ivhd will be inserted. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/

[PATCH RFC v3 7/8] hw/i386/acpi-build: Add explicit scope in DMAR table

2021-04-21 Thread Wang Xingang
From: Xingang Wang In DMAR table, the drhd is set to cover all pci devices when intel_iommu is on. This patch add explicit scope data, including only the pci devices that go through iommu. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/i386/acpi-build.c | 68

[PATCH RFC v3 2/8] hw/pxb: Add a bypass iommu property

2021-04-21 Thread Wang Xingang
From: Xingang Wang This add a bypass_iommu property for pci_expander_bridge. The property can be used as: qemu -device pxb-pcie,bus_nr=0x10,addr=0x1,bypass_iommu=true Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci-bridge/pci_expander_bridge.c | 3 +++ 1 file changed, 3 inser

[PATCH RFC v3 5/8] hw/pci: Add pci_bus_range to get bus number range

2021-04-21 Thread Wang Xingang
From: Xingang Wang This helps to get the bus number range of a pci bridge hierarchy. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c | 15 +++ include/hw/pci/pci.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c in

[PATCH RFC v3 6/8] hw/arm/virt-acpi-build: Add explicit IORT idmap for smmuv3 node

2021-04-21 Thread Wang Xingang
From: Xingang Wang This add explicit IORT idmap info according to pci root bus number range, and only add smmu idmap for those which does not bypass iommu. For idmap directly to ITS node, this split the whole RID mapping to smmu idmap and its idmap. So this should cover the whole idmap for throu

[RFC PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-02-26 Thread Wang Xingang
From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including primary bus and pxb root bus. At present, All root bus will go through iommu when iommu is configured, which is not flexible. So this add option to enable/disable iommu for primary bus and pxb roo

[RFC PATCH 1/4] pci: Add PCI_BUS_IOMMU property

2021-02-26 Thread Wang Xingang
From: Xingang Wang This property can be useful to check whether this bus is attached to iommu. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- include/hw/pci/pci_bus.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bu

[RFC PATCH 3/4] hw/pci: Add pci_root_bus_max_bus

2021-02-26 Thread Wang Xingang
From: Xingang Wang This helps to find max bus number of a root bus. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c | 33 + include/hw/pci/pci.h | 1 + 2 files changed, 34 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c i

[RFC PATCH 2/4] hw/pci: Add iommu option for pci root bus

2021-02-26 Thread Wang Xingang
From: Xingang Wang This add iommu option for pci root bus, including primary bus and pxb root bus. Default option is set to true, and the option is valid only if the iommu option for machine is properly set. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/arm/virt.c

[RFC PATCH 4/4] hw/arm/virt-acpi-build: Add explicit idmap info in IORT table

2021-02-26 Thread Wang Xingang
From: Xingang Wang The idmap of smmuv3 and root complex covers the whole RID space for now, this patch add explicit idmap info according to root bus number range. This add smmuv3 idmap for certain bus which has enabled the iommu property. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen -

[RFC RESEND PATCH 1/4] pci: Add PCI_BUS_IOMMU property

2021-02-27 Thread Wang Xingang
From: Xingang Wang This Property can be useful to check whether this bus is attached to iommu. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- include/hw/pci/pci_bus.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bu

[RFC RESEND PATCH 3/4] hw/pci: Add pci_root_bus_max_bus

2021-02-27 Thread Wang Xingang
From: Xingang Wang This helps to find max bus number of a root bus. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/pci/pci.c | 33 + include/hw/pci/pci.h | 1 + 2 files changed, 34 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c i

[RFC RESEND PATCH 4/4] hw/arm/virt-acpi-build: Add explicit idmap info in IORT table

2021-02-27 Thread Wang Xingang
From: Xingang Wang The idmap of smmuv3 and root complex covers the whole RID space for now, this patch add explicit idmap info according to root bus number range. This add smmuv3 idmap for certain bus which has enabled the iommu property. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen -

[RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-02-27 Thread Wang Xingang
From: Xingang Wang These patches add support for configure iommu on/off for pci root bus, including primary bus and pxb root bus. At present, All root bus will go through iommu when iommu is configured, which is not flexible. So this add option to enable/disable iommu for primary bus and pxb roo

[RFC RESEND PATCH 2/4] hw/pci: Add iommu option for pci root bus

2021-02-27 Thread Wang Xingang
From: Xingang Wang This add iommu option for pci root bus, including primary bus and pxb root bus. Default option is set to true, and the option is valid only if the iommu option for machine is properly set. Signed-off-by: Xingang Wang Signed-off-by: Jiahui Cen --- hw/arm/virt.c

[PATCH 0/3] acpi: Add _CCA support for pxb devices

2021-02-04 Thread Wang Xingang
From: Xingang Wang This patch series add fix for pxb support dma 1. Add _CCA attribute for pxb DSDT, because cache coherency attribute is needed when check dma support for pxb device. 2. Update DSDT.pxb file Xingang Wang (3): acpi: Allow pxb DSDT acpi table changes acpi/gpex: Fix cca attribu

[PATCH 1/3] acpi: Allow pxb DSDT acpi table changes

2021-02-04 Thread Wang Xingang
From: Xingang Wang Signed-off-by: Jiahui Cen Signed-off-by: Xingang Wang --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..90c53925fc 1

[PATCH 3/3] acpi: Update _CCA attribute in DSDT.pxb

2021-02-04 Thread Wang Xingang
From: Xingang Wang A new _CCA attribute is added. Update expected DSDT files accordingly, and re-enable their testing. Full diff of changed files disassembly: * * Disassembling to symbolic ASL+ operators * - * Disassembly of DSDT.pxb, Thu Feb 4 21:07:42 2021 + * Disassembly of DSDT.pxb,

[PATCH 2/3] acpi/gpex: Fix cca attribute check for pxb device

2021-02-04 Thread Wang Xingang
From: Xingang Wang When check DMA support for device attached to pxb, the cache coherency attribute need to be set. This add _CCA attribute for pxb DSDT. Fixes: 6f9765fbad ("acpi/gpex: Build tables for pxb") Signed-off-by: Jiahui Cen Signed-off-by: Xingang Wang --- hw/pci-host/gpex-acpi.c |

[PATCH v5 2/9] hw/pxb: Add a bypass iommu property

2021-07-08 Thread Wang Xingang
From: Xingang Wang Add a bypass_iommu property for pci_expander_bridge, the property is used to indicate whether pxb root bus will bypass iommu. By default the bypass_iommu is disabled, and it can be enabled with: qemu -device pxb-pcie,bus_nr=0x10,addr=0x1,bypass_iommu=true Signed-off-by: Xingan

[PATCH v5 9/9] docs: Add documentation for iommu bypass

2021-07-08 Thread Wang Xingang
From: Xingang Wang Signed-off-by: Xingang Wang --- docs/bypass-iommu.txt | 89 +++ 1 file changed, 89 insertions(+) create mode 100644 docs/bypass-iommu.txt diff --git a/docs/bypass-iommu.txt b/docs/bypass-iommu.txt new file mode 100644 index 00

[PATCH v5 7/9] hw/i386/acpi-build: Add DMAR support to bypass iommu

2021-07-08 Thread Wang Xingang
From: Xingang Wang In DMAR table, the drhd is set to cover all PCI devices when intel_iommu is on. To support bypass iommu feature, we need to walk the PCI bus with bypass_iommu disabled and add explicit scope data in DMAR drhd structure. /mnt/sdb/wxg/qemu-next/qemu/build/x86_64-softmmu/qemu-sys

[PATCH v5 5/9] hw/pci: Add pci_bus_range() to get PCI bus number range

2021-07-08 Thread Wang Xingang
From: Xingang Wang This helps to get the min and max bus number of a PCI bus hierarchy. Signed-off-by: Xingang Wang Reviewed-by: Eric Auger --- hw/pci/pci.c | 16 include/hw/pci/pci.h | 1 + 2 files changed, 17 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c

[PATCH v5 6/9] hw/arm/virt-acpi-build: Add IORT support to bypass SMMUv3

2021-07-08 Thread Wang Xingang
From: Xingang Wang When we build IORT table with SMMUv3 and bypass iommu feature enabled, we can no longer setup one map from RC to SMMUv3 covering the whole RIDs. We need to walk the PCI bus and check whether the root bus will bypass iommu, setup RC -> SMMUv3 -> ITS map for RC which will not byp

[PATCH v5 1/9] hw/pci/pci_host: Allow PCI host to bypass iommu

2021-07-08 Thread Wang Xingang
From: Xingang Wang Add a new bypass_iommu property for PCI host and use it to check whether devices attached to the PCI root bus will bypass iommu. In pci_device_iommu_address_space(), check the property and avoid getting iommu address space for devices bypass iommu. Signed-off-by: Xingang Wang

[PATCH v5 0/9] IOMMU: Add support for IOMMU Bypass Feature

2021-07-08 Thread Wang Xingang
From: Xingang Wang Traditionally, there is a global switch to enable/disable vIOMMU. All devices in the system can only support go through vIOMMU or not, which is not flexible. We introduce this bypass iommu property to support coexist of devices go through vIOMMU and devices not. This is useful

[PATCH v5 3/9] hw/arm/virt: Add default_bus_bypass_iommu machine option

2021-07-08 Thread Wang Xingang
From: Xingang Wang Add a default_bus_bypass_iommu machine option to enable/disable bypass_iommu for default root bus. The option is disabled by default and can be enabled with: $QEMU -machine virt,iommu=smmuv3,default_bus_bypass_iommu=true Signed-off-by: Xingang Wang --- hw/arm/virt.c

[PATCH v5 8/9] hw/i386/acpi-build: Add IVRS support to bypass iommu

2021-07-08 Thread Wang Xingang
From: Xingang Wang Check bypass_iommu to exclude the devices which will bypass iommu. Signed-off-by: Xingang Wang --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 1b972b4913..7c888f05bf 100644 --- a/h

[PATCH v5 4/9] hw/i386: Add a default_bus_bypass_iommu pc machine option

2021-07-08 Thread Wang Xingang
From: Xingang Wang Add a default_bus_bypass_iommu pc machine option to enable/disable bypass_iommu for default root bus. The option is disabled by default and can be enabled with: $QEMU -machine q35,default_bus_bypass_iommu=true Signed-off-by: Xingang Wang --- hw/i386/pc.c | 20 +++