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

[PATCH 2/5] x86/svm: Move svm_intercept_msr() into svm.h



The single user of svm_intercept_msr() outside of the main svm logic is in
vpmu_amd.c.  Currently the declaration is picked up transitively through
xen/sched.h, so include asm/hvm/svm.h explicitly.

Sort the headers while doing so.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/cpu/vpmu_amd.c             | 5 ++++-
 xen/arch/x86/include/asm/hvm/svm.h      | 8 ++++++++
 xen/arch/x86/include/asm/hvm/svm/vmcb.h | 8 --------
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index a6117dfebf2a..fa157d45dd01 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -13,10 +13,13 @@
 #include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/xenoprof.h>
+
 #include <asm/apic.h>
-#include <asm/vpmu.h>
 #include <asm/hvm/save.h>
+#include <asm/hvm/svm.h>
 #include <asm/hvm/vlapic.h>
+#include <asm/vpmu.h>
+
 #include <public/pmu.h>
 
 #define MSR_F10H_EVNTSEL_GO_SHIFT   40
diff --git a/xen/arch/x86/include/asm/hvm/svm.h 
b/xen/arch/x86/include/asm/hvm/svm.h
index 4eeeb25da90c..a6d7e4aed3b1 100644
--- a/xen/arch/x86/include/asm/hvm/svm.h
+++ b/xen/arch/x86/include/asm/hvm/svm.h
@@ -57,4 +57,12 @@ static inline bool cpu_has_svm_feature(unsigned int feat)
 #define cpu_has_svm_sss       cpu_has_svm_feature(SVM_FEATURE_SSS)
 #define cpu_has_svm_spec_ctrl cpu_has_svm_feature(SVM_FEATURE_SPEC_CTRL)
 
+#define MSR_INTERCEPT_NONE    0
+#define MSR_INTERCEPT_READ    1
+#define MSR_INTERCEPT_WRITE   2
+#define MSR_INTERCEPT_RW      (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ)
+void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags);
+#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 
MSR_INTERCEPT_NONE)
+#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 
MSR_INTERCEPT_RW)
+
 #endif /* __ASM_X86_HVM_SVM_H__ */
diff --git a/xen/arch/x86/include/asm/hvm/svm/vmcb.h 
b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
index 41bcc9f0d862..d1e200df564c 100644
--- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h
+++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
@@ -42,14 +42,6 @@ struct svm_vcpu {
     uint64_t guest_sysenter_eip;
 };
 
-#define MSR_INTERCEPT_NONE    0
-#define MSR_INTERCEPT_READ    1
-#define MSR_INTERCEPT_WRITE   2
-#define MSR_INTERCEPT_RW      (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ)
-void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags);
-#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 
MSR_INTERCEPT_NONE)
-#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 
MSR_INTERCEPT_RW)
-
 #endif /* ASM_X86_HVM_SVM_VMCS_H__ */
 
 /*
-- 
2.39.5




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.