diff --git a/arch/x86/events/amd/brs.c b/arch/x86/events/amd/brs.c index 895c82165d85def2e003875240387bc251a2fbf9..4137213dff469860380afe975954b3986e4f6bcb 100644 --- a/arch/x86/events/amd/brs.c +++ b/arch/x86/events/amd/brs.c @@ -12,6 +12,7 @@ #include #include "../perf_event.h" +#include #define BRS_POISON 0xFFFFFFFFFFFFFFFEULL /* mark limit of valid entries */ diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index c3d1d1c0799ee338a4addf544a84c93fc5261e14..3032ceb3923248f76daa8cc1cb3f51804e841232 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "../perf_event.h" diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h index c8fa0c9814355a3b146789d448df0070b40f9516..ec11561457dc01074a762df9a056693f17553b65 100644 --- a/arch/x86/include/asm/perf_event.h +++ b/arch/x86/include/asm/perf_event.h @@ -2,7 +2,6 @@ #ifndef _ASM_X86_PERF_EVENT_H #define _ASM_X86_PERF_EVENT_H -#include /* * Performance event hw details: @@ -554,27 +553,6 @@ static inline void intel_pt_handle_vmx(int on) #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_AMD) extern void amd_pmu_enable_virt(void); extern void amd_pmu_disable_virt(void); - -#if defined(CONFIG_PERF_EVENTS_AMD_BRS) - -#define PERF_NEEDS_LOPWR_CB 1 - -/* - * architectural low power callback impacts - * drivers/acpi/processor_idle.c - * drivers/acpi/acpi_pad.c - */ -extern void perf_amd_brs_lopwr_cb(bool lopwr_in); - -DECLARE_STATIC_CALL(perf_lopwr_cb, perf_amd_brs_lopwr_cb); - -static inline void perf_lopwr_cb(bool lopwr_in) -{ - static_call_mod(perf_lopwr_cb)(lopwr_in); -} - -#endif /* PERF_NEEDS_LOPWR_CB */ - #else static inline void amd_pmu_enable_virt(void) { } static inline void amd_pmu_disable_virt(void) { } diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 4472f7355abfd4931e08c440d5acfdc4b8f2756b..c9aec6967365ebe1292ac1fc17ffca45560df19f 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 12c05e9699e8c7bdf0be6410d22fb3549d983027..6ab492934a6ff188b75e04504252a960f33518a0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -21,6 +21,7 @@ #include #include #include +#include #include /* diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index f0a55bc3f3d7cef8eb0bc90b1a99362708584342..39b391d6469ac1e5fc70773c48e3f900d404455e 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -1626,11 +1626,4 @@ extern void __weak arch_perf_update_userpage(struct perf_event *event, struct perf_event_mmap_page *userpg, u64 now); - -#ifndef PERF_NEEDS_LOPWR_CB -static inline void perf_lopwr_cb(bool mode) -{ -} -#endif - #endif /* _LINUX_PERF_EVENT_H */ diff --git a/include/linux/perf_event_lopwr.h b/include/linux/perf_event_lopwr.h new file mode 100644 index 0000000000000000000000000000000000000000..d21ef9ad3b1e80e2283183d075cc6e5f45d4e4eb --- /dev/null +++ b/include/linux/perf_event_lopwr.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _PERF_EVENT_LOPWR_H +#define _PERF_EVENT_LOPWR_H + +#include + +#if defined(CONFIG_PERF_EVENTS_AMD_BRS) +#define PERF_NEEDS_LOPWR_CB 1 +/* + * architectural low power callback impacts + * drivers/acpi/processor_idle.c + * drivers/acpi/acpi_pad.c + */ +extern void perf_amd_brs_lopwr_cb(bool lopwr_in); + +DECLARE_STATIC_CALL(perf_lopwr_cb, perf_amd_brs_lopwr_cb); + +static inline void perf_lopwr_cb(bool lopwr_in) +{ + static_call_mod(perf_lopwr_cb)(lopwr_in); +} + +#endif /* PERF_NEEDS_LOPWR_CB */ + +#ifndef PERF_NEEDS_LOPWR_CB +static inline void perf_lopwr_cb(bool mode) +{ +} +#endif + +#endif /*_PERF_EVENT_LOPWR_H*/