x86/VPMU: mark context LOADED before registers are loaded
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 11 Jun 2014 08:55:43 +0000 (10:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Jun 2014 08:55:43 +0000 (10:55 +0200)
commit825c466dc85b3bc901935118626fa37403e65b0f
tree6b77a056121a29990d63edc9b91e1db0c5b690ff
parente101ee667b55c8bcb2b4d87123fe82779451be90
x86/VPMU: mark context LOADED before registers are loaded

Because a PMU interrupt may be generated as soon as PMU registers are
loaded (or, more precisely, as soon as HW PMU is "armed") we don't want
to delay marking context as LOADED until after registers are loaded.
Otherwise during interrupt handling VPMU_CONTEXT_LOADED may not be set
and this could be confusing.

(Technically, only SVM needs this change right now since VMX will "arm"
PMU later, during VMRUN when global control register is loaded from
VMCS. However, both AMD and Intel code will require this patch when we
introduce PV VPMU.)

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/svm/vpmu.c
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/arch/x86/hvm/vpmu.c