]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/arm-smmu-v3: Support IOMMU_GET_HW_INFO via struct arm_smmu_hw_info
authorNicolin Chen <nicolinc@nvidia.com>
Thu, 31 Oct 2024 00:20:49 +0000 (21:20 -0300)
committerWill Deacon <will@kernel.org>
Tue, 5 Nov 2024 10:24:17 +0000 (10:24 +0000)
commit6912ec91828b8d7f21b393befad1c36dadbcd751
tree8b506e00fdbceba7bd036f3068b0d369c4181709
parente89573cf4a13ca4e314d03d56ac84c0ba2af464b
iommu/arm-smmu-v3: Support IOMMU_GET_HW_INFO via struct arm_smmu_hw_info

For virtualization cases the IDR/IIDR/AIDR values of the actual SMMU
instance need to be available to the VMM so it can construct an
appropriate vSMMUv3 that reflects the correct HW capabilities.

For userspace page tables these values are required to constrain the valid
values within the CD table and the IOPTEs.

The kernel does not sanitize these values. If building a VMM then
userspace is required to only forward bits into a VM that it knows it can
implement. Some bits will also require a VMM to detect if appropriate
kernel support is available such as for ATS and BTM.

Start a new file and kconfig for the advanced iommufd support. This lets
it be compiled out for kernels that are not intended to support
virtualization, and allows distros to leave it disabled until they are
shipping a matching qemu too.

Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Reviewed-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/5-v4-9e99b76f3518+3a8-smmuv3_nesting_jgg@nvidia.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/Kconfig
drivers/iommu/arm/arm-smmu-v3/Makefile
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c [new file with mode: 0644]
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
include/uapi/linux/iommufd.h