Thread (31 messages) 31 messages, 2 authors, 2025-01-07

Re: [PATCH v4 14/14] iommu/arm-smmu-v3: Report events that belong to devices attached to vIOMMU

From: Baolu Lu <baolu.lu@linux.intel.com>
Date: 2025-01-07 06:29:44
Also in: linux-doc, linux-iommu, linux-kselftest, linux-patches, lkml

On 1/7/25 14:00, Nicolin Chen wrote:
On Tue, Jan 07, 2025 at 01:54:00PM +0800, Baolu Lu wrote:
quoted
On 1/7/25 12:36, Nicolin Chen wrote:
quoted
+static bool arm_vsmmu_supports_veventq(unsigned int type)
+{
+	return type == IOMMU_VIOMMU_TYPE_ARM_SMMUV3;
Do you need to check the hardware capabilities before reporting this? I
am not familiar with the ARM architecture, but typically it's better to
make it like this,

static bool arm_vsmmu_supports_veventq(struct iommufd_viommu *viommu,
                                        enum iommu_veventq_type type)
{
	if (type != IOMMU_VEVENTQ_TYPE_ARM_SMMUV3)
		return false;

	if (hardware_not_capable(viommu))
		return false;
I think the ARM version of viommu_alloc op has already implemented
enough capability checks and rejected any of hardware_not_capable.
So, viommu shouldn't be a thing that the driver could actually use
to call this helper 🙂
Okay, fair enough.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help