Skip to content

Commit 4e7120d

Browse files
eaugerjoergroedel
authored andcommitted
iommu/vt-d: Fix QI_DEV_IOTLB_PFSID and QI_DEV_EIOTLB_PFSID macros
For both PASID-based-Device-TLB Invalidate Descriptor and Device-TLB Invalidate Descriptor, the Physical Function Source-ID value is split according to this layout: PFSID[3:0] is set at offset 12 and PFSID[15:4] is put at offset 52. Fix the part laid out at offset 52. Fixes: 0f72556 ("iommu/vt-d: Add definitions for PFSID") Signed-off-by: Eric Auger <[email protected]> Acked-by: Jacob Pan <[email protected]> Cc: [email protected] # v4.19+ Acked-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 9059f3c commit 4e7120d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/linux/intel-iommu.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ enum {
336336
#define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32)
337337
#define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16)
338338
#define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK)
339-
#define QI_DEV_IOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xfff) << 52))
339+
#define QI_DEV_IOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | \
340+
((u64)((pfsid >> 4) & 0xfff) << 52))
340341
#define QI_DEV_IOTLB_SIZE 1
341342
#define QI_DEV_IOTLB_MAX_INVS 32
342343

@@ -360,7 +361,8 @@ enum {
360361
#define QI_DEV_EIOTLB_PASID(p) (((u64)p) << 32)
361362
#define QI_DEV_EIOTLB_SID(sid) ((u64)((sid) & 0xffff) << 16)
362363
#define QI_DEV_EIOTLB_QDEP(qd) ((u64)((qd) & 0x1f) << 4)
363-
#define QI_DEV_EIOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xfff) << 52))
364+
#define QI_DEV_EIOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | \
365+
((u64)((pfsid >> 4) & 0xfff) << 52))
364366
#define QI_DEV_EIOTLB_MAX_INVS 32
365367

366368
/* Page group response descriptor QW0 */

0 commit comments

Comments
 (0)