svn commit: r303886 - head/sys/x86/iommu
John Baldwin
jhb at FreeBSD.org
Tue Aug 9 19:02:15 UTC 2016
Author: jhb
Date: Tue Aug 9 19:02:14 2016
New Revision: 303886
URL: https://svnweb.freebsd.org/changeset/base/303886
Log:
Add additional constants.
- Add constants for the fields in the root-entry table address register,
namely the root type type (RTT) and root table address (RTA) mask.
- Add macros for the bitmask of the domain ID field in the second word
of context table entries as well as a helper macro (DMAR_CTX2_GET_DID)
to extract the domain ID from a context table entry.
Reviewed by: kib
MFC after: 1 month
Sponsored by: Chelsio Communications
Modified:
head/sys/x86/iommu/intel_reg.h
Modified: head/sys/x86/iommu/intel_reg.h
==============================================================================
--- head/sys/x86/iommu/intel_reg.h Tue Aug 9 18:59:16 2016 (r303885)
+++ head/sys/x86/iommu/intel_reg.h Tue Aug 9 19:02:14 2016 (r303886)
@@ -67,7 +67,9 @@ typedef struct dmar_ctx_entry {
#define DMAR_CTX2_AW_4LVL 2 /* 4-level page tables */
#define DMAR_CTX2_AW_5LVL 3 /* 5-level page tables */
#define DMAR_CTX2_AW_6LVL 4 /* 6-level page tables */
+#define DMAR_CTX2_DID_MASK 0xffff0
#define DMAR_CTX2_DID(x) ((x) << 8) /* Domain Identifier */
+#define DMAR_CTX2_GET_DID(ctx2) (((ctx2) & DMAR_CTX2_DID_MASK) >> 8)
typedef struct dmar_pte {
uint64_t pte;
@@ -214,6 +216,8 @@ typedef struct dmar_irte {
/* Root-Entry Table Address register */
#define DMAR_RTADDR_REG 0x20
+#define DMAR_RTADDR_RTT (1 << 11) /* Root Table Type */
+#define DMAR_RTADDR_RTA_MASK 0xfffffffffffff000
/* Context Command register */
#define DMAR_CCMD_REG 0x28
More information about the svn-src-head
mailing list