VirtualBox

Changeset 93119 in vbox for trunk/src


Ignore:
Timestamp:
Jan 4, 2022 2:11:01 AM (3 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: Must deal with VINF_IEM_RAISED_XCPT in the string I/O case of an IOIO exit. Debug builds would guru if the guest was using invalid memory and IEM was forced to raise a #PF or #GP. Reordered fCtxChanged/rcStrict updating in similar code paths, placing the rcStrict after the fCtxChange since that's closer to the return point and might help with register liveness.

File:
1 edited

Legend:

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

    r93115 r93119  
    68386838    if (rcStrict == VINF_IEM_RAISED_XCPT)
    68396839    {
     6840        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    68406841        rcStrict = VINF_SUCCESS;
    6841         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    68426842    }
    68436843    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    68706870    if (rcStrict == VINF_IEM_RAISED_XCPT)
    68716871    {
     6872        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    68726873        rcStrict = VINF_SUCCESS;
    6873         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    68746874    }
    68756875    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    69076907        if (rcStrict == VINF_IEM_RAISED_XCPT)
    69086908        {
     6909            ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    69096910            rcStrict = VINF_SUCCESS;
    6910             ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    69116911        }
    69126912        HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    69586958    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    69596959    {
     6960        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    69606961        rcStrict = VINF_SUCCESS;
    6961         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    69626962    }
    69636963    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    69926992    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    69936993    {
     6994        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    69946995        rcStrict = VINF_SUCCESS;
    6995         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    69966996    }
    69976997    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    70247024    if (rcStrict == VINF_IEM_RAISED_XCPT)
    70257025    {
     7026        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    70267027        rcStrict = VINF_SUCCESS;
    7027         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    70287028    }
    70297029    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    70607060    if (rcStrict == VINF_IEM_RAISED_XCPT)
    70617061    {
     7062        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    70627063        rcStrict = VINF_SUCCESS;
    7063         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    70647064    }
    70657065    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    70957095    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    70967096    {
     7097        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    70977098        rcStrict = VINF_SUCCESS;
    7098         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    70997099    }
    71007100    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    71347134    if (rcStrict == VINF_IEM_RAISED_XCPT)
    71357135    {
     7136        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    71367137        rcStrict = VINF_SUCCESS;
    7137         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    71387138    }
    71397139    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    71697169    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    71707170    {
     7171        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    71717172        rcStrict = VINF_SUCCESS;
    7172         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    71737173    }
    71747174    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    72547254    if (rcStrict == VINF_IEM_RAISED_XCPT)
    72557255    {
     7256        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    72567257        rcStrict = VINF_SUCCESS;
    7257         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    72587258    }
    72597259    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    73467346    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    73477347    {
    7348         rcStrict = VINF_SUCCESS;
    73497348        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    73507349        HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     7350        rcStrict = VINF_SUCCESS;
    73517351    }
    73527352    else
     
    73917391    if (rcStrict == VINF_IEM_RAISED_XCPT)
    73927392    {
     7393        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    73937394        rcStrict = VINF_SUCCESS;
    7394         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    73957395    }
    73967396    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    75037503    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    75047504    {
     7505        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    75057506        rcStrict = VINF_SUCCESS;
    7506         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    75077507    }
    75087508    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    76367636    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    76377637    {
     7638        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    76387639        rcStrict = VINF_SUCCESS;
    7639         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    76407640    }
    76417641    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    77527752            }
    77537753            fUpdateRipAlready = true;
     7754            if (rcStrict == VINF_IEM_RAISED_XCPT)
     7755            {
     7756                ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
     7757                rcStrict = VINF_SUCCESS;
     7758            }
    77547759        }
    77557760        else
     
    78347839            HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
    78357840        }
    7836 
    78377841#ifdef VBOX_STRICT
    78387842        if (   rcStrict == VINF_IOM_R3_IOPORT_READ
     
    89418945    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    89428946    {
     8947        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    89438948        rcStrict = VINF_SUCCESS;
    8944         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    89458949    }
    89468950    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    89868990    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    89878991    {
     8992        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    89888993        rcStrict = VINF_SUCCESS;
    8989         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    89908994    }
    89918995    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    90209024    if (rcStrict == VINF_IEM_RAISED_XCPT)
    90219025    {
     9026        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    90229027        rcStrict = VINF_SUCCESS;
    9023         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    90249028    }
    90259029    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    90529056    if (rcStrict == VINF_IEM_RAISED_XCPT)
    90539057    {
     9058        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    90549059        rcStrict = VINF_SUCCESS;
    9055         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    90569060    }
    90579061    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
     
    90969100    else if (rcStrict == VINF_IEM_RAISED_XCPT)
    90979101    {
     9102        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    90989103        rcStrict = VINF_SUCCESS;
    9099         ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_RAISED_XCPT_MASK);
    91009104    }
    91019105    HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict);
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