linux_dsm_epyc7002/arch/x86/events/amd
Xiao Liang 40d4071ce2 perf/x86/amd/power: Do not load AMD power module on !AMD platforms
The AMD power module can be loaded on non AMD platforms, but unload fails
with the following Oops:

 BUG: unable to handle kernel NULL pointer dereference at           (null)
 IP: __list_del_entry_valid+0x29/0x90
 Call Trace:
  perf_pmu_unregister+0x25/0xf0
  amd_power_pmu_exit+0x1c/0xd23 [power]
  SyS_delete_module+0x1a8/0x2b0
  ? exit_to_usermode_loop+0x8f/0xb0
  entry_SYSCALL_64_fastpath+0x20/0x83

Return -ENODEV instead of 0 from the module init function if the CPU does
not match.

Fixes: c7ab62bfbe ("perf/x86/amd/power: Add AMD accumulated power reporting mechanism")
Signed-off-by: Xiao Liang <xiliang@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180122061252.6394-1-xiliang@redhat.com
2018-01-24 13:00:35 +01:00
..
core.c x86/events: Remove last remnants of old filenames 2017-03-01 11:27:26 +01:00
ibs.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
iommu.c x86/events/amd/iommu: Make iommu_pmu const and __initconst 2017-10-19 16:15:47 +02:00
iommu.h x86/events, drivers/amd/iommu: Prepare for multiple IOMMUs support 2017-03-30 09:53:55 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
power.c perf/x86/amd/power: Do not load AMD power module on !AMD platforms 2018-01-24 13:00:35 +01:00
uncore.c perf/x86/amd/uncore: Get correct number of cores sharing last level cache 2017-08-10 12:08:39 +02:00