From 0c3f24645b07b875bc1294fb4627f01e030690fe Mon Sep 17 00:00:00 2001 From: Boris Ostrovsky Date: Tue, 24 Nov 2015 18:33:08 +0100 Subject: [PATCH] x86/VPMU: Initialize VPMU's lvtpc vector If a guest sets up performance counters so that they can generate a PMC interrupt but does not initilaize APIC LVTPC register the resulting interrupt will cause an APIC error. Note that a guest deciding to clear LVTPC in order to unduce the error will not be successful in achieving its goal: emulation code only looks at the mask bit and always sets the vector to PMU_APIC_VECTOR. Only the initial value of LVTPC (which is zero) that gets loaded into APIC as result of PMC initialization is the problem. Signed-off-by: Boris Ostrovsky --- xen/arch/x86/cpu/vpmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c index 2f5156a7a0..d870dccf1b 100644 --- a/xen/arch/x86/cpu/vpmu.c +++ b/xen/arch/x86/cpu/vpmu.c @@ -480,6 +480,8 @@ void vpmu_initialise(struct vcpu *v) return; /* Don't bother restoring vpmu_count, VPMU is off forever */ } + vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED; + if ( ret ) printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v); -- 2.30.2