iommu/vt-d: Set U/S bit in first level page table by default
authorLu Baolu <baolu.lu@linux.intel.com>
Mon, 22 Jun 2020 23:13:41 +0000 (07:13 +0800)
committerJoerg Roedel <jroedel@suse.de>
Tue, 23 Jun 2020 08:08:31 +0000 (10:08 +0200)
commit16ecf10e815d70d11d2300243f4a3b4c7c5acac7
tree8b8d41761672fe36743e42d728a90da997e6a94a
parent9486727f5981a5ec5c0b699fb1777451bd6786e4
iommu/vt-d: Set U/S bit in first level page table by default

When using first-level translation for IOVA, currently the U/S bit in the
page table is cleared which implies DMA requests with user privilege are
blocked. As the result, following error messages might be observed when
passing through a device to user level:

DMAR: DRHD: handling fault status reg 3
DMAR: [DMA Read] Request device [41:00.0] PASID 1 fault addr 7ecdcd000
        [fault reason 129] SM: U/S set 0 for first-level translation
        with user privilege

This fixes it by setting U/S bit in the first level page table and makes
IOVA over first level compatible with previous second-level translation.

Fixes: b802d070a52a1 ("iommu/vt-d: Use iova over first level")
Reported-by: Xin Zeng <xin.zeng@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20200622231345.29722-3-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
include/linux/intel-iommu.h