Index: /trunk/include/VBox/vmm/cpum.h
===================================================================
--- /trunk/include/VBox/vmm/cpum.h	(revision 36638)
+++ /trunk/include/VBox/vmm/cpum.h	(revision 36639)
@@ -181,4 +181,5 @@
 VMMDECL(bool)       CPUMIsGuestR0WriteProtEnabled(PVMCPU pVCpu);
 VMMDECL(bool)       CPUMIsGuestInRealMode(PVMCPU pVCpu);
+VMMDECL(bool)       CPUMIsGuestInRealOrV86Mode(PVMCPU pVCpu);
 VMMDECL(bool)       CPUMIsGuestInProtectedMode(PVMCPU pVCpu);
 VMMDECL(bool)       CPUMIsGuestInPagedProtectedMode(PVMCPU pVCpu);
@@ -197,4 +198,16 @@
 {
     return !(pCtx->cr0 & X86_CR0_PE);
+}
+
+/**
+ * Tests if the guest is running in real or virtual 8086 mode.
+ *
+ * @returns @c true if it is, @c false if not.
+ * @param   pCtx    Current CPU context
+ */
+VMMDECL(bool) CPUMIsGuestInRealOrV86ModeEx(PCPUMCTX pCtx)
+{
+    return !(pCtx->cr0 & X86_CR0_PE)
+        || pCtx->eflags.Bits.u1VM; /** @todo verify that this cannot be set in long mode. */
 }
 
Index: /trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp	(revision 36638)
+++ /trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp	(revision 36639)
@@ -870,5 +870,5 @@
 
             if ((pVCpu->CTX_SUFF(pVM)->cpum.s.aGuestCpuIdStd[1].ecx & X86_CPUID_FEATURE_ECX_MONITOR) != 0)
-                
+
                 *puValue |= MSR_IA32_MISC_ENABLE_MONITOR /* if mwait/monitor available */;
             /** @todo: add more cpuid-controlled features this way. */
@@ -2059,4 +2059,17 @@
 
 /**
+ * Tests if the guest is running in real or virtual 8086 mode.
+ *
+ * @returns @c true if it is, @c false if not.
+ * @param   pVCpu       The virtual CPU handle.
+ */
+VMMDECL(bool) CPUMIsGuestInRealOrV86Mode(PVMCPU pVCpu)
+{
+    return !(pVCpu->cpum.s.Guest.cr0 & X86_CR0_PE)
+        || pVCpu->cpum.s.Guest.eflags.Bits.u1VM; /** @todo verify that this cannot be set in long mode. */
+}
+
+
+/**
  * Tests if the guest is running in protected or not.
  *
Index: /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 36638)
+++ /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 36639)
@@ -544,5 +544,5 @@
         {
             /* Lazy approach: check all pages in the 2 MB range.
-             * The whole range must be ram and unallocated. */ 
+             * The whole range must be ram and unallocated. */
             GCPhys = GCPhysBase;
             unsigned iPage;
