VirtualBox

Changeset 61013 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 17, 2016 8:36:27 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107271
Message:

bugref:8318 HM: Don't guru when the VMMDev heap is unmapped by 32-bit EFI.

File:
1 edited

Legend:

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

    r60874 r61013  
    38483848 * in the VMCS.
    38493849 *
    3850  * @returns VBox status code.
     3850 * @returns VBox strict status code.
     3851 * @retval  VINF_EM_RESCHEDULE_REM if we try to emulate non-paged guest code
     3852 *          without unrestricted guest access and the VMMDev is not presently
     3853 *          mapped (e.g. EFI32).
     3854 *
    38513855 * @param   pVCpu       The cross context virtual CPU structure.
    38523856 * @param   pMixedCtx   Pointer to the guest-CPU context. The data may be
     
    38563860 * @remarks No-long-jump zone!!!
    38573861 */
    3858 static int hmR0VmxLoadGuestCR3AndCR4(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
     3862static VBOXSTRICTRC hmR0VmxLoadGuestCR3AndCR4(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
    38593863{
    38603864    int rc  = VINF_SUCCESS;
     
    39253929                RTGCPHYS GCPhys;
    39263930                Assert(pVM->hm.s.vmx.pNonPagingModeEPTPageTable);
    3927                 Assert(PDMVmmDevHeapIsEnabled(pVM));
    39283931
    39293932                /* We obtain it here every time as the guest could have relocated this PCI region. */
    39303933                rc = PDMVmmDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pNonPagingModeEPTPageTable, &GCPhys);
    3931                 AssertRCReturn(rc, rc);
     3934                if (RT_SUCCESS(rc))
     3935                { /* likely */ }
     3936                else if (rc == VERR_PDM_DEV_HEAP_R3_TO_GCPHYS)
     3937                {
     3938                    Log4(("Load[%RU32]: VERR_PDM_DEV_HEAP_R3_TO_GCPHYS -> VINF_EM_RESCHEDULE_REM\n", pVCpu->idCpu));
     3939                    return VINF_EM_RESCHEDULE_REM;  /* We cannot execute now, switch to REM/IEM till the guest maps in VMMDev. */
     3940                }
     3941                else
     3942                    AssertMsgFailedReturn(("%Rrc\n",  rc), rc);
    39323943
    39333944                GCPhysGuestCR3 = GCPhys;
     
    82278238 * the guest CPU mode.
    82288239 *
    8229  * @returns VBox status code.
     8240 * @returns VBox strict status code.
     8241 * @retval  VINF_EM_RESCHEDULE_REM if we try to emulate non-paged guest code
     8242 *          without unrestricted guest access and the VMMDev is not presently
     8243 *          mapped (e.g. EFI32).
     8244 *
    82308245 * @param   pVM         The cross context VM structure.
    82318246 * @param   pVCpu       The cross context virtual CPU structure.
     
    82348249 *                      before using them.
    82358250 *
    8236  * @remarks No-long-jump zone!!!
    8237  */
    8238 static int hmR0VmxLoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
     8251 * @remarks No-long-jump zone!!!  (Disables and enables long jmps for itself,
     8252 *          caller disables then again on successfull return.  Confusing.)
     8253 */
     8254static VBOXSTRICTRC hmR0VmxLoadGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
    82398255{
    82408256    AssertPtr(pVM);
     
    82778293    AssertLogRelMsgRCReturn(rc, ("hmR0VmxLoadGuestActivityState! rc=%Rrc (pVM=%p pVCpu=%p)\n", rc, pVM, pVCpu), rc);
    82788294
    8279     rc = hmR0VmxLoadGuestCR3AndCR4(pVCpu, pMixedCtx);
    8280     AssertLogRelMsgRCReturn(rc, ("hmR0VmxLoadGuestCR3AndCR4: rc=%Rrc (pVM=%p pVCpu=%p)\n", rc, pVM, pVCpu), rc);
     8295    VBOXSTRICTRC rcStrict = hmR0VmxLoadGuestCR3AndCR4(pVCpu, pMixedCtx);
     8296    if (rcStrict == VINF_SUCCESS)
     8297    { /* likely */ }
     8298    else
     8299    {
     8300        VMMRZCallRing3Enable(pVCpu);
     8301        Assert(rcStrict == VINF_EM_RESCHEDULE_REM || RT_FAILURE_NP(rcStrict));
     8302        return rcStrict;
     8303    }
    82818304
    82828305    /* Assumes pMixedCtx->cr0 is up-to-date (strict builds require CR0 for segment register validation checks). */
     
    83758398 *
    83768399 * @returns Strict VBox status code (i.e. informational status codes too).
     8400 * @retval  VINF_EM_RESCHEDULE_REM if we try to emulate non-paged guest code
     8401 *          without unrestricted guest access and the VMMDev is not presently
     8402 *          mapped (e.g. EFI32).
     8403 *
    83778404 * @param   pVM             The cross context VM structure.
    83788405 * @param   pVCpu           The cross context virtual CPU structure.
     
    84108437        else
    84118438        {
    8412             AssertLogRelMsgFailedReturn(("hmR0VmxLoadGuestStateOptimal: hmR0VmxLoadGuestState failed! rc=%Rrc\n",
    8413                                          VBOXSTRICTRC_VAL(rcStrict)), rcStrict);
     8439            AssertLogRelMsg(rcStrict == VINF_EM_RESCHEDULE_REM,
     8440                            ("hmR0VmxLoadGuestStateOptimal: hmR0VmxLoadGuestState failed! rc=%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
     8441            return rcStrict;
    84148442        }
    84158443        STAM_COUNTER_INC(&pVCpu->hm.s.StatLoadFull);
Note: See TracChangeset for help on using the changeset viewer.

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