[PATCH 16/22] KVM: nVMX: Add VMCS field type enumeration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No functionality change.

Signed-off-by: Liran Alon <liran.alon@xxxxxxxxxx>
Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
 arch/x86/kvm/vmx.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 3327bd7fe81f..162e9517faa8 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -4510,9 +4510,21 @@ static inline int vmcs_field_width(unsigned long field)
 	return (field >> 13) & 0x3 ;
 }
 
+enum vmcs_field_type {
+	VMCS_FIELD_TYPE_CONTROL = 0,
+	VMCS_FIELD_TYPE_READ_ONLY_DATA = 1,
+	VMCS_FIELD_TYPE_GUEST = 2,
+	VMCS_FIELD_TYPE_HOST = 3
+};
+
+static inline int vmcs_field_type(unsigned long field)
+{
+	return (field >> 10) & 0x3;
+}
+
 static inline int vmcs_field_readonly(unsigned long field)
 {
-	return (((field >> 10) & 0x3) == 1);
+	return (vmcs_field_type(field) == VMCS_FIELD_TYPE_READ_ONLY_DATA);
 }
 
 static void init_vmcs_shadow_fields(void)
-- 
1.9.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux