Index: /trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp	(revision 58013)
+++ /trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp	(revision 58014)
@@ -124,5 +124,5 @@
      * Verify that hypercalls are enabled.
      */
-    if (!MSR_GIM_HV_HYPERCALL_IS_ENABLED(pVM->gim.s.u.Hv.u64HypercallMsr))
+    if (!gimHvAreHypercallsEnabled(pVCpu))
         return VERR_GIM_HYPERCALLS_NOT_ENABLED;
 
@@ -275,5 +275,5 @@
 VMM_INT_DECL(bool) gimHvAreHypercallsEnabled(PVMCPU pVCpu)
 {
-    return MSR_GIM_HV_HYPERCALL_IS_ENABLED(pVCpu->CTX_SUFF(pVM)->gim.s.u.Hv.u64HypercallMsr);
+    return RT_BOOL(pVCpu->CTX_SUFF(pVM)->gim.s.u.Hv.u64GuestOsIdMsr != 0);
 }
 
@@ -481,10 +481,13 @@
             return VINF_CPUM_R3_MSR_WRITE;
 #else
-            /* Disable the hypercall-page if 0 is written to this MSR. */
+            /* Disable the hypercall-page and hypercalls if 0 is written to this MSR. */
             if (!uRawValue)
             {
-                gimR3HvDisableHypercallPage(pVM);
-                pHv->u64HypercallMsr &= ~MSR_GIM_HV_HYPERCALL_ENABLE_BIT;
-                LogRel(("GIM: HyperV: Hypercalls disabled via Guest OS ID Msr\n"));
+                if (MSR_GIM_HV_HYPERCALL_PAGE_IS_ENABLED(pHv->u64HypercallMsr))
+                {
+                    gimR3HvDisableHypercallPage(pVM);
+                    pHv->u64HypercallMsr &= ~MSR_GIM_HV_HYPERCALL_PAGE_ENABLE_BIT;
+                    LogRel(("GIM: HyperV: Hypercall page disabled via Guest OS ID MSR\n"));
+                }
             }
             else
@@ -510,5 +513,18 @@
                 AssertRC(rc2);
             }
+
             pHv->u64GuestOsIdMsr = uRawValue;
+
+            /*
+             * Notify VMM that hypercalls are now disabled/enabled.
+             */
+            for (VMCPUID i = 0; i < pVM->cCpus; i++)
+            {
+                if (uRawValue)
+                    VMMHypercallsEnable(&pVM->aCpus[i]);
+                else
+                    VMMHypercallsDisable(&pVM->aCpus[i]);
+            }
+
             return VINF_SUCCESS;
 #endif /* IN_RING3 */
@@ -528,11 +544,11 @@
             return VINF_SUCCESS;
 # else
-            /* First, update all but the hypercall enable bit. */
-            pHv->u64HypercallMsr = (uRawValue & ~MSR_GIM_HV_HYPERCALL_ENABLE_BIT);
-
-            /* Hypercalls can only be enabled when the guest has set the Guest-OS Id Msr. */
-            bool fEnable = RT_BOOL(uRawValue & MSR_GIM_HV_HYPERCALL_ENABLE_BIT);
+            /* First, update all but the hypercall page enable bit. */
+            pHv->u64HypercallMsr = (uRawValue & ~MSR_GIM_HV_HYPERCALL_PAGE_ENABLE_BIT);
+
+            /* Hypercall page can only be enabled when the guest has enabled hypercalls. */
+            bool fEnable = RT_BOOL(uRawValue & MSR_GIM_HV_HYPERCALL_PAGE_ENABLE_BIT);
             if (   fEnable
-                && !pHv->u64GuestOsIdMsr)
+                && !gimHvAreHypercallsEnabled(pVCpu))
             {
                 return VINF_SUCCESS;
Index: /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 58013)
+++ /trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp	(revision 58014)
@@ -5165,4 +5165,6 @@
             }
         }
+        else
+            Log4(("hmR0SvmExitVmmCall: Hypercalls not enabled\n"));
     }
 
Index: /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 58013)
+++ /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 58014)
@@ -10162,4 +10162,6 @@
         }
     }
+    else
+        Log4(("hmR0VmxExitVmcall: Hypercalls not enabled\n"));
 
     hmR0VmxSetPendingXcptUD(pVCpu, pMixedCtx);
Index: /trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/GIMHv.cpp	(revision 58013)
+++ /trunk/src/VBox/VMM/VMMR3/GIMHv.cpp	(revision 58014)
@@ -297,15 +297,4 @@
         rc = gimR3HvInitDebugSupport(pVM);
         AssertLogRelRCReturn(rc, rc);
-
-        /*
-         * Pretend that hypercalls are enabled unconditionally when posing as Microsoft,
-         * as Windows guests invoke debug hypercalls before enabling them via the hypercall MSR.
-         */
-        if (pHv->fIsVendorMsHv)
-        {
-            pHv->u64HypercallMsr |= MSR_GIM_HV_HYPERCALL_ENABLE_BIT;
-            for (VMCPUID i = 0; i < pVM->cCpus; i++)
-                VMMHypercallsEnable(&pVM->aCpus[i]);
-        }
     }
 
@@ -442,13 +431,4 @@
     pHv->uCrashP3        = 0;
     pHv->uCrashP4        = 0;
-
-    /* Extra faking required while posing as Microsoft, see gimR3HvInit(). */
-    if (   (pHv->uMiscFeat & GIM_HV_MISC_FEAT_GUEST_DEBUGGING)
-        && pHv->fIsVendorMsHv)
-    {
-        pHv->u64HypercallMsr |= MSR_GIM_HV_HYPERCALL_ENABLE_BIT;
-        for (VMCPUID i = 0; i < pVM->cCpus; i++)
-            VMMHypercallsEnable(&pVM->aCpus[i]);
-    }
 }
 
@@ -596,5 +576,5 @@
                                 pRegion->cbRegion, PAGE_SIZE);
 
-    if (MSR_GIM_HV_HYPERCALL_IS_ENABLED(pHv->u64HypercallMsr))
+    if (MSR_GIM_HV_HYPERCALL_PAGE_IS_ENABLED(pHv->u64HypercallMsr))
     {
         Assert(pRegion->GCPhysPage != NIL_RTGCPHYS);
@@ -805,6 +785,4 @@
         pRegion->fMapped = false;
 #endif
-        for (VMCPUID i = 0; i < pVM->cCpus; i++)
-            VMMHypercallsDisable(&pVM->aCpus[i]);
         LogRel(("GIM: HyperV: Disabled Hypercall-page\n"));
         return VINF_SUCCESS;
@@ -873,5 +851,5 @@
                 VMMHypercallsEnable(&pVM->aCpus[i]);
 
-            LogRel(("GIM: HyperV: Enabled hypercalls at %#RGp\n", GCPhysHypercallPage));
+            LogRel(("GIM: HyperV: Enabled hypercall page at %#RGp\n", GCPhysHypercallPage));
             return VINF_SUCCESS;
         }
@@ -911,13 +889,7 @@
         if (RT_SUCCESS(rc))
         {
-            /*
-             * Notify VMM that hypercalls are now enabled for all VCPUs.
-             */
-            for (VMCPUID i = 0; i < pVM->cCpus; i++)
-                VMMHypercallsEnable(&pVM->aCpus[i]);
-
             pRegion->GCPhysPage = GCPhysHypercallPage;
             pRegion->fMapped = true;
-            LogRel(("GIM: HyperV: Enabled hypercalls at %#RGp\n", GCPhysHypercallPage));
+            LogRel(("GIM: HyperV: Enabled hypercall page at %#RGp\n", GCPhysHypercallPage));
         }
         else
Index: /trunk/src/VBox/VMM/include/GIMHvInternal.h
===================================================================
--- /trunk/src/VBox/VMM/include/GIMHvInternal.h	(revision 58013)
+++ /trunk/src/VBox/VMM/include/GIMHvInternal.h	(revision 58014)
@@ -413,7 +413,7 @@
 #define MSR_GIM_HV_HYPERCALL_GUEST_PFN(a)         ((a) >> 12)
 /** The hypercall enable bit. */
-#define MSR_GIM_HV_HYPERCALL_ENABLE_BIT           RT_BIT_64(0)
+#define MSR_GIM_HV_HYPERCALL_PAGE_ENABLE_BIT      RT_BIT_64(0)
 /** Whether the hypercall-page is enabled or not. */
-#define MSR_GIM_HV_HYPERCALL_IS_ENABLED(a)        RT_BOOL((a) & MSR_GIM_HV_HYPERCALL_ENABLE_BIT)
+#define MSR_GIM_HV_HYPERCALL_PAGE_IS_ENABLED(a)   RT_BOOL((a) & MSR_GIM_HV_HYPERCALL_PAGE_ENABLE_BIT)
 /** @} */
 
