• Lu Baolu's avatar
    iommu/vt-d: Remove unnecessary WARN_ON_ONCE() · 857f0814
    Lu Baolu authored
    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: default avatarFrank <fgndev@posteo.de>
    Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    857f0814
dmar.c 55.5 KB