mirror-linux/arch/x86/kernel/cpu
Jork Loeser 5170a82e89 x86/hyperv: Skip LP/VP creation on kexec
After a kexec the logical processors and virtual processors already
exist in the hypervisor because they were created by the previous
kernel. Attempting to add them again causes either a BUG_ON or
corrupted VP state leading to MCEs in the new kernel.

Add hv_lp_exists() to probe whether an LP is already present by
calling HVCALL_GET_LOGICAL_PROCESSOR_RUN_TIME. When it succeeds the
LP exists and we skip the add-LP and create-VP loops entirely.

Also add hv_call_notify_all_processors_started() which informs the
hypervisor that all processors are online. This is required after
adding LPs (fresh boot) and is a no-op on kexec since we skip that
path.

Co-developed-by: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
Signed-off-by: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
Co-developed-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
Co-developed-by: Mukesh Rathor <mrathor@linux.microsoft.com>
Signed-off-by: Mukesh Rathor <mrathor@linux.microsoft.com>
Signed-off-by: Jork Loeser <jloeser@linux.microsoft.com>
Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
2026-04-22 06:23:25 +00:00
..
mce x86/mce/amd: Filter bogus hardware errors on Zen3 clients 2026-04-05 12:42:22 +02:00
microcode Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mtrr Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
resctrl x86/resctrl: Fix SNC detection 2026-03-04 16:35:09 +01:00
sgx Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
.gitignore
Makefile x86/cpu: Detect FreeBSD Bhyve hypervisor 2025-09-15 14:06:44 +02:00
acrn.c
amd.c - The usual set of cleanups and simplifications all over the tree 2026-02-10 18:43:03 -08:00
amd_cache_disable.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
aperfmperf.c syscore: Pass context data to callbacks 2025-11-14 10:01:52 +01:00
bhyve.c x86/cpu: Detect FreeBSD Bhyve hypervisor 2025-09-15 14:06:44 +02:00
bugs.c x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
bus_lock.c x86/split_lock: Remove dead string when split_lock_detect=fatal 2026-01-04 14:26:02 +01:00
cacheinfo.c x86/cpu/cacheinfo: Simplify cacheinfo_amd_init_llc_id() using _cpuid4_info 2025-09-17 11:22:40 +02:00
centaur.c * VDSO rework and cleanups 2026-02-10 19:34:26 -08:00
common.c x86/cpu: Add comment clarifying CRn pinning 2026-03-23 14:25:53 +01:00
cpu.h x86/tsx: Make tsx_ctrl_state static 2025-10-24 18:24:42 +02:00
cpuid-deps.c * Enable Linear Address Space Separation (LASS) 2025-12-02 14:48:08 -08:00
cpuid_0x2_table.c x86/cpu: Consolidate CPUID leaf 0x2 tables 2025-03-25 10:23:04 +01:00
cyrix.c x86/cpu: Drop vestigial PBE logic in AMD/Hygon/Centaur/Cyrix 2025-12-14 09:57:13 +01:00
debugfs.c x86/cpu: Prefix hexadecimal values with 0x in cpu_debug_show() 2025-02-27 13:26:53 +01:00
feat_ctl.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00
hygon.c x86/cpu: Drop vestigial PBE logic in AMD/Hygon/Centaur/Cyrix 2025-12-14 09:57:13 +01:00
hypervisor.c x86/cpu: Detect FreeBSD Bhyve hypervisor 2025-09-15 14:06:44 +02:00
intel.c x86/cpufeature: Replace X86_FEATURE_SYSENTER32 with X86_FEATURE_SYSFAST32 2026-01-13 16:37:58 -08:00
intel_epb.c syscore: Pass context data to callbacks 2025-11-14 10:01:52 +01:00
match.c x86/cpu: Update x86_match_cpu() to also use cpu-type 2025-03-19 11:17:11 +01:00
mkcapflags.sh x86/cpufeatures: Flip the /proc/cpuinfo appearance logic 2024-06-20 21:04:22 +02:00
mshyperv.c x86/hyperv: Skip LP/VP creation on kexec 2026-04-22 06:23:25 +00:00
perfctr-watchdog.c
powerflags.c
proc.c cpufreq: Allow arch_freq_get_on_cpu to return an error 2025-02-17 18:09:20 +00:00
rdrand.c
scattered.c ARM: 2025-12-05 17:01:20 -08:00
topology.c x86/topo: Add topology_num_nodes_per_package() 2026-03-04 16:35:08 +01:00
topology.h
topology_amd.c x86/cpu/topology: Define AMD64_CPUID_EXT_FEAT MSR 2025-09-17 11:24:33 +02:00
topology_common.c x86/cpu/topology: Make primary thread mask available with SMP=n 2025-10-15 16:46:11 +02:00
topology_ext.c x86/cpu/topology: Add support for the AMD 0x80000026 leaf 2024-03-22 11:22:14 +01:00
transmeta.c
tsx.c x86/tsx: Get the tsx= command line parameter with early_param() 2025-10-24 18:35:17 +02:00
umc.c
umwait.c syscore: Pass context data to callbacks 2025-11-14 10:01:52 +01:00
vmware.c sched: Move clock related paravirt code to kernel/sched 2026-01-12 15:39:14 +01:00
vortex.c
zhaoxin.c x86/cpufeature: Replace X86_FEATURE_SYSENTER32 with X86_FEATURE_SYSFAST32 2026-01-13 16:37:58 -08:00