x86/cacheinfo: Switch cache_ap_init() to hotplug callback
authorJuergen Gross <jgross@suse.com>
Wed, 2 Nov 2022 07:47:11 +0000 (08:47 +0100)
committerBorislav Petkov <bp@suse.de>
Thu, 10 Nov 2022 12:12:45 +0000 (13:12 +0100)
commit30f89e524becdbaa483b34902b079c9d4dfaa4a3
tree298cfde91b69aa719bf292b211d4a7fe6718f970
parentadfe7512e1d0b2e83215b0ec56337d2df9f1032d
x86/cacheinfo: Switch cache_ap_init() to hotplug callback

Instead of explicitly calling cache_ap_init() in
identify_secondary_cpu() use a CPU hotplug callback instead. By
registering the callback only after having started the non-boot CPUs
and initializing cache_aps_delayed_init with "true", calling
set_cache_aps_delayed_init() at boot time can be dropped.

It should be noted that this change results in cache_ap_init() being
called a little bit later when hotplugging CPUs. By using a new
hotplug slot right at the start of the low level bringup this is not
problematic, as no operations requiring a specific caching mode are
performed that early in CPU initialization.

Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20221102074713.21493-15-jgross@suse.com
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/include/asm/cacheinfo.h
arch/x86/kernel/cpu/cacheinfo.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/smpboot.c
include/linux/cpuhotplug.h