summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/topology.c
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2015-01-13 23:59:53 +0100
committerIngo Molnar <mingo@kernel.org>2015-01-16 09:06:58 +0100
commit433678bdc6ed39f053c55da96b51de5bf0aeebb1 (patch)
tree4f8d1cb9a64d8d4f6b8836099c40d666553ba592 /arch/x86/kernel/cpu/topology.c
parentMerge branch 'thermal-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/r... (diff)
downloadlinux-433678bdc6ed39f053c55da96b51de5bf0aeebb1.tar.xz
linux-433678bdc6ed39f053c55da96b51de5bf0aeebb1.zip
perf/rapl: Fix sysfs_show() initialization for RAPL PMU
This patch fixes a problem with the initialization of the sysfs_show() routine for the RAPL PMU. The current code was wrongly relying on the EVENT_ATTR_STR() macro which uses the events_sysfs_show() function in the x86 PMU code. That function itself was relying on the x86_pmu data structure. Yet RAPL and the core PMU (x86_pmu) have nothing to do with each other. They should therefore not interact with each other. The x86_pmu structure is initialized at boot time based on the host CPU model. When the host CPU is not supported, the x86_pmu remains uninitialized and some of the callbacks it contains are NULL. The false dependency with x86_pmu could potentially cause crashes in case the x86_pmu is not initialized while the RAPL PMU is. This may, for instance, be the case in virtualized environments. This patch fixes the problem by using a private sysfs_show() routine for exporting the RAPL PMU events. Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: http://lkml.kernel.org/r/20150113225953.GA21525@thinkpad Cc: vincent.weaver@maine.edu Cc: jolsa@redhat.com Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/topology.c')
0 files changed, 0 insertions, 0 deletions