[PATCH kvm-unit-tests 4/9] x86: nVMX: Introduce utils to set/clear bits on a VMCS field

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

 



Signed-off-by: Liran Alon <liran.alon@xxxxxxxxxx>
Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
 x86/vmx.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/x86/vmx.h b/x86/vmx.h
index c035420d7ce2..50f4afdb6b84 100644
--- a/x86/vmx.h
+++ b/x86/vmx.h
@@ -684,6 +684,16 @@ static inline int vmcs_write(enum Encoding enc, u64 val)
 	return ret;
 }
 
+static inline int vmcs_set_bits(enum Encoding enc, u64 val)
+{
+	return vmcs_write(enc, vmcs_read(enc) | val);
+}
+
+static inline int vmcs_clear_bits(enum Encoding enc, u64 val)
+{
+	return vmcs_write(enc, vmcs_read(enc) & ~val);
+}
+
 static inline int vmcs_save(struct vmcs **vmcs)
 {
 	bool ret;
-- 
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