]> git.ipfire.org Git - thirdparty/linux.git/commit
perf/x86/intel/uncore: Factor out common MMIO init and ops functions
authorKan Liang <kan.liang@linux.intel.com>
Wed, 31 Jul 2024 14:13:50 +0000 (07:13 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 5 Aug 2024 14:54:46 +0000 (16:54 +0200)
commitefb0c9c0b9f78d964fb23ec6fdebe5a493f477f3
tree3710b45d94efa89388090897c1c838188ee536b3
parente0f49f15f6344ef3eeb0a04a8b5dedde2a454136
perf/x86/intel/uncore: Factor out common MMIO init and ops functions

Some uncore PMON registers are located in the MMIO space. For the client
machine, the MMIO space is usually located at D0:F0 but in a different
BAR. For example, some uncore PMON registers are located in the SAF BAR,
not the MCHBAR in the Lunar Lake.

The current __uncore_imc_init_box() hard code the BAR information.
Factor out the uncore_get_box_mmio_addr() which uses the BAR information
as a parameter.
The only change is the error output message. The hardcode name 'MCHBAR'
is replaced by the offset of a BAR.

Add a new macro, MMIO_UNCORE_COMMON_OPS(), since the MMIO ops functions
are usually the same among different generations.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240731141353.759643-2-kan.liang@linux.intel.com
arch/x86/events/intel/uncore_snb.c