]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/vt-d: Remove unnecessary WARN_ON_ONCE()
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 16 Jan 2020 01:52:36 +0000 (09:52 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 24 Jan 2020 14:36:27 +0000 (15:36 +0100)
commitad1616058a4466f03ed141839405959b7c63c950
treefd668324161acf08279b99b80b6ae264f7ecc222
parent2a19b65df5bfce4a2a0b58a30cca6cf951a50f53
iommu/vt-d: Remove unnecessary WARN_ON_ONCE()

Address field in device TLB invalidation descriptor is qualified
by the S field. If S field is zero, a single page at page address
specified by address [63:12] is requested to be invalidated. If S
field is set, the least significant bit in the address field with
value 0b (say bit N) indicates the invalidation address range. The
spec doesn't require the address [N - 1, 0] to be cleared, hence
remove the unnecessary WARN_ON_ONCE().

Otherwise, the caller might set "mask = MAX_AGAW_PFN_WIDTH" in order
to invalidating all the cached mappings on an endpoint, and below
overflow error will be triggered.

[...]
UBSAN: Undefined behaviour in drivers/iommu/dmar.c:1354:3
shift exponent 64 is too large for 64-bit type 'long long unsigned int'
[...]

Reported-and-tested-by: Frank <fgndev@posteo.de>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dmar.c