Drivers: hv: don't do hypercalls when hypercall_page is NULL
Drivers: hv: don't do hypercalls when hypercall_page is NULL

At the very late stage of kexec a driver (which are not being unloaded) can
try to post a message or signal an event. This will crash the kernel as we
already did hv_cleanup() and the hypercall page is NULL.

Move all common (between 32 and 64 bit code) declarations to the beginning
of the do_hypercall() function. Unfortunately we have to write the
!hypercall_page check twice to not mix declarations and code.

Signed-off-by: Vitaly Kuznetsov <282517a3cdaae14e79e6d52f012bddb9ec2b7f0e@redhat.com>
Signed-off-by: K. Y. Srinivasan <bcbf172338421f26297a2592698edf8cc84ecbef@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs