Index: trunk/include/VBox/vmm/cpum.h
===================================================================
--- trunk/include/VBox/vmm/cpum.h	(revision 75824)
+++ trunk/include/VBox/vmm/cpum.h	(revision 75830)
@@ -1430,12 +1430,14 @@
 /** @name Nested Hardware-Virtualization Helpers.
  * @{  */
-VMM_INT_DECL(bool)      CPUMCanSvmNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
-VMM_INT_DECL(bool)      CPUMCanSvmNstGstTakeVirtIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
-VMM_INT_DECL(uint8_t)   CPUMGetSvmNstGstInterrupt(PCCPUMCTX pCtx);
+VMM_INT_DECL(bool)      CPUMIsGuestPhysIntrEnabled(PVMCPU pVCpu);
+VMM_INT_DECL(bool)      CPUMIsGuestVirtIntrEnabled(PVMCPU pVCpu);
+VMM_INT_DECL(bool)      CPUMIsGuestSvmPhysIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
+VMM_INT_DECL(bool)      CPUMIsGuestSvmVirtIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
+VMM_INT_DECL(uint8_t)   CPUMGetGuestSvmVirtIntrVector(PCCPUMCTX pCtx);
 VMM_INT_DECL(void)      CPUMSvmVmExitRestoreHostState(PVMCPU pVCpu, PCPUMCTX pCtx);
 VMM_INT_DECL(void)      CPUMSvmVmRunSaveHostState(PCPUMCTX pCtx, uint8_t cbInstr);
 VMM_INT_DECL(uint64_t)  CPUMApplyNestedGuestTscOffset(PVMCPU pVCpu, uint64_t uTicks);
-VMM_INT_DECL(bool)      CPUMCanVmxNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
-VMM_INT_DECL(bool)      CPUMCanVmxNstGstTakeVirtIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
+VMM_INT_DECL(bool)      CPUMIsGuestVmxPhysIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
+VMM_INT_DECL(bool)      CPUMIsGuestVmxVirtIntrEnabled(PVMCPU pVCpu, PCCPUMCTX pCtx);
 /** @} */
 
@@ -1628,8 +1630,30 @@
 
 /**
+ * Returns the guest's global-interrupt (GIF) flag.
+ *
+ * @returns true when global-interrupts are enabled, otherwise false.
+ * @param   pCtx    Current CPU context.
+ */
+DECLINLINE(bool) CPUMGetGuestGif(PCCPUMCTX pCtx)
+{
+    return pCtx->hwvirt.fGif;
+}
+
+/**
+ * Sets the guest's global-interrupt flag (GIF).
+ *
+ * @param   pCtx    Current CPU context.
+ * @param   fGif    The value to set.
+ */
+DECLINLINE(void) CPUMSetGuestGif(PCPUMCTX pCtx, bool fGif)
+{
+    pCtx->hwvirt.fGif = fGif;
+}
+
+/**
  * Checks if we are executing inside an SVM nested hardware-virtualized guest.
  *
  * @returns @c true if in SVM nested-guest mode, @c false otherwise.
- * @param   pCtx        Pointer to the context.
+ * @param   pCtx    Current CPU context.
  */
 DECLINLINE(bool) CPUMIsGuestInSvmNestedHwVirtMode(PCCPUMCTX pCtx)
@@ -1667,4 +1691,16 @@
     return false;
 #endif
+}
+
+/**
+ * Checks if we are executing inside an SVM or VMX nested hardware-virtualized
+ * guest.
+ *
+ * @returns @c true if in nested-guest mode, @c false otherwise.
+ * @param   pCtx    Current CPU context.
+ */
+DECLINLINE(bool) CPUMIsGuestInNestedHwvirtMode(PCCPUMCTX pCtx)
+{
+    return CPUMIsGuestInVmxNonRootMode(pCtx) || CPUMIsGuestInSvmNestedHwVirtMode(pCtx);
 }
 
@@ -2133,6 +2169,7 @@
     CPUMINTERRUPTIBILITY_INVALID = 0,
     CPUMINTERRUPTIBILITY_UNRESTRAINED,
+    CPUMINTERRUPTIBILITY_VIRT_INT_DISABLED,
+    CPUMINTERRUPTIBILITY_INT_DISABLED,
     CPUMINTERRUPTIBILITY_INT_INHIBITED,
-    CPUMINTERRUPTIBILITY_INT_DISABLED,
     CPUMINTERRUPTIBILITY_NMI_INHIBIT,
     CPUMINTERRUPTIBILITY_GLOBAL_INHIBIT,
Index: trunk/include/VBox/vmm/trpm.h
===================================================================
--- trunk/include/VBox/vmm/trpm.h	(revision 75824)
+++ trunk/include/VBox/vmm/trpm.h	(revision 75830)
@@ -101,5 +101,5 @@
 VMMR3DECL(void)     TRPMR3Reset(PVM pVM);
 VMMR3DECL(int)      TRPMR3Term(PVM pVM);
-VMMR3DECL(int)      TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent);
+VMMR3DECL(int)      TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent, bool *pfInjected);
 # ifdef VBOX_WITH_RAW_MODE
 VMMR3_INT_DECL(int) TRPMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
Index: trunk/include/VBox/vmm/vm.h
===================================================================
--- trunk/include/VBox/vmm/vm.h	(revision 75824)
+++ trunk/include/VBox/vmm/vm.h	(revision 75830)
@@ -366,5 +366,5 @@
  *
  * Available VMCPU bits:
- *      11, 14, 15, 35 to 63
+ *      14, 15, 34 to 63
  *
  * @todo If we run low on VMCPU, we may consider merging the SELM bits
@@ -473,4 +473,7 @@
 /** This action forces the VM to service any pending updates to CR3 (used only
  *  by HM). */
+/** Hardware virtualized nested-guest interrupt pending. */
+#define VMCPU_FF_INTERRUPT_NESTED_GUEST     RT_BIT_64(VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT)
+#define VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT 11
 #define VMCPU_FF_HM_UPDATE_CR3              RT_BIT_64(VMCPU_FF_HM_UPDATE_CR3_BIT)
 #define VMCPU_FF_HM_UPDATE_CR3_BIT          12
@@ -541,16 +544,13 @@
 # define VMCPU_FF_CPUM_BIT                  30
 #endif /* VBOX_WITH_RAW_MODE */
-/** Hardware virtualized nested-guest interrupt pending. */
-#define VMCPU_FF_INTERRUPT_NESTED_GUEST     RT_BIT_64(VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT)
-#define VMCPU_FF_INTERRUPT_NESTED_GUEST_BIT 31
 /** VMX-preemption timer in effect. */
 #define VMCPU_FF_VMX_PREEMPT_TIMER          RT_BIT_64(VMCPU_FF_VMX_PREEMPT_TIMER_BIT)
-#define VMCPU_FF_VMX_PREEMPT_TIMER_BIT      32
+#define VMCPU_FF_VMX_PREEMPT_TIMER_BIT      31
 /** Pending MTF (Monitor Trap Flag) event.  */
 #define VMCPU_FF_VMX_MTF                    RT_BIT_64(VMCPU_FF_VMX_MTF_BIT)
-#define VMCPU_FF_VMX_MTF_BIT                33
+#define VMCPU_FF_VMX_MTF_BIT                32
 /** VMX APIC-write emulation pending.  */
 #define VMCPU_FF_VMX_APIC_WRITE             RT_BIT_64(VMCPU_FF_VMX_APIC_WRITE_BIT)
-#define VMCPU_FF_VMX_APIC_WRITE_BIT         34
+#define VMCPU_FF_VMX_APIC_WRITE_BIT         33
 
 
