@@ -424,25 +424,6 @@ static void __attribute__((__used__)) syscall_handler(u64 syscall_no)
current->syscall_handler(syscall_no);
}
-static inline int vmx_on()
-{
- bool ret;
- u64 rflags = read_rflags() | X86_EFLAGS_CF | X86_EFLAGS_ZF;
- asm volatile ("push %1; popf; vmxon %2; setbe %0\n\t"
- : "=q" (ret) : "q" (rflags), "m" (vmxon_region) : "cc");
- return ret;
-}
-
-static inline int vmx_off()
-{
- bool ret;
- u64 rflags = read_rflags() | X86_EFLAGS_CF | X86_EFLAGS_ZF;
-
- asm volatile("push %1; popf; vmxoff; setbe %0\n\t"
- : "=q"(ret) : "q" (rflags) : "cc");
- return ret;
-}
-
static const char * const exit_reason_descriptions[] = {
[VMX_EXC_NMI] = "VMX_EXC_NMI",
[VMX_EXTINT] = "VMX_EXTINT",
@@ -585,10 +585,31 @@ extern union vmx_ctrl_msr ctrl_exit_rev;
extern union vmx_ctrl_msr ctrl_enter_rev;
extern union vmx_ept_vpid ept_vpid;
+extern u64 *vmxon_region;
+
void vmx_set_test_stage(u32 s);
u32 vmx_get_test_stage(void);
void vmx_inc_test_stage(void);
+static int vmx_on(void)
+{
+ bool ret;
+ u64 rflags = read_rflags() | X86_EFLAGS_CF | X86_EFLAGS_ZF;
+ asm volatile ("push %1; popf; vmxon %2; setbe %0\n\t"
+ : "=q" (ret) : "q" (rflags), "m" (vmxon_region) : "cc");
+ return ret;
+}
+
+static int vmx_off(void)
+{
+ bool ret;
+ u64 rflags = read_rflags() | X86_EFLAGS_CF | X86_EFLAGS_ZF;
+
+ asm volatile("push %1; popf; vmxoff; setbe %0\n\t"
+ : "=q"(ret) : "q" (rflags) : "cc");
+ return ret;
+}
+
static inline int make_vmcs_current(struct vmcs *vmcs)
{
bool ret;
Make these functions available to callers outside of vmx.c Signed-off-by: Jim Mattson <jmattson@google.com> --- x86/vmx.c | 19 ------------------- x86/vmx.h | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 19 deletions(-)