]> xenbits.xensource.com Git - xen.git/commitdiff
x86/VPMU: disable when NMI watchdog is on
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 3 Feb 2015 10:30:09 +0000 (11:30 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 3 Feb 2015 10:30:09 +0000 (11:30 +0100)
NMI watchdog sets APIC_LVTPC register to generate an NMI when PMU counter
overflow occurs. This may be overwritten by VPMU code later, effectively
turning off the watchdog.

We should disable VPMU when NMI watchdog is running.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
docs/misc/xen-command-line.markdown
xen/arch/x86/hvm/vpmu.c

index 2274e74907630e920c4772c48d65fcea0652fcde..bc316beb0156256ff5120fc2bf500e8e5560a668 100644 (file)
@@ -1346,6 +1346,8 @@ wrong behaviour (see handle\_pmc\_quirk()).
 If 'vpmu=bts' is specified the virtualisation of the Branch Trace Store (BTS)
 feature is switched on on Intel processors supporting this feature.
 
+Note that if **watchdog** option is also specified vpmu will be turned off.
+
 *Warning:*
 As the BTS virtualisation is not 100% safe and because of the nehalem quirk
 don't use the vpmu flag on production systems with Intel cpus!
index 63b215837788f15c1ca2b9c4ed25f9016b5a81f1..b2e8e652a54c1c29959d02e93942f9f9c77e9171 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/regs.h>
 #include <asm/types.h>
 #include <asm/msr.h>
+#include <asm/nmi.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
@@ -288,3 +289,15 @@ void vpmu_dump(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
 }
 
+static int __init vpmu_init(void)
+{
+    /* NMI watchdog uses LVTPC and HW counter */
+    if ( opt_watchdog && opt_vpmu_enabled )
+    {
+        printk(XENLOG_WARNING "NMI watchdog is enabled. Turning VPMU off.\n");
+        opt_vpmu_enabled = 0;
+    }
+
+    return 0;
+}
+__initcall(vpmu_init);