static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, host_vmcs);
static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
+static DEFINE_PER_CPU(bool_t, vmxon);
static u32 vmcs_revision_id __read_mostly;
printk("CPU%d: unexpected VMXON failure\n", cpu);
return 0;
case 0: /* success */
+ this_cpu(vmxon) = 1;
break;
default:
BUG();
struct list_head *active_vmcs_list = &this_cpu(active_vmcs_list);
unsigned long flags;
+ if ( !this_cpu(vmxon) )
+ return;
+
local_irq_save(flags);
while ( !list_empty(active_vmcs_list) )
struct vcpu, arch.hvm_vmx.active_list));
BUG_ON(!(read_cr4() & X86_CR4_VMXE));
+ this_cpu(vmxon) = 0;
__vmxoff();
local_irq_restore(flags);