RE: [RFC PATCH 2/6] iommu/amd: Add support for hw_info for iommu capability query

Tian, Kevin
2023-12-15T07:32:17Z

> From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Sent: Wednesday, December 13, 2023 12:02 AM
>
> +void amd_iommu_build_efr(u64 *efr, u64 *efr2)
> +{
> + if (efr) {
> + *efr = (FEATURE_GT | FEATURE_GIOSUP | FEATURE_PPR);
> +
> + /* 5-level v2 page table support */
> + *efr |= ((FEATURE_GATS_5LEVEL << FEATURE_GATS_SHIFT) &
> + FEATURE_GATS_MASK);
> +
> + /* 3-level GCR3 table support */
> + *efr |= ((FEATURE_GLX_3LEVEL << FEATURE_GLX_SHIFT) &
> + FEATURE_GLX_MASK);
> +
> + /* 16-bit PASMAX support */
> + *efr |= ((FEATURE_PASMAX_16 << FEATURE_PASMAX_SHIFT)
> &
> + FEATURE_PASMAX_MASK);
> + }
> +
> + if (efr2)
> + *efr2 = 0;
> +}

Don't this need to check the support in hw?