Skip to content

Commit 4d99efb

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Update the virtual command related registers
The VT-d spec Revision 3.3 updated the virtual command registers, virtual command opcode B register, virtual command response register and virtual command capability register (Section 10.4.43, 10.4.44, 10.4.45, 10.4.46). This updates the virtual command interface implementation in the Intel IOMMU driver accordingly. Fixes: 24f27d3 ("iommu/vt-d: Enlightened PASID allocation") Signed-off-by: Lu Baolu <[email protected]> Cc: Ashok Raj <[email protected]> Cc: Sanjay Kumar <[email protected]> Cc: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 452e69b commit 4d99efb

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

drivers/iommu/intel/pasid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
#define VCMD_CMD_ALLOC 0x1
2929
#define VCMD_CMD_FREE 0x2
3030
#define VCMD_VRSP_IP 0x1
31-
#define VCMD_VRSP_SC(e) (((e) >> 1) & 0x3)
31+
#define VCMD_VRSP_SC(e) (((e) & 0xff) >> 1)
3232
#define VCMD_VRSP_SC_SUCCESS 0
33-
#define VCMD_VRSP_SC_NO_PASID_AVAIL 2
34-
#define VCMD_VRSP_SC_INVALID_PASID 2
35-
#define VCMD_VRSP_RESULT_PASID(e) (((e) >> 8) & 0xfffff)
36-
#define VCMD_CMD_OPERAND(e) ((e) << 8)
33+
#define VCMD_VRSP_SC_NO_PASID_AVAIL 16
34+
#define VCMD_VRSP_SC_INVALID_PASID 16
35+
#define VCMD_VRSP_RESULT_PASID(e) (((e) >> 16) & 0xfffff)
36+
#define VCMD_CMD_OPERAND(e) ((e) << 16)
3737
/*
3838
* Domain ID reserved for pasid entries programmed for first-level
3939
* only and pass-through transfer modes.

include/linux/intel-iommu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@
124124
#define DMAR_MTRR_PHYSMASK8_REG 0x208
125125
#define DMAR_MTRR_PHYSBASE9_REG 0x210
126126
#define DMAR_MTRR_PHYSMASK9_REG 0x218
127-
#define DMAR_VCCAP_REG 0xe00 /* Virtual command capability register */
128-
#define DMAR_VCMD_REG 0xe10 /* Virtual command register */
129-
#define DMAR_VCRSP_REG 0xe20 /* Virtual command response register */
127+
#define DMAR_VCCAP_REG 0xe30 /* Virtual command capability register */
128+
#define DMAR_VCMD_REG 0xe00 /* Virtual command register */
129+
#define DMAR_VCRSP_REG 0xe10 /* Virtual command response register */
130130

131131
#define DMAR_IQER_REG_IQEI(reg) FIELD_GET(GENMASK_ULL(3, 0), reg)
132132
#define DMAR_IQER_REG_ITESID(reg) FIELD_GET(GENMASK_ULL(47, 32), reg)

0 commit comments

Comments
 (0)