Skip to content

Commit f994548

Browse files
shiqinggacrnsi
authored andcommitted
hv: vtd: fix MACRO typos
ROOT_ENTRY_LOWER_CTP_MASK shall be (0xFFFFFFFFFFFFFUL << ROOT_ENTRY_LOWER_CTP_POS) rather than (0xFFFFFFFFFFFFFUL). Rationale: CTP is bits 63:12 in a root entry according to Chapter 9.1 Root Entry in VT-d spec. Similarly, update ROOT_ENTRY_LOWER_PRESENT_MASK to keep the coding style consistent. CTX_ENTRY_UPPER_DID_MASK shall be (0xFFFFUL << CTX_ENTRY_UPPER_DID_POS) rather than (0x3FUL << CTX_ENTRY_UPPER_DID_POS). Rationale: DID is bits 87:72 in a context entry according to Chapter 9.3 Context Entry in VT-d spec. It takes 16 bits rather than 6 bits. Tracked-On: #3626 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 295701c commit f994548

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hypervisor/arch/x86/vtd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
#define LEVEL_WIDTH 9U
3232

3333
#define ROOT_ENTRY_LOWER_PRESENT_POS (0U)
34-
#define ROOT_ENTRY_LOWER_PRESENT_MASK (1UL)
34+
#define ROOT_ENTRY_LOWER_PRESENT_MASK (1UL << ROOT_ENTRY_LOWER_PRESENT_POS)
3535
#define ROOT_ENTRY_LOWER_CTP_POS (12U)
36-
#define ROOT_ENTRY_LOWER_CTP_MASK (0xFFFFFFFFFFFFFUL)
36+
#define ROOT_ENTRY_LOWER_CTP_MASK (0xFFFFFFFFFFFFFUL << ROOT_ENTRY_LOWER_CTP_POS)
3737

3838
/* 4 iommu fault register state */
3939
#define IOMMU_FAULT_REGISTER_STATE_NUM 4U
@@ -42,7 +42,7 @@
4242
#define CTX_ENTRY_UPPER_AW_POS (0U)
4343
#define CTX_ENTRY_UPPER_AW_MASK (0x7UL << CTX_ENTRY_UPPER_AW_POS)
4444
#define CTX_ENTRY_UPPER_DID_POS (8U)
45-
#define CTX_ENTRY_UPPER_DID_MASK (0x3FUL << CTX_ENTRY_UPPER_DID_POS)
45+
#define CTX_ENTRY_UPPER_DID_MASK (0xFFFFUL << CTX_ENTRY_UPPER_DID_POS)
4646
#define CTX_ENTRY_LOWER_P_POS (0U)
4747
#define CTX_ENTRY_LOWER_P_MASK (0x1UL << CTX_ENTRY_LOWER_P_POS)
4848
#define CTX_ENTRY_LOWER_FPD_POS (1U)

0 commit comments

Comments
 (0)