From: <gregkh@linuxfoundation.org>
To: David.Woodhouse@intel.com, gregkh@linuxfoundation.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "iommu/vt-d: Fix passthrough mode with translation-disabled devices" has been added to the 4.0-stable tree
Date: Fri, 19 Jun 2015 11:17:03 -0700 [thread overview]
Message-ID: <1434737823186213@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
iommu/vt-d: Fix passthrough mode with translation-disabled devices
to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
iommu-vt-d-fix-passthrough-mode-with-translation-disabled-devices.patch
and it can be found in the queue-4.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 4ed6a540fab8ea4388c1703b73ecfed68a2009d1 Mon Sep 17 00:00:00 2001
From: David Woodhouse <David.Woodhouse@intel.com>
Date: Mon, 11 May 2015 14:59:20 +0100
Subject: iommu/vt-d: Fix passthrough mode with translation-disabled devices
From: David Woodhouse <David.Woodhouse@intel.com>
commit 4ed6a540fab8ea4388c1703b73ecfed68a2009d1 upstream.
When we use 'intel_iommu=igfx_off' to disable translation for the
graphics, and when we discover that the BIOS has misconfigured the DMAR
setup for I/OAT, we use a special DUMMY_DEVICE_DOMAIN_INFO value in
dev->archdata.iommu to indicate that translation is disabled.
With passthrough mode, we were attempting to dereference that as a
normal pointer to a struct device_domain_info when setting up an
identity mapping for the affected device.
This fixes the problem by making device_to_iommu() explicitly check for
the special value and indicate that no IOMMU was found to handle the
devices in question.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iommu/intel-iommu.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -673,6 +673,11 @@ static void domain_update_iommu_cap(stru
domain->iommu_superpage = domain_update_iommu_superpage(NULL);
}
+static int iommu_dummy(struct device *dev)
+{
+ return dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO;
+}
+
static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devfn)
{
struct dmar_drhd_unit *drhd = NULL;
@@ -682,6 +687,9 @@ static struct intel_iommu *device_to_iom
u16 segment = 0;
int i;
+ if (iommu_dummy(dev))
+ return NULL;
+
if (dev_is_pci(dev)) {
pdev = to_pci_dev(dev);
segment = pci_domain_nr(pdev->bus);
@@ -2974,11 +2982,6 @@ static inline struct dmar_domain *get_va
return __get_valid_domain_for_dev(dev);
}
-static int iommu_dummy(struct device *dev)
-{
- return dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO;
-}
-
/* Check if the dev needs to go through non-identity map and unmap process.*/
static int iommu_no_mapping(struct device *dev)
{
Patches currently in stable-queue which might be from David.Woodhouse@intel.com are
queue-4.0/iommu-vt-d-fix-passthrough-mode-with-translation-disabled-devices.patch
queue-4.0/iommu-vt-d-allow-rmrr-on-graphics-devices-too.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
reply other threads:[~2015-06-19 18:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1434737823186213@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=David.Woodhouse@intel.com \
--cc=stable-commits@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.