[PATCH v9 03/25] iommu/arm-smmu-v3: Move IDR parsing to common functions

Nicolin Chen nicolinc at nvidia.com
Tue Oct 20 12:02:05 PDT 2026


On Thu, Oct 15, 2026 at 08:08:34PM +0000, Mostafa Saleh wrote:
> The hypervisor SMMUv3 driver needs the same IDR0, IDR3, IDR5 and IIDR
> parsing as the kernel driver, plus the IDR1 checks it depends on
> (embedded implementation, ATTR_TYPES_OVR, StreamID size). Move them to
> arm-smmu-v3-common-lib.c, which will be built for both, and the IIDR
> implementer and product IDs to arm-smmu-v3.h.
> 
> The two drivers use different device structs, so the shared code is
> written against ARM_SMMU_OBJ, which each compilation unit defines. The
> kernel maps it to struct arm_smmu_device. Static asserts check that the
> fields the shared code uses exist with the expected types.
> 
> The validity checks stay with the parsing. dev_err() and dev_info()
> become arm_smmu_err() and arm_smmu_info(), defined per world next to
> ARM_SMMU_OBJ, as the hypervisor cannot print to the console. The
> disable_msipolling module parameter is passed as an argument so the
> hypervisor can opt out, and cpus_have_cap() becomes
> cpus_have_final_cap(), which the hypervisor can use.
> 
> No functional change intended.
> 
> Suggested-by: Jason Gunthorpe <jgg at nvidia.com>
> Signed-off-by: Mostafa Saleh <smostafa at google.com>

Reviewed-by: Nicolin Chen <nicolinc at nvidia.com>



More information about the linux-arm-kernel mailing list