[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFCv1 10/10] hw/arm/virt-acpi-build: Enable ATS for nested SMMUv3
From: |
Nicolin Chen |
Subject: |
[PATCH RFCv1 10/10] hw/arm/virt-acpi-build: Enable ATS for nested SMMUv3 |
Date: |
Tue, 25 Jun 2024 17:28:37 -0700 |
For a nested SMMUv3, the ATS capaiblity is decided by the underlying HW,
and then reflected in the IDR0 register of the vSMMU.
The IORT on the other hand could allow it to be always enabled, relying
on the guest-level SMMU kernel driver to disable ATS feature if the ATS
bit isn't set in IDR0.
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
---
hw/arm/virt-acpi-build.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 6d8b9aea42..c4cf1caf22 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -485,7 +485,11 @@ build_iort(GArray *table_data, BIOSLinker *linker,
VirtMachineState *vms)
/* Table 15 Memory Access Flags */
build_append_int_noprefix(table_data, 0x3 /* CCA = CPM = DACS = 1 */, 1);
- build_append_int_noprefix(table_data, 0, 4); /* ATS Attribute */
+ if (vms->iommu == VIRT_IOMMU_NESTED_SMMUV3) {
+ build_append_int_noprefix(table_data, 1, 4); /* ATS Attribute */
+ } else {
+ build_append_int_noprefix(table_data, 0, 4); /* ATS Attribute */
+ }
/* MCFG pci_segment */
build_append_int_noprefix(table_data, 0, 4); /* PCI Segment number */
--
2.43.0
- [PATCH RFCv1 00/10] hw/arm/virt: Add multiple nested SMMUs, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 07/10] hw/arm/virt: Bypass iommu for default PCI bus, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 02/10] hw/arm/virt: Add iommufd link to virt-machine, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 06/10] hw/arm/virt: Assign vfio-pci devices to nested SMMUs, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 09/10] hw/arm/virt-acpi-build: Build IORT with multiple SMMU nodes, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 08/10] hw/arm/virt-acpi-build: Handle reserved bus number of pxb buses, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 10/10] hw/arm/virt-acpi-build: Enable ATS for nested SMMUv3,
Nicolin Chen <=
- [PATCH RFCv1 01/10] hw/arm/virt-acpi-build: Add IORT RMR regions to handle MSI nested binding, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 05/10] hw/arm/virt: Add VIRT_NESTED_SMMU, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 04/10] hw/arm/virt: Add an SMMU_IO_LEN macro, Nicolin Chen, 2024/06/25
- [PATCH RFCv1 03/10] hw/arm/virt: Get the number of host-level SMMUv3 instances, Nicolin Chen, 2024/06/25