Skip to content

Commit 5f77d6c

Browse files
yiliu1765joergroedel
authored andcommitted
iommu/vt-d: Enforce PASID devTLB field mask
Set proper masks to avoid invalid input spillover to reserved bits. Signed-off-by: Liu Yi L <[email protected]> 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 9ebcfad commit 5f77d6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/intel-iommu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ enum {
381381

382382
#define QI_DEV_EIOTLB_ADDR(a) ((u64)(a) & VTD_PAGE_MASK)
383383
#define QI_DEV_EIOTLB_SIZE (((u64)1) << 11)
384-
#define QI_DEV_EIOTLB_GLOB(g) ((u64)g)
385-
#define QI_DEV_EIOTLB_PASID(p) (((u64)p) << 32)
384+
#define QI_DEV_EIOTLB_GLOB(g) ((u64)(g) & 0x1)
385+
#define QI_DEV_EIOTLB_PASID(p) ((u64)((p) & 0xfffff) << 32)
386386
#define QI_DEV_EIOTLB_SID(sid) ((u64)((sid) & 0xffff) << 16)
387387
#define QI_DEV_EIOTLB_QDEP(qd) ((u64)((qd) & 0x1f) << 4)
388388
#define QI_DEV_EIOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | \

0 commit comments

Comments
 (0)