Index: /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 79385)
+++ /trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp	(revision 79386)
@@ -212,5 +212,5 @@
 *********************************************************************************************************************************/
 /**
- * VMX transient state.
+ * VMX per-VCPU transient state.
  *
  * A state structure for holding miscellaneous information across
@@ -295,5 +295,4 @@
 /** Pointer to a const VMX transient state. */
 typedef const VMXTRANSIENT *PCVMXTRANSIENT;
-
 
 /**
@@ -974,5 +973,5 @@
  *
  * @returns @c true if it's different, @c false otherwise.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVmcsInfo   The VMCS info. object.
  */
 DECL_FORCE_INLINE(bool) hmR0VmxIsSeparateExitMsrStoreAreaVmcs(PCVMXVMCSINFO pVmcsInfo)
@@ -1237,5 +1236,5 @@
  *
  * @returns VBox status code.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVmcsInfo   The VMCS info. object.
  *
  * @remarks Can be called with interrupts disabled.
@@ -1258,5 +1257,5 @@
  *
  * @returns VBox status code.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVmcsInfo   The VMCS info. object.
  *
  * @remarks Can be called with interrupts disabled.
@@ -1278,5 +1277,5 @@
  *
  * @returns VBox status code.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVmcsInfo   The VMCS info. object.
  *
  * @remarks Can be called with interrupts disabled.
@@ -1663,9 +1662,7 @@
  *
  * @returns IPRT status code.
- * @param   pMemObj         Pointer to the ring-0 memory object.
- * @param   ppVirt          Where to store the virtual address of the
- *                          allocation.
- * @param   pHCPhys         Where to store the physical address of the
- *                          allocation.
+ * @param   pMemObj     Pointer to the ring-0 memory object.
+ * @param   ppVirt      Where to store the virtual address of the allocation.
+ * @param   pHCPhys     Where to store the physical address of the allocation.
  */
 static int hmR0VmxPageAllocZ(PRTR0MEMOBJ pMemObj, PRTR0PTR ppVirt, PRTHCPHYS pHCPhys)
@@ -1687,9 +1684,9 @@
  * Frees and unmaps an allocated, physical page.
  *
- * @param   pMemObj         Pointer to the ring-0 memory object.
- * @param   ppVirt          Where to re-initialize the virtual address of
- *                          allocation as 0.
- * @param   pHCPhys         Where to re-initialize the physical address of the
- *                          allocation as 0.
+ * @param   pMemObj     Pointer to the ring-0 memory object.
+ * @param   ppVirt      Where to re-initialize the virtual address of allocation as
+ *                      0.
+ * @param   pHCPhys     Where to re-initialize the physical address of the
+ *                      allocation as 0.
  */
 static void hmR0VmxPageFree(PRTR0MEMOBJ pMemObj, PRTR0PTR ppVirt, PRTHCPHYS pHCPhys)
@@ -1863,5 +1860,5 @@
  *
  * @returns IPRT status code.
- * @param   pVM             The cross context VM structure.
+ * @param   pVM     The cross context VM structure.
  */
 static void hmR0VmxStructsFree(PVM pVM)
@@ -1902,5 +1899,5 @@
  *
  * @returns IPRT status code.
- * @param   pVM             The cross context VM structure.
+ * @param   pVM     The cross context VM structure.
  */
 static int hmR0VmxStructsAlloc(PVM pVM)
@@ -2191,12 +2188,12 @@
  *
  * @returns VBox status code.
- * @param   pVCpu               The cross context virtual CPU structure.
- * @param   pVmxTransient       The VMX-transient structure.
- * @param   idMsr               The MSR.
- * @param   uGuestMsrValue      Value of the guest MSR.
- * @param   fSetReadWrite       Whether to set the guest read/write access of this
- *                              MSR (thus not causing a VM-exit).
- * @param   fUpdateHostMsr      Whether to update the value of the host MSR if
- *                              necessary.
+ * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVmxTransient   The VMX-transient structure.
+ * @param   idMsr           The MSR.
+ * @param   uGuestMsrValue  Value of the guest MSR.
+ * @param   fSetReadWrite   Whether to set the guest read/write access of this
+ *                          MSR (thus not causing a VM-exit).
+ * @param   fUpdateHostMsr  Whether to update the value of the host MSR if
+ *                          necessary.
  */
 static int hmR0VmxAddAutoLoadStoreMsr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t idMsr, uint64_t uGuestMsrValue,
@@ -2411,5 +2408,5 @@
  * perform lazy restoration of the host MSRs while leaving VT-x.
  *
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -2444,6 +2441,6 @@
  *
  * @returns true if it does, false otherwise.
- * @param   pVCpu       The cross context virtual CPU structure.
- * @param   idMsr       The MSR to check.
+ * @param   pVCpu   The cross context virtual CPU structure.
+ * @param   idMsr   The MSR to check.
  */
 static bool hmR0VmxIsLazyGuestMsr(PCVMCPU pVCpu, uint32_t idMsr)
@@ -2477,5 +2474,5 @@
  * MSRs.
  *
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -2531,5 +2528,5 @@
  * loaded with guest MSR values.
  *
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -2850,6 +2847,6 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
- * @param   GCVirt      Guest virtual address of the page to invalidate.
+ * @param   pVCpu   The cross context virtual CPU structure.
+ * @param   GCVirt  Guest virtual address of the page to invalidate.
  */
 VMMR0DECL(int) VMXR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt)
@@ -3192,5 +3189,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         The cross context VM structure.
+ * @param   pVM     The cross context VM structure.
  */
 static int hmR0VmxSetupTaggedTlb(PVM pVM)
@@ -3450,5 +3447,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 DECLINLINE(int) hmR0VmxSetupVmcsApicAccessAddr(PVMCPU pVCpu)
@@ -3466,5 +3463,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 DECLINLINE(int) hmR0VmxSetupVmcsVmreadBitmapAddr(PVMCPU pVCpu)
@@ -3481,5 +3478,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 DECLINLINE(int) hmR0VmxSetupVmcsVmwriteBitmapAddr(PVMCPU pVCpu)
@@ -3592,6 +3589,6 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  */
 static int hmR0VmxSetupVmcsPinCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)
@@ -3645,6 +3642,6 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  */
 static int hmR0VmxSetupVmcsProcCtls2(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)
@@ -3739,6 +3736,6 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  */
 static int hmR0VmxSetupVmcsProcCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)
@@ -3848,6 +3845,6 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  */
 static int hmR0VmxSetupVmcsMiscCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)
@@ -3903,6 +3900,6 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  */
 static int hmR0VmxSetupVmcsXcptBitmap(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)
@@ -3936,6 +3933,6 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  */
 static int hmR0VmxSetupVmcsCtlsNested(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)
@@ -4211,5 +4208,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         The cross context VM structure.
+ * @param   pVM     The cross context VM structure.
  */
 VMMR0DECL(int) VMXR0TermVM(PVM pVM)
@@ -4235,5 +4232,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         The cross context VM structure.
+ * @param   pVM     The cross context VM structure.
  */
 VMMR0DECL(int) VMXR0SetupVM(PVM pVM)
@@ -4590,5 +4587,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 static int hmR0VmxExportHostSegmentRegs(PVMCPU pVCpu)
@@ -4830,5 +4827,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -4884,5 +4881,5 @@
  *
  * @returns true if we need to load guest EFER, false otherwise.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks Requires EFER, CR4.
@@ -5297,5 +5294,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -5321,5 +5318,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -5521,6 +5518,6 @@
  * Enables VMCS shadowing for the given VMCS info. object.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  *
  * @remarks No-long-jump zone!!!
@@ -5549,6 +5546,6 @@
  * Disables VMCS shadowing for the given VMCS info. object.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
  *
  * @remarks No-long-jump zone!!!
@@ -6439,8 +6436,8 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   pVmcsInfo       The VMCS info. object.
- * @param   iSegReg         The segment register number (X86_SREG_XXX).
- * @param   pSelReg         Pointer to the segment selector.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVmcsInfo   The VMCS info. object.
+ * @param   iSegReg     The segment register number (X86_SREG_XXX).
+ * @param   pSelReg     Pointer to the segment selector.
  *
  * @remarks No-long-jump zone!!!
@@ -7257,5 +7254,5 @@
  * (those that have a 32-bit FULL & HIGH part).
  *
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 static void hmR0VmxInitVmcsReadCache(PVMCPU pVCpu)
@@ -7344,7 +7341,7 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   idxField        The VMCS field encoding.
- * @param   u64Val          16, 32 or 64-bit value.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   idxField    The VMCS field encoding.
+ * @param   u64Val      16, 32 or 64-bit value.
  */
 VMMR0DECL(int) VMXWriteVmcs64Ex(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val)
@@ -7662,5 +7659,5 @@
  * Sets an NMI (\#NMI) exception as pending-for-injection into the VM.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 DECLINLINE(void) hmR0VmxSetPendingXcptNmi(PVMCPU pVCpu)
@@ -7677,5 +7674,5 @@
  * Sets a double-fault (\#DF) exception as pending-for-injection into the VM.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 DECLINLINE(void) hmR0VmxSetPendingXcptDF(PVMCPU pVCpu)
@@ -7692,5 +7689,5 @@
  * Sets an invalid-opcode (\#UD) exception as pending-for-injection into the VM.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 DECLINLINE(void) hmR0VmxSetPendingXcptUD(PVMCPU pVCpu)
@@ -7707,5 +7704,5 @@
  * Sets a debug (\#DB) exception as pending-for-injection into the VM.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 DECLINLINE(void) hmR0VmxSetPendingXcptDB(PVMCPU pVCpu)
@@ -7723,6 +7720,6 @@
  * Sets a general-protection (\#GP) exception as pending-for-injection into the VM.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   u32ErrCode      The error code for the general-protection exception.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   u32ErrCode  The error code for the general-protection exception.
  */
 DECLINLINE(void) hmR0VmxSetPendingXcptGP(PVMCPU pVCpu, uint32_t u32ErrCode)
@@ -7739,6 +7736,6 @@
  * Sets a stack (\#SS) exception as pending-for-injection into the VM.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   u32ErrCode      The error code for the stack exception.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   u32ErrCode  The error code for the stack exception.
  */
 DECLINLINE(void) hmR0VmxSetPendingXcptSS(PVMCPU pVCpu, uint32_t u32ErrCode)
@@ -8101,5 +8098,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks Called with interrupts and/or preemption disabled, try not to assert and
@@ -8133,5 +8130,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks Called with interrupts and/or preemption disabled, try not to assert and
@@ -8764,7 +8761,7 @@
  *         to the EM loop.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   fStepping       Whether we are single-stepping the guest using the
- *                          hypervisor debugger.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   fStepping   Whether we are single-stepping the guest using the
+ *                      hypervisor debugger.
  */
 static VBOXSTRICTRC hmR0VmxCheckForceFlags(PVMCPU pVCpu, bool fStepping)
@@ -8844,5 +8841,5 @@
  * entering from ring-3 (not longjmp returns).
  *
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 static void hmR0VmxTrpmTrapToPendingEvent(PVMCPU pVCpu)
@@ -9186,5 +9183,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jmp zone!!!
@@ -9230,5 +9227,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jmp zone!!!
@@ -9249,7 +9246,7 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
- * @param   rcExit      The reason for exiting to ring-3. Can be
- *                      VINF_VMM_UNKNOWN_RING3_CALL.
+ * @param   pVCpu   The cross context virtual CPU structure.
+ * @param   rcExit  The reason for exiting to ring-3. Can be
+ *                  VINF_VMM_UNKNOWN_RING3_CALL.
  */
 static int hmR0VmxExitToRing3(PVMCPU pVCpu, VBOXSTRICTRC rcExit)
@@ -9445,6 +9442,6 @@
  * @returns Strict VBox status code (i.e. informational status codes too).
  * @retval  VINF_EM_RESET if pushing a value to the stack caused a triple-fault.
- * @param   pVCpu       The cross context virtual CPU structure.
- * @param   uValue      The value to push to the guest stack.
+ * @param   pVCpu   The cross context virtual CPU structure.
+ * @param   uValue  The value to push to the guest stack.
  */
 static VBOXSTRICTRC hmR0VmxRealModeGuestStackPush(PVMCPU pVCpu, uint16_t uValue)
@@ -9473,14 +9470,13 @@
  * @retval  VINF_EM_RESET if event injection resulted in a triple-fault.
  *
- * @param   pVCpu               The cross context virtual CPU structure.
- * @param   pVmxTransient       The VMX-transient structure.
- * @param   pEvent              The event being injected.
- * @param   pfIntrState         Pointer to the VT-x guest-interruptibility-state.
- *                              This will be updated if necessary. This cannot not
- *                              be NULL.
- * @param   fStepping           Whether we're single-stepping guest execution and
- *                              should return VINF_EM_DBG_STEPPED if the event is
- *                              injected directly (registers modified by us, not by
- *                              hardware on VM-entry).
+ * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVmxTransient   The VMX-transient structure.
+ * @param   pEvent          The event being injected.
+ * @param   pfIntrState     Pointer to the VT-x guest-interruptibility-state. This
+ *                          will be updated if necessary. This cannot not be NULL.
+ * @param   fStepping       Whether we're single-stepping guest execution and should
+ *                          return VINF_EM_DBG_STEPPED if the event is injected
+ *                          directly (registers modified by us, not by hardware on
+ *                          VM-entry).
  */
 static VBOXSTRICTRC hmR0VmxInjectEventVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PCHMEVENT pEvent, bool fStepping,
@@ -9928,5 +9924,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 VMMR0DECL(int) VMXR0Enter(PVMCPU pVCpu)
@@ -10070,5 +10066,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -10100,5 +10096,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  *
  * @remarks No-long-jump zone!!!
@@ -10948,5 +10944,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu           The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 static int hmR0VmxMapHCApicAccessPage(PVMCPU pVCpu)
@@ -11034,5 +11030,5 @@
  *
  * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 static int hmR0VmxMergeVmcsNested(PVMCPU pVCpu)
@@ -13408,5 +13404,5 @@
  *
  * @returns Strict VBox status code (i.e. informational status codes too).
- * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   pVCpu   The cross context virtual CPU structure.
  */
 VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPU pVCpu)
@@ -13759,6 +13755,6 @@
  * Advances the guest RIP by the specified number of bytes.
  *
- * @param   pVCpu           The cross context virtual CPU structure.
- * @param   cbInstr         Number of bytes to advance the RIP by.
+ * @param   pVCpu       The cross context virtual CPU structure.
+ * @param   cbInstr     Number of bytes to advance the RIP by.
  *
  * @remarks No-long-jump zone!!!
@@ -16988,7 +16984,7 @@
         VMXVEXITINFO ExitInfo;
         RT_ZERO(ExitInfo);
-        ExitInfo.uReason   = pVmxTransient->uExitReason;
-        ExitInfo.cbInstr   = pVmxTransient->cbInstr;
-        ExitInfo.u64Qual   = pVmxTransient->uExitQual;
+        ExitInfo.uReason = pVmxTransient->uExitReason;
+        ExitInfo.cbInstr = pVmxTransient->cbInstr;
+        ExitInfo.u64Qual = pVmxTransient->uExitQual;
         return IEMExecVmxVmexitInstrWithInfo(pVCpu, &ExitInfo);
     }
