tmp_suning_uos_patched/arch/x86/hyperv
Dexuan Cui 55807e7cb0 x86/hyperv: Fix kexec panic/hang issues
[ Upstream commit dfe94d4086e40e92b1926bddcefa629b791e9b28 ]

Currently the kexec kernel can panic or hang due to 2 causes:

1) hv_cpu_die() is not called upon kexec, so the hypervisor corrupts the
old VP Assist Pages when the kexec kernel runs. The same issue is fixed
for hibernation in commit 421f090c81 ("x86/hyperv: Suspend/resume the
VP assist page for hibernation"). Now fix it for kexec.

2) hyperv_cleanup() is called too early. In the kexec path, the other CPUs
are stopped in hv_machine_shutdown() -> native_machine_shutdown(), so
between hv_kexec_handler() and native_machine_shutdown(), the other CPUs
can still try to access the hypercall page and cause panic. The workaround
"hv_hypercall_pg = NULL;" in hyperv_cleanup() is unreliabe. Move
hyperv_cleanup() to a better place.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20201222065541.24312-1-decui@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-27 11:54:57 +01:00
..
hv_apic.c x86/hyperv: Clarify comment on x2apic mode 2020-10-26 16:28:06 +00:00
hv_init.c x86/hyperv: Fix kexec panic/hang issues 2021-01-27 11:54:57 +01:00
hv_spinlock.c x86/hyperv: Remove aliases with X64 in their name 2020-09-27 11:34:54 +02:00
Makefile
mmu.c x86/hyperv: check cpu mask after interrupt has been disabled 2021-01-19 18:27:18 +01:00
nested.c