History

iommu/arm-smmu-v3: Improve uAPI comment for IOMMU_HW_INFO_TYPE_ARM_SMMUV3

Be specific about what fields should be accessed in the idr result and give other guidance to the VMM on how it should generate the vIDR. Discussion on the list, and review of the qemu implementation understood this needs to be clearer and more detailed.

Jason Gunthorpe committed 2 years ago

Commit 2ca704f1 parent a8c9df21 file · +19 −10Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/iommufd.h+19−10
@@ -558,16 +558,25 @@ struct iommu_hw_info_vtd { · 557 unmodified lines
558558 * For the details of @idr, @iidr and @aidr, please refer to the chapters
559559 * from 6.3.1 to 6.3.6 in the SMMUv3 Spec.
560560 *
561− * User space should read the underlying ARM SMMUv3 hardware information for
562− * the list of supported features.
563− *
564− * Note that these values reflect the raw HW capability, without any insight if
565− * any required kernel driver support is present. Bits may be set indicating the
566− * HW has functionality that is lacking kernel software support, such as BTM. If
567− * a VMM is using this information to construct emulated copies of these
568− * registers it should only forward bits that it knows it can support.
569− *
570− * In future, presence of required kernel support will be indicated in flags.
561+ * This reports the raw HW capability, and not all bits are meaningful to be
562+ * read by userspace. Only the following fields should be used:
563+ *
564+ * idr[0]: ST_LEVEL, TERM_MODEL, STALL_MODEL, TTENDIAN , CD2L, ASID16, TTF
565+ * idr[1]: SIDSIZE, SSIDSIZE
566+ * idr[3]: BBML, RIL
567+ * idr[5]: VAX, GRAN64K, GRAN16K, GRAN4K
568+ *
569+ * - S1P should be assumed to be true if a NESTED HWPT can be created
570+ * - VFIO/iommufd only support platforms with COHACC, it should be assumed to be
571+ * true.
572+ * - ATS is a per-device property. If the VMM describes any devices as ATS
573+ * capable in ACPI/DT it should set the corresponding idr.
574+ *
575+ * This list may expand in future (eg E0PD, AIE, PBHA, D128, DS etc). It is
576+ * important that VMMs do not read bits outside the list to allow for
577+ * compatibility with future kernels. Several features in the SMMUv3
578+ * architecture are not currently supported by the kernel for nesting: HTTU,
579+ * BTM, MPAM and others.
571580 */
572581 struct iommu_hw_info_arm_smmuv3 {
573582 __u32 flags;