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

From: Nicolin Chen

Date: Tue Oct 20 2026 - 15:05:32 EST


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@xxxxxxxxxx>
> Signed-off-by: Mostafa Saleh <smostafa@xxxxxxxxxx>

Reviewed-by: Nicolin Chen <nicolinc@xxxxxxxxxx>