On Fri, Aug 30, 2024 at 03:23:41PM +0000, Mostafa Saleh wrote: > > +/** > > + * struct iommu_hw_info_arm_smmuv3 - ARM SMMUv3 hardware information > > + * (IOMMU_HW_INFO_TYPE_ARM_SMMUV3) > > + * > > + * @flags: Must be set to 0 > > + * @__reserved: Must be 0 > > + * @idr: Implemented features for ARM SMMU Non-secure programming interface > > + * @iidr: Information about the implementation and implementer of ARM SMMU, > > + * and architecture version supported > > + * @aidr: ARM SMMU architecture version > > + * > > + * For the details of @idr, @iidr and @aidr, please refer to the chapters > > + * from 6.3.1 to 6.3.6 in the SMMUv3 Spec. > > + * > > + * User space should read the underlying ARM SMMUv3 hardware information for > > + * the list of supported features. > > + * > > + * Note that these values reflect the raw HW capability, without any insight if > > + * any required kernel driver support is present. Bits may be set indicating the > > + * HW has functionality that is lacking kernel software support, such as BTM. If > > + * a VMM is using this information to construct emulated copies of these > > + * registers it should only forward bits that it knows it can support. > > + * > > + * In future, presence of required kernel support will be indicated in flags. > > + */ > > +struct iommu_hw_info_arm_smmuv3 { > > + __u32 flags; > > + __u32 __reserved; > > + __u32 idr[6]; > > + __u32 iidr; > > + __u32 aidr; > > +}; > There is a ton of information here, I think we might need to santitze the > values for what user space needs to know (that's why I was asking about qemu) > also SMMU_IDR4 is implementation define, not sure if we can unconditionally > expose it to userspace. What is the harm? Does exposing IDR data to userspace in any way compromise the security or integrity of the system? I think no - how could it? As the comments says, the VMM should not just blindly forward this to a guest! The VMM needs to make its own IDR to reflect its own vSMMU capabilities. It can refer to the kernel IDR if it needs to. So, if the kernel is going to limit it, what criteria would you propose the kernel use? Jason