From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>,
stable@vger.kernel.org,
Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>,
Ashok Raj <ashok.raj@intel.com>, Camille Lu <camille.lu@hpe.com>
Subject: Re: [PATCH 1/1] iommu/vt-d: Fix agaw for a supported 48 bit guest address width
Date: Mon, 16 Aug 2021 13:47:11 +0200 [thread overview]
Message-ID: <YRpQP1Yf/mGqVIDA@kroah.com> (raw)
In-Reply-To: <20210816113932.1210581-1-baolu.lu@linux.intel.com>
On Mon, Aug 16, 2021 at 07:39:32PM +0800, Lu Baolu wrote:
> From: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
>
> [ Upstream commit 327d5b2fee91c404a3956c324193892cf2cc9528 ]
>
> The IOMMU driver calculates the guest addressability for a DMA request
> based on the value of the mgaw reported from the IOMMU. However, this
> is a fused value and as mentioned in the spec, the guest width
> should be calculated based on the minimum of supported adjusted guest
> address width (SAGAW) and MGAW.
>
> This is from specification:
> "Guest addressability for a given DMA request is limited to the
> minimum of the value reported through this field and the adjusted
> guest address width of the corresponding page-table structure.
> (Adjusted guest address widths supported by hardware are reported
> through the SAGAW field)."
>
> This causes domain initialization to fail and following
> errors appear for EHCI PCI driver:
>
> [ 2.486393] ehci-pci 0000:01:00.4: EHCI Host Controller
> [ 2.486624] ehci-pci 0000:01:00.4: new USB bus registered, assigned bus
> number 1
> [ 2.489127] ehci-pci 0000:01:00.4: DMAR: Allocating domain failed
> [ 2.489350] ehci-pci 0000:01:00.4: DMAR: 32bit DMA uses non-identity
> mapping
> [ 2.489359] ehci-pci 0000:01:00.4: can't setup: -12
> [ 2.489531] ehci-pci 0000:01:00.4: USB bus 1 deregistered
> [ 2.490023] ehci-pci 0000:01:00.4: init 0000:01:00.4 fail, -12
> [ 2.490358] ehci-pci: probe of 0000:01:00.4 failed with error -12
>
> This issue happens when the value of the sagaw corresponds to a
> 48-bit agaw. This fix updates the calculation of the agaw based on
> the minimum of IOMMU's sagaw value and MGAW.
>
> This issue happens on the code path of getting a private domain for a
> device. A private domain was needed when the domain of an iommu group
> couldn't meet the requirement of a device. The IOMMU core has been
> evolved to eliminate the need for private domain, hence this code path
> has alreay been removed from the upstream since commit 327d5b2fee91c
> ("iommu/vt-d: Allow 32bit devices to uses DMA domain"). Instead of back
> porting all patches that are required for removing the private domain,
> this simply fixes it in the affected stable kernel between v4.16 and v5.7.
>
> [baolu: The orignal patch could be found here
> https://lore.kernel.org/linux-iommu/20210412202736.70765-1-saeed.mirzamohammadi@oracle.com/.
> I added commit message according to Greg's comments at
> https://lore.kernel.org/linux-iommu/YHZ%2FT9x7Xjf1r6fI@kroah.com/.]
>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Ashok Raj <ashok.raj@intel.com>
> Cc: stable@vger.kernel.org #v4.16+
> Signed-off-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
> Tested-by: Camille Lu <camille.lu@hpe.com>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
> drivers/iommu/intel-iommu.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
What stable tree(s) is this backport for?
thanks,
greg k-h
next prev parent reply other threads:[~2021-08-16 11:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 11:39 [PATCH 1/1] iommu/vt-d: Fix agaw for a supported 48 bit guest address width Lu Baolu
2021-08-16 11:47 ` Greg Kroah-Hartman [this message]
2021-08-16 11:48 ` Greg Kroah-Hartman
2021-08-16 12:20 ` Lu Baolu
2021-08-16 12:37 ` Greg Kroah-Hartman
2021-08-16 13:15 ` Lu Baolu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YRpQP1Yf/mGqVIDA@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ashok.raj@intel.com \
--cc=baolu.lu@linux.intel.com \
--cc=camille.lu@hpe.com \
--cc=joro@8bytes.org \
--cc=saeed.mirzamohammadi@oracle.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox