mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
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 <[email protected]> Signed-off-by: Anirudh Rayabharam <[email protected]> Co-developed-by: Stanislav Kinsburskii <[email protected]> Signed-off-by: Stanislav Kinsburskii <[email protected]> Co-developed-by: Mukesh Rathor <[email protected]> Signed-off-by: Mukesh Rathor <[email protected]> Signed-off-by: Jork Loeser <[email protected]> Reviewed-by: Stanislav Kinsburskii <[email protected]> Signed-off-by: Wei Liu <[email protected]>