Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / x86 / hyperv / hv_init.c
index 7f2eed1fc81b284f7082ab76086bcdfa45d77dff..6461a16b45594b144f8fe2390fe42973e4fc8725 100644 (file)
@@ -407,6 +407,13 @@ void hyperv_cleanup(void)
        /* Reset our OS id */
        wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0);
 
+       /*
+        * Reset hypercall page reference before reset the page,
+        * let hypercall operations fail safely rather than
+        * panic the kernel for using invalid hypercall page
+        */
+       hv_hypercall_pg = NULL;
+
        /* Reset the hypercall page */
        hypercall_msr.as_uint64 = 0;
        wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);