On 09/21/2015 10:36 AM, Jan Beulich wrote:
On 04.09.15 at 14:08, <roger....@citrix.com> wrote:
Hmm - this seems questionable to me: Isn't the vPMU an optional
feature anyway? I.e. doesn't need separate handling here? Boris?
It is optional system-wise, not per-guest, which is what I think Roger
is trying to do. I in fact wanted to add ability to disable VPMU per
guest myself.
However, VPMU has nothing to do with device model so I don't think it
should be part of this series from that perspective.
-boris
Jan
Signed-off-by: Roger Pau Monné <roger....@citrix.com>
Acked-by: Andrew Cooper <andrew.coop...@citrix.com>
Cc: Jan Beulich <jbeul...@suse.com>
Cc: Andrew Cooper <andrew.coop...@citrix.com>
---
Changes since v4:
- Add Andrew Cooper Acked-by.
---
xen/arch/x86/cpu/vpmu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 8af3df1..d5bb77d 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -439,6 +439,9 @@ void vpmu_initialise(struct vcpu *v)
int ret;
bool_t is_priv_vpmu = is_hardware_domain(v->domain);
+ if ( !has_vpmu(v->domain) )
+ return;
+
BUILD_BUG_ON(sizeof(struct xen_pmu_intel_ctxt) > XENPMU_CTXT_PAD_SZ);
BUILD_BUG_ON(sizeof(struct xen_pmu_amd_ctxt) > XENPMU_CTXT_PAD_SZ);
BUILD_BUG_ON(sizeof(struct xen_pmu_regs) > XENPMU_REGS_PAD_SZ);
--
1.9.5 (Apple Git-50.3)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel