[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159597947370.12744.8741858978174141331.stgit@bmoger-ubuntu>
Date: Tue, 28 Jul 2020 18:37:53 -0500
From: Babu Moger <babu.moger@....com>
To: pbonzini@...hat.com, vkuznets@...hat.com, wanpengli@...cent.com,
sean.j.christopherson@...el.com, jmattson@...gle.com
Cc: kvm@...r.kernel.org, joro@...tes.org, x86@...nel.org,
linux-kernel@...r.kernel.org, mingo@...hat.com, bp@...en8.de,
hpa@...or.com, tglx@...utronix.de
Subject: [PATCH v3 01/11] KVM: SVM: Introduce __set_intercept,
__clr_intercept and __is_intercept
This is in preparation for the future intercept vector additions.
Add new functions __set_intercept, __clr_intercept and __is_intercept
using kernel APIs __set_bit, __clear_bit and test_bit espectively.
Signed-off-by: Babu Moger <babu.moger@....com>
---
arch/x86/kvm/svm/svm.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
index 6ac4c00a5d82..3b669718190a 100644
--- a/arch/x86/kvm/svm/svm.h
+++ b/arch/x86/kvm/svm/svm.h
@@ -217,6 +217,21 @@ static inline struct vmcb *get_host_vmcb(struct vcpu_svm *svm)
return svm->vmcb;
}
+static inline void __set_intercept(void *addr, int bit)
+{
+ __set_bit(bit, (unsigned long *)addr);
+}
+
+static inline void __clr_intercept(void *addr, int bit)
+{
+ __clear_bit(bit, (unsigned long *)addr);
+}
+
+static inline bool __is_intercept(void *addr, int bit)
+{
+ return test_bit(bit, (unsigned long *)addr);
+}
+
static inline void set_cr_intercept(struct vcpu_svm *svm, int bit)
{
struct vmcb *vmcb = get_host_vmcb(svm);
Powered by blists - more mailing lists