Skip to content

Commit eb58c40

Browse files
Jacob Pangregkh
authored andcommitted
iommu/vt-d: Add definitions for PFSID
commit 0f72556 upstream. When SRIOV VF device IOTLB is invalidated, we need to provide the PF source ID such that IOMMU hardware can gauge the depth of invalidation queue which is shared among VFs. This is needed when device invalidation throttle (DIT) capability is supported. This patch adds bit definitions for checking and tracking PFSID. Signed-off-by: Jacob Pan <[email protected]> Cc: [email protected] Cc: "Ashok Raj" <[email protected]> Cc: "Lu Baolu" <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7cf82f3 commit eb58c40

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ struct device_domain_info {
422422
struct list_head global; /* link to global list */
423423
u8 bus; /* PCI bus number */
424424
u8 devfn; /* PCI devfn number */
425+
u16 pfsid; /* SRIOV physical function source ID */
425426
u8 pasid_supported:3;
426427
u8 pasid_enabled:1;
427428
u8 pri_supported:1;

include/linux/intel-iommu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
* Extended Capability Register
113113
*/
114114

115+
#define ecap_dit(e) ((e >> 41) & 0x1)
115116
#define ecap_pasid(e) ((e >> 40) & 0x1)
116117
#define ecap_pss(e) ((e >> 35) & 0x1f)
117118
#define ecap_eafs(e) ((e >> 34) & 0x1)
@@ -281,6 +282,7 @@ enum {
281282
#define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32)
282283
#define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16)
283284
#define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK)
285+
#define QI_DEV_IOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xfff) << 52))
284286
#define QI_DEV_IOTLB_SIZE 1
285287
#define QI_DEV_IOTLB_MAX_INVS 32
286288

@@ -305,6 +307,7 @@ enum {
305307
#define QI_DEV_EIOTLB_PASID(p) (((u64)p) << 32)
306308
#define QI_DEV_EIOTLB_SID(sid) ((u64)((sid) & 0xffff) << 16)
307309
#define QI_DEV_EIOTLB_QDEP(qd) ((u64)((qd) & 0x1f) << 4)
310+
#define QI_DEV_EIOTLB_PFSID(pfsid) (((u64)(pfsid & 0xf) << 12) | ((u64)(pfsid & 0xfff) << 52))
308311
#define QI_DEV_EIOTLB_MAX_INVS 32
309312

310313
#define QI_PGRP_IDX(idx) (((u64)(idx)) << 55)

0 commit comments

Comments
 (0)