VirtualBox

Changeset 48240 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Sep 3, 2013 1:48:43 AM (11 years ago)
Author:
vboxsync
Message:

More paranoia regarding pfnStartVM changes on 32-bit hosts (doesn't help).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r48237 r48240  
    40594059#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
    40604060        /* 32-bit host. We need to switch to 64-bit before running the 64-bit guest. */
    4061         pVCpu->hm.s.vmx.pfnStartVM = VMXR0SwitcherStartVM64;
     4061        if (pVCpu->hm.s.vmx.pfnStartVM != VMXR0SwitcherStartVM64)
     4062        {
     4063            pVCpu->hm.s.vmx.pfnStartVM = VMXR0SwitcherStartVM64;
     4064            /** @todo this isn't necessary, but I'm still seeing tripple faults. */
     4065            VMCPU_FF_SET(pVCpu, VMCPU_FF_TO_R3);
     4066            pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_VMX_EXIT_CTLS;
     4067        }
    40624068#else
    40634069        /* 64-bit host or hybrid host. */
     
    40784084             *        between 16/32-bit and long mode frequently at times. */
    40794085            VMCPU_FF_SET(pVCpu, VMCPU_FF_TO_R3);
     4086            pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_VMX_EXIT_CTLS;
    40804087        }
    40814088#else
     
    72737280 * recompiler. We must be cautious what we do here regarding committing
    72747281 * guest-state information into the VMCS assuming we assuredly execute the
    7275  * guest in VT-x. If we fall back to the recompiler after updating the VMCS and
    7276  * clearing the common-state (TRPM/forceflags), we must undo those changes so
    7277  * that the recompiler can (and should) use them when it resumes guest
     7282 * guest in VT-x mode. If we fall back to the recompiler after updating the VMCS
     7283 * and clearing the common-state (TRPM/forceflags), we must undo those changes
     7284 * so that the recompiler can (and should) use them when it resumes guest
    72787285 * execution. Otherwise such operations must be done when we can no longer
    72797286 * exit to ring-3.
    72807287 *
    7281  * @returns VBox status code (informational status codes included).
    7282  * @retval VINF_SUCCESS if we can proceed with running the guest.
    7283  * @retval VINF_EM_RESET if a triple-fault occurs while injecting a double-fault
    7284  *         into the guest.
    7285  * @retval VINF_* scheduling changes, we have to go back to ring-3.
     7288 * @returns Strict VBox status code.
     7289 * @retval  VINF_SUCCESS if we can proceed with running the guest, interrupts
     7290 *          have been disabled.
     7291 * @retval  VINF_EM_RESET if a triple-fault occurs while injecting a
     7292 *          double-fault into the guest.
     7293 * @retval  VINF_* scheduling changes, we have to go back to ring-3.
    72867294 *
    72877295 * @param   pVM             Pointer to the VM.
     
    72927300 * @param   pVmxTransient   Pointer to the VMX transient structure.
    72937301 *
    7294  * @remarks Called with preemption disabled.
     7302 * @remarks Called with preemption disabled. In the VINF_SUCCESS return case
     7303 *          interrupts will be disabled.
    72957304 */
    72967305static int hmR0VmxPreRunGuest(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
     
    75017510 * @param   rcVMRun         Return code of VMLAUNCH/VMRESUME.
    75027511 *
    7503  * @remarks Called with interrupts disabled.
     7512 * @remarks Called with interrupts disabled, and returns with interrups enabled!
     7513 *
    75047514 * @remarks No-long-jump zone!!! This function will however re-enable longjmps
    75057515 *          unconditionally when it is safe to do so.
     
    76027612        HMVMX_ASSERT_CPU_SAFE();
    76037613
    7604         /* Preparatory work for running guest code, this may return to ring-3 for some last minute updates. */
     7614        /* Preparatory work for running guest code, this may force us to return
     7615           to ring-3.  This bugger disables interrupts on VINF_SUCCESS! */
    76057616        STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatEntry, x);
    76067617        rc = hmR0VmxPreRunGuest(pVM, pVCpu, pCtx, &VmxTransient);
     
    76127623        /* The guest-CPU context is now outdated, 'pCtx' is to be treated as 'pMixedCtx' from this point on!!! */
    76137624
    7614         /* Restore any residual host-state and save any bits shared between host and guest into the guest-CPU state. */
     7625        /* Restore any residual host-state and save any bits shared between host
     7626           and guest into the guest-CPU state.  Re-enables interrupts! */
    76157627        hmR0VmxPostRunGuest(pVM, pVCpu, pCtx, &VmxTransient, rc);
    76167628
     
    76747686        HMVMX_ASSERT_CPU_SAFE();
    76757687
    7676         /* Preparatory work for running guest code, this may return to ring-3 for some last minute updates. */
     7688        /* Preparatory work for running guest code, this may force us to return
     7689           to ring-3.  This bugger disables interrupts on VINF_SUCCESS! */
    76777690        STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatEntry, x);
    76787691        rc = hmR0VmxPreRunGuest(pVM, pVCpu, pCtx, &VmxTransient);
     
    76847697        /* The guest-CPU context is now outdated, 'pCtx' is to be treated as 'pMixedCtx' from this point on!!! */
    76857698
    7686         /* Restore any residual host-state and save any bits shared between host and guest into the guest-CPU state. */
     7699        /* Restore any residual host-state and save any bits shared between host
     7700           and guest into the guest-CPU state.  Re-enables interrupts! */
    76877701        hmR0VmxPostRunGuest(pVM, pVCpu, pCtx, &VmxTransient, rc);
    76887702
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette