]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Drivers: hv: vmbus: add special kexec handler
authorVitaly Kuznetsov <vkuznets@redhat.com>
Sat, 1 Aug 2015 23:08:07 +0000 (16:08 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 26 Feb 2016 02:28:58 +0000 (18:28 -0800)
commit687e2cfccc3bd6722ddd7cf2953e02132e47a418
tree71ab7a21539d1da29c705b90537ab02e1759e961
parente5f2d42bbea4210f520ebb94df6d9b3b243c5955
Drivers: hv: vmbus: add special kexec handler

When general-purpose kexec (not kdump) is being performed in Hyper-V guest
the newly booted kernel fails with an MCE error coming from the host. It
is the same error which was fixed in the "Drivers: hv: vmbus: Implement
the protocol for tearing down vmbus state" commit - monitor pages remain
special and when they're being written to (as the new kernel doesn't know
these pages are special) bad things happen. We need to perform some
minimalistic cleanup before booting a new kernel on kexec. To do so we
need to register a special machine_ops.shutdown handler to be executed
before the native_machine_shutdown(). Registering a shutdown notification
handler via the register_reboot_notifier() call is not sufficient as it
happens to early for our purposes. machine_ops is not being exported to
modules (and I don't think we want to export it) so let's do this in
mshyperv.c

The minimalistic cleanup consists of cleaning up clockevents, synic MSRs,
guest os id MSR, and hypercall MSR.

Kdump doesn't require all this stuff as it lives in a separate memory
space.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2517281d63a2b09d94aedfb522943617048f337e)

Orabug: 21886720
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
arch/x86/include/asm/mshyperv.h
arch/x86/kernel/cpu/mshyperv.c
drivers/hv/vmbus_drv.c