Skip to content

Commit cf7ed01

Browse files
LuBaolugregkh
authored andcommitted
iommu/vt-d: Correctly check addr alignment in qi_flush_dev_iotlb_pasid()
[ Upstream commit 494b368 ] An incorrect address mask is being used in the qi_flush_dev_iotlb_pasid() to check the address alignment. This leads to a lot of spurious kernel warnings: [ 485.837093] DMAR: Invalidate non-aligned address 7f76f47f9000, order 0 [ 485.837098] DMAR: Invalidate non-aligned address 7f76f47f9000, order 0 [ 492.494145] qi_flush_dev_iotlb_pasid: 5734 callbacks suppressed [ 492.494147] DMAR: Invalidate non-aligned address 7f7728800000, order 11 [ 492.508965] DMAR: Invalidate non-aligned address 7f7728800000, order 11 Fix it by checking the alignment in right way. Fixes: 288d08e ("iommu/vt-d: Handle non-page aligned address") Reported-and-tested-by: Guo Kaijie <Kaijie.Guo@intel.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Cc: Liu Yi L <yi.l.liu@intel.com> Link: https://lore.kernel.org/r/20210119043500.1539596-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 974b628 commit cf7ed01

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/iommu/intel/dmar.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ void qi_flush_dev_iotlb_pasid(struct intel_iommu *iommu, u16 sid, u16 pfsid,
14961496
* Max Invs Pending (MIP) is set to 0 for now until we have DIT in
14971497
* ECAP.
14981498
*/
1499-
if (addr & GENMASK_ULL(size_order + VTD_PAGE_SHIFT, 0))
1499+
if (!IS_ALIGNED(addr, VTD_PAGE_SIZE << size_order))
15001500
pr_warn_ratelimited("Invalidate non-aligned address %llx, order %d\n",
15011501
addr, size_order);
15021502

0 commit comments

Comments
 (0)