linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iommu/vt-d: respect max guest address width in agaw
@ 2018-11-06 22:47 Jacob Pan
  2018-11-07 16:04 ` Joerg Roedel
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Pan @ 2018-11-06 22:47 UTC (permalink / raw)
  To: Joerg Roedel, iommu, LKML; +Cc: Lu Baolu, Mehta, Sohil, Jacob Pan, Ashok Raj

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.

Reported-by: Ramos Falcon, Ernesto R <ernesto.r.ramos.falcon@intel.com>
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
---
 drivers/iommu/intel-iommu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 140d6ab..f16db3b 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -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 */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] iommu/vt-d: respect max guest address width in agaw
  2018-11-06 22:47 [PATCH v2] iommu/vt-d: respect max guest address width in agaw Jacob Pan
@ 2018-11-07 16:04 ` Joerg Roedel
  2018-11-07 22:12   ` Jacob Pan
  0 siblings, 1 reply; 4+ messages in thread
From: Joerg Roedel @ 2018-11-07 16:04 UTC (permalink / raw)
  To: Jacob Pan; +Cc: iommu, LKML, Lu Baolu, Mehta, Sohil, Ashok Raj

On Tue, Nov 06, 2018 at 02:47:15PM -0800, Jacob Pan wrote:
>  drivers/iommu/intel-iommu.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] iommu/vt-d: respect max guest address width in agaw
  2018-11-07 16:04 ` Joerg Roedel
@ 2018-11-07 22:12   ` Jacob Pan
  2018-11-08  9:27     ` Joerg Roedel
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Pan @ 2018-11-07 22:12 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, LKML, Lu Baolu, Mehta, Sohil, Ashok Raj, jacob.jun.pan

On Wed, 7 Nov 2018 17:04:28 +0100
Joerg Roedel <joro@8bytes.org> wrote:

> On Tue, Nov 06, 2018 at 02:47:15PM -0800, Jacob Pan wrote:
> >  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] iommu/vt-d: respect max guest address width in agaw
  2018-11-07 22:12   ` Jacob Pan
@ 2018-11-08  9:27     ` Joerg Roedel
  0 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2018-11-08  9:27 UTC (permalink / raw)
  To: Jacob Pan; +Cc: iommu, LKML, Lu Baolu, Mehta, Sohil, Ashok Raj

On Wed, Nov 07, 2018 at 02:12:25PM -0800, Jacob Pan wrote:
> We have found some issues with this patch on some platforms. Please
> disregard this patch.

Patch dropped.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-08  9:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 22:47 [PATCH v2] iommu/vt-d: respect max guest address width in agaw Jacob Pan
2018-11-07 16:04 ` Joerg Roedel
2018-11-07 22:12   ` Jacob Pan
2018-11-08  9:27     ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).