perf, x86: Add hw_watchdog_set_attr() in a sake of nmi-watchdog on P4
authorCyrill Gorcunov <gorcunov@gmail.com>
Thu, 23 Jun 2011 12:49:18 +0000 (16:49 +0400)
committerIngo Molnar <mingo@elte.hu>
Fri, 1 Jul 2011 09:06:34 +0000 (11:06 +0200)
commit1880c4ae182afb5650c5678949ecfe7ff66a724e
tree57306c05aca1e2a2ce5d07e8c29ad76b6b403879
parent0d6412085b7ff58612af52e51ffa864f0df4b8fd
perf, x86: Add hw_watchdog_set_attr() in a sake of nmi-watchdog on P4

Due to restriction and specifics of Netburst PMU we need a separated
event for NMI watchdog. In particular every Netburst event
consumes not just a counter and a config register, but also an
additional ESCR register.

Since ESCR registers are grouped upon counters (i.e. if ESCR is occupied
for some event there is no room for another event to enter until its
released) we need to pick up the "least" used ESCR (or the most available
one) for nmi-watchdog purposes -- so MSR_P4_CRU_ESCR2/3 was chosen.

With this patch nmi-watchdog and perf top should be able to run simultaneously.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Lin Ming <ming.m.lin@intel.com>
CC: Arnaldo Carvalho de Melo <acme@redhat.com>
CC: Frederic Weisbecker <fweisbec@gmail.com>
Tested-and-reviewed-by: Don Zickus <dzickus@redhat.com>
Tested-and-reviewed-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110623124918.GC13050@sun
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/cpu/perf_event_p4.c
kernel/watchdog.c