iommu/vt-d: respect max guest address width in agaw
PATCH v2 1/1 iommu/vt-d: respect max guest address width in agaw
Supported guest address witdh (SGAW) only indicates what the iommu's capabilities are wrt page table levels for second level page-tables. IOMMU should pick the right level depending on the Maximum Guest Address Width (MGAW).
For pass-through translation type, address width must be programmed with the largest AGAW supported by the HW.
--- drivers/iommu/intel-iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iommu/intel-iommu.c +5 -1
@@ -719,7 +719,11 @@ int iommu_calculate_max_sagaw(struct intel_iommu *iommu)*/ int iommu_calculate_agaw (struct intel_iommu *iommu) { -return __iommu_calculate_agaw (iommu,DEFAULT_DOMAIN_ADDRESS_WIDTH ); +unsigned long mgaw; + +/* Respect Max Guest Address Width */ + mgaw =min (cap_mgaw (iommu->cap),DEFAULT_DOMAIN_ADDRESS_WIDTH ); +return __iommu_calculate_agaw (iommu, mgaw); }/* This functionin only returns single iommu in a domain */
Signature · 1 line
2.7.4
Quoted 2 lines · Jacob Pan
drivers/iommu/intel-iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Applied, thanks.
Quoted 5 lines · On Wed, 7 Nov 2018 17:04:28 +0100 Joerg Roedel <[email protected]> wrote:
Quoted 2 lines · Jacob Pan
drivers/iommu/intel-iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Applied, thanks.
Hi Joerg,
We have found some issues with this patch on some platforms. Please disregard this patch.
The intent of this patch was to fix some IOMMU with max address of 48 but SAGAW of both 48 and 57 bits. Need to do more investigation in the page table level calculation and context address width setup. Sorry about that.
Jacob
Joerg Roedel
maintainerQuoted 2 lines · Jacob Pan
We have found some issues with this patch on some platforms. Please disregard this patch.
Patch dropped.