projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b34f10c
)
iommu/vt-d: Fix misuse of ALIGN in qi_flush_piotlb()
author
Lu Baolu
<baolu.lu@linux.intel.com>
Thu, 31 Dec 2020 00:53:19 +0000
(08:53 +0800)
committer
Will Deacon
<will@kernel.org>
Thu, 7 Jan 2021 13:27:14 +0000
(13:27 +0000)
Use IS_ALIGNED() instead. Otherwise, an unaligned address will be ignored.
Fixes: 33cd6e642d6a ("iommu/vt-d: Flush PASID-based iotlb for iova over first level")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link:
https://lore.kernel.org/r/20201231005323.2178523-1-baolu.lu@linux.intel.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/intel/dmar.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/intel/dmar.c
b/drivers/iommu/intel/dmar.c
index b46dbfa6d0ed691c86a2970dda3c8d04baa35c26..004feaed3c72cf0304b3392f51955143926e7f94 100644
(file)
--- a/
drivers/iommu/intel/dmar.c
+++ b/
drivers/iommu/intel/dmar.c
@@
-1461,8
+1461,8
@@
void qi_flush_piotlb(struct intel_iommu *iommu, u16 did, u32 pasid, u64 addr,
int mask = ilog2(__roundup_pow_of_two(npages));
unsigned long align = (1ULL << (VTD_PAGE_SHIFT + mask));
- if (WARN_ON_ONCE(!
ALIGN
(addr, align)))
- addr
&= ~(align - 1
);
+ if (WARN_ON_ONCE(!
IS_ALIGNED
(addr, align)))
+ addr
= ALIGN_DOWN(addr, align
);
desc.qw0 = QI_EIOTLB_PASID(pasid) |
QI_EIOTLB_DID(did) |