Skip to content

Commit 1ff0027

Browse files
Jacob Panjoergroedel
authored andcommitted
iommu/vt-d: Warn on out-of-range invalidation address
For guest requested IOTLB invalidation, address and mask are provided as part of the invalidation data. VT-d HW silently ignores any address bits below the mask. SW shall also allow such case but give warning if address does not align with the mask. This patch relax the fault handling from error to warning and proceed with invalidation request with the given mask. Fixes: 6ee1b77 ("iommu/vt-d: Add svm/sva invalidate function") Signed-off-by: Jacob Pan <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Eric Auger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 0fa1a15 commit 1ff0027

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5447,13 +5447,12 @@ intel_iommu_sva_invalidate(struct iommu_domain *domain, struct device *dev,
54475447

54485448
switch (BIT(cache_type)) {
54495449
case IOMMU_CACHE_INV_TYPE_IOTLB:
5450+
/* HW will ignore LSB bits based on address mask */
54505451
if (inv_info->granularity == IOMMU_INV_GRANU_ADDR &&
54515452
size &&
54525453
(inv_info->addr_info.addr & ((BIT(VTD_PAGE_SHIFT + size)) - 1))) {
5453-
pr_err_ratelimited("Address out of range, 0x%llx, size order %llu\n",
5454+
pr_err_ratelimited("User address not aligned, 0x%llx, size order %llu\n",
54545455
inv_info->addr_info.addr, size);
5455-
ret = -ERANGE;
5456-
goto out_unlock;
54575456
}
54585457

54595458
/*

0 commit comments

Comments
 (0)