OSDN Git Service

iommu/vt-d: Fix passthrough mode with translation-disabled devices
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 11 May 2015 13:59:20 +0000 (14:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jun 2015 00:03:26 +0000 (17:03 -0700)
commit5c8aa3703c86062549922395c8b7be632a8c1e10
treef5525d5ecbd6759c76dda51e434a58ed3a316408
parenta48b654c95292046937c35b4077e93e4cd77ee6f
iommu/vt-d: Fix passthrough mode with translation-disabled devices

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