VirtualBox

Ignore:
Timestamp:
Apr 2, 2013 8:17:11 AM (12 years ago)
Author:
vboxsync
Message:

Ring-1 compression patches, courtesy of trivirt AG:

  • main: diff to remove the hwvirt requirement for QNX
  • rem: diff for dealing with raw ring 0/1 selectors and general changes to allowed guest execution states
  • vmm: changes for using the guest's TSS selector index as our hypervisor TSS selector (makes str safe) (VBOX_WITH_SAFE_STR )
  • vmm: changes for dealing with guest ring 1 code (VBOX_WITH_RAW_RING1)
  • vmm: change to emulate smsw in RC/R0 (QNX uses this old style instruction a lot so going to qemu for emulation is very expensive)
  • vmm: change (hack) to kick out patm virtual handlers in case they conflict with guest GDT/TSS write monitors; we should allow multiple handlers per page, but that change would be rather invasive
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r44399 r45276  
    159159    PCPUMCTX    pCtx   = pVCpu->em.s.pCtx;
    160160    bool        fGuest = pVCpu->em.s.enmState != EMSTATE_DEBUG_HYPER;
    161 #ifndef DEBUG_sandervl
     161#ifndef DEBUG_sander
    162162    Log(("emR3RawStep: cs:eip=%RTsel:%RGr efl=%RGr\n", fGuest ? CPUMGetGuestCS(pVCpu) : CPUMGetHyperCS(pVCpu),
    163163         fGuest ? CPUMGetGuestEIP(pVCpu) : CPUMGetHyperEIP(pVCpu), fGuest ? CPUMGetGuestEFlags(pVCpu) : CPUMGetHyperEFlags(pVCpu)));
     
    196196        else
    197197            rc = VMMR3RawRunGC(pVM, pVCpu);
    198 #ifndef DEBUG_sandervl
     198#ifndef DEBUG_sander
    199199        Log(("emR3RawStep: cs:eip=%RTsel:%RGr efl=%RGr - GC rc %Rrc\n", fGuest ? CPUMGetGuestCS(pVCpu) : CPUMGetHyperCS(pVCpu),
    200200             fGuest ? CPUMGetGuestEIP(pVCpu) : CPUMGetHyperEIP(pVCpu), fGuest ? CPUMGetGuestEFlags(pVCpu) : CPUMGetHyperEFlags(pVCpu), rc));
     
    237237    {
    238238        DBGFR3PrgStep(pVCpu);
    239         DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: ");
     239        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS");
    240240        rc = emR3RawStep(pVM, pVCpu);
    241         if (rc != VINF_SUCCESS)
     241        if (   rc != VINF_SUCCESS
     242            && rc != VINF_EM_DBG_STEPPED)
    242243            break;
    243244    }
     
    950951    {
    951952        DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
    952         DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: ");
     953        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr");
    953954    }
    954955#endif
     
    10901091                    {
    10911092                        DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
    1092                         DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: ");
     1093                        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr");
    10931094                    }
    10941095#endif
     
    13611362        Assert(REMR3QueryPendingInterrupt(pVM, pVCpu) == REM_NO_PENDING_IRQ);
    13621363# endif
     1364# ifdef VBOX_WITH_RAW_RING1
     1365        Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss.Sel & X86_SEL_RPL) == 3 || (pCtx->ss.Sel & X86_SEL_RPL) == 0 || (EMIsRawRing1Enabled(pVM) && (pCtx->ss.Sel & X86_SEL_RPL) == 1));
     1366# else
    13631367        Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss.Sel & X86_SEL_RPL) == 3 || (pCtx->ss.Sel & X86_SEL_RPL) == 0);
     1368# endif
    13641369        AssertMsg(   (pCtx->eflags.u32 & X86_EFL_IF)
    13651370                  || PATMShouldUseRawMode(pVM, (RTGCPTR)pCtx->eip),
     
    14291434            Log(("RV86: %04x:%08x IF=%d VMFlags=%x\n", pCtx->cs.Sel, pCtx->eip, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags));
    14301435        else if ((pCtx->ss.Sel & X86_SEL_RPL) == 1)
    1431             Log(("RR0: %08x ESP=%08x EFL=%x IF=%d/%d VMFlags=%x PIF=%d CPL=%d (Scanned=%d)\n",
    1432                  pCtx->eip, pCtx->esp, CPUMRawGetEFlags(pVCpu), !!(pGCState->uVMFlags & X86_EFL_IF), pCtx->eflags.Bits.u1IF,
     1436            Log(("RR0: %x:%08x ESP=%x:%08x EFL=%x IF=%d/%d VMFlags=%x PIF=%d CPL=%d (Scanned=%d)\n",
     1437                 pCtx->cs.Sel, pCtx->eip, pCtx->ss.Sel, pCtx->esp, CPUMRawGetEFlags(pVCpu), !!(pGCState->uVMFlags & X86_EFL_IF), pCtx->eflags.Bits.u1IF,
    14331438                 pGCState->uVMFlags, pGCState->fPIF, (pCtx->ss.Sel & X86_SEL_RPL), CSAMIsPageScanned(pVM, (RTGCPTR)pCtx->eip)));
     1439# ifdef VBOX_WITH_RAW_RING1
     1440        else if ((pCtx->ss.Sel & X86_SEL_RPL) == 2)
     1441            Log(("RR1: %x:%08x ESP=%x:%08x IF=%d VMFlags=%x CPL=%x\n", pCtx->cs.Sel, pCtx->eip, pCtx->ss.Sel, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags, (pCtx->ss.Sel & X86_SEL_RPL)));
     1442# endif
    14341443        else if ((pCtx->ss.Sel & X86_SEL_RPL) == 3)
    1435             Log(("RR3: %08x ESP=%08x IF=%d VMFlags=%x\n", pCtx->eip, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags));
     1444            Log(("RR3: %x:%08x ESP=%x:%08x IF=%d VMFlags=%x\n", pCtx->cs.Sel, pCtx->eip, pCtx->ss.Sel, pCtx->esp, pCtx->eflags.Bits.u1IF, pGCState->uVMFlags));
    14361445#endif /* LOG_ENABLED */
    1437 
    14381446
    14391447
     
    15431551            ||  VMCPU_FF_ISPENDING(pVCpu, ~VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK))
    15441552        {
    1545             Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss.Sel & X86_SEL_RPL) != 1);
     1553            Assert(pCtx->eflags.Bits.u1VM || (EMIsRawRing1Enabled(pVM) ? ((pCtx->ss.Sel & X86_SEL_RPL) != 2) : ((pCtx->ss.Sel & X86_SEL_RPL) != 1)));
    15461554
    15471555            STAM_REL_PROFILE_ADV_SUSPEND(&pVCpu->em.s.StatRAWTotal, a);
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