iommu/vt-d: Fix incomplete cache flush in intel_pasid_tear_down_entry()
authorLiu Yi L <yi.l.liu@intel.com>
Tue, 17 Aug 2021 12:43:21 +0000 (20:43 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 18 Aug 2021 11:15:58 +0000 (13:15 +0200)
commit8798d36411196da86e70b994725349c16c1119f6
tree1ebd1083ec58510f3671e54aa6aca3b0ad9d992f
parent62ef907a045e1a81830941c48004d7af71c9d75a
iommu/vt-d: Fix incomplete cache flush in intel_pasid_tear_down_entry()

This fixes improper iotlb invalidation in intel_pasid_tear_down_entry().
When a PASID was used as nested mode, released and reused, the following
error message will appear:

[  180.187556] Unexpected page request in Privilege Mode
[  180.187565] Unexpected page request in Privilege Mode
[  180.279933] Unexpected page request in Privilege Mode
[  180.279937] Unexpected page request in Privilege Mode

Per chapter 6.5.3.3 of VT-d spec 3.3, when tear down a pasid entry, the
software should use Domain selective IOTLB flush if the PGTT of the pasid
entry is SL only or Nested, while for the pasid entries whose PGTT is FL
only or PT using PASID-based IOTLB flush is enough.

Fixes: 2cd1311a26673 ("iommu/vt-d: Add set domain DOMAIN_ATTR_NESTING attr")
Signed-off-by: Kumar Sanjay K <sanjay.k.kumar@intel.com>
Signed-off-by: Liu Yi L <yi.l.liu@intel.com>
Tested-by: Yi Sun <yi.y.sun@intel.com>
Link: https://lore.kernel.org/r/20210817042425.1784279-1-yi.l.liu@intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20210817124321.1517985-3-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/pasid.c
drivers/iommu/intel/pasid.h