x86/cacheinfo: Move AMD cache_disable_0/1 handling to separate file
authorAhmed S. Darwish <darwi@linutronix.de>
Mon, 24 Mar 2025 13:33:08 +0000 (14:33 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 09:22:39 +0000 (10:22 +0100)
commit365e960d296ef9f36b20971aa4854ce07817a9bb
tree3ea98ceca767bc1bdc7a2f16f0bf194fa0c343ab
parentc58ed2d4da8dced3fa4505f498bd393f565b471a
x86/cacheinfo: Move AMD cache_disable_0/1 handling to separate file

Parent commit decoupled amd_northbridge out of _cpuid4_info_regs, where
it was merely "parked" there until ci_info_init() can store it in the
private pointer of the <linux/cacheinfo.h> API.

Given that decoupling, move the AMD-specific L3 cache_disable_0/1 sysfs
code from the generic (and already extremely convoluted) x86/cacheinfo
code into its own file.

Compile the file only if CONFIG_AMD_NB and CONFIG_SYSFS are both
enabled, which mirrors the existing logic.

Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250324133324.23458-14-darwi@linutronix.de
arch/x86/kernel/cpu/Makefile
arch/x86/kernel/cpu/amd_cache_disable.c [new file with mode: 0644]
arch/x86/kernel/cpu/cacheinfo.c
arch/x86/kernel/cpu/cpu.h