linux_dsm_epyc7002/drivers/hv
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
..
channel_mgmt.c hyperv-fixes for 5.9-rc6 2020-09-15 16:20:43 -07:00
channel.c Drivers: hv: vmbus: Move virt_to_hvpfn() to hyperv header 2020-09-28 08:55:13 +00:00
connection.c Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels 2020-04-23 13:17:11 +00:00
hv_balloon.c hyperv-fixes for 5.10-rc3 2020-11-05 11:32:03 -08:00
hv_debugfs.c hv_debugfs: Make hv_debug_root static 2020-04-04 17:47:43 +01:00
hv_fcopy.c hv_utils: Always execute the fcopy and vss callbacks in a tasklet 2020-04-23 13:17:11 +00:00
hv_kvp.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hv_snapshot.c hv_utils: Always execute the fcopy and vss callbacks in a tasklet 2020-04-23 13:17:11 +00:00
hv_trace_balloon.h
hv_trace.c
hv_trace.h hyperv-next for 5.8 2020-06-03 15:00:05 -07:00
hv_util.c hyperv-next for 5.10 2020-10-14 10:32:10 -07:00
hv_utils_transport.c
hv_utils_transport.h
hv.c hyperv-fixes for 5.10-rc5 2020-11-16 15:02:33 -08:00
hyperv_vmbus.h Drivers: hv: vmbus: Resolve more races involving init_vp_index() 2020-05-23 09:07:00 +00:00
Kconfig
Makefile drivers: hv: vmbus: Introduce latency testing 2019-11-21 20:10:44 -05:00
ring_buffer.c drivers: hv: vmbus: Introduce latency testing 2019-11-21 20:10:44 -05:00
vmbus_drv.c x86/hyperv: Fix kexec panic/hang issues 2021-01-27 11:54:57 +01:00