]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/tegra241-cmdqv: Limit CMDs for VCMDQs of a guest owned VINTF
authorNicolin Chen <nicolinc@nvidia.com>
Thu, 29 Aug 2024 22:34:39 +0000 (15:34 -0700)
committerWill Deacon <will@kernel.org>
Fri, 30 Aug 2024 14:28:25 +0000 (15:28 +0100)
commita9d40285bdefef700ebc7551ef79d2f3e4559e73
tree89d7a6d8e599af70aad9ed2a45ca03d8d389529f
parentf59e854907128ec3d4a82b7fc4efe9be8da2e78e
iommu/tegra241-cmdqv: Limit CMDs for VCMDQs of a guest owned VINTF

When VCMDQs are assigned to a VINTF owned by a guest (HYP_OWN bit unset),
only TLB and ATC invalidation commands are supported by the VCMDQ HW. So,
implement the new cmdq->supports_cmd op to scan the input cmd in order to
make sure that it is supported by the selected queue.

Note that the guest VM shouldn't have HYP_OWN bit being set regardless of
guest kernel driver writing it or not, i.e. the hypervisor running in the
host OS should wire this bit to zero when trapping a write access to this
VINTF_CONFIG register from a guest kernel.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Link: https://lore.kernel.org/r/8160292337059b91271045800e5c62f7295e2c24.1724970714.git.nicolinc@nvidia.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c