diff --git a/xen/arch/x86/hvm/vmx/vpmu.c b/xen/arch/x86/hvm/vmx/vpmu.c index d9f1509754..2d457d3b73 100644 --- a/xen/arch/x86/hvm/vmx/vpmu.c +++ b/xen/arch/x86/hvm/vmx/vpmu.c @@ -31,6 +31,9 @@ #include #include +static int __read_mostly opt_vpmu_enabled; +boolean_param("vpmu", opt_vpmu_enabled); + int vpmu_do_wrmsr(struct cpu_user_regs *regs) { struct vpmu_struct *vpmu = vcpu_vpmu(current); @@ -79,6 +82,9 @@ void vpmu_initialise(struct vcpu *v) { struct vpmu_struct *vpmu = vcpu_vpmu(v); + if ( !opt_vpmu_enabled ) + return; + if ( vpmu->flags & VPMU_CONTEXT_ALLOCATED ) vpmu_destroy(v);