diff mbox

[kvm-unit-tests,5/9] x86: nVMX: Define VMCS field encoding constants

Message ID 1529711980-32764-6-git-send-email-liran.alon@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liran Alon June 22, 2018, 11:59 p.m. UTC
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 x86/vmx.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox

Patch

diff --git a/x86/vmx.h b/x86/vmx.h
index 50f4afdb6b84..2126df36f0ba 100644
--- a/x86/vmx.h
+++ b/x86/vmx.h
@@ -596,6 +596,21 @@  enum vm_instruction_error_number {
 #define ACTV_ACTIVE		0
 #define ACTV_HLT		1
 
+/*
+ * VMCS field encoding:
+ * Bit 0: High-access
+ * Bits 1-9: Index
+ * Bits 10-12: Type
+ * Bits 13-15: Width
+ * Bits 15-64: Reserved
+ */
+#define VMCS_FIELD_HIGH_SHIFT		(0)
+#define VMCS_FIELD_INDEX_SHIFT		(1)
+#define VMCS_FIELD_TYPE_SHIFT		(10)
+#define VMCS_FIELD_WIDTH_SHIFT		(13)
+#define VMCS_FIELD_RESERVED_SHIFT	(15)
+#define VMCS_FIELD_BIT_SIZE		(BITS_PER_LONG)
+
 extern struct regs regs;
 
 extern union vmx_basic basic;