VirtualBox

Changeset 43872 in vbox for trunk/src


Ignore:
Timestamp:
Nov 15, 2012 8:52:11 AM (12 years ago)
Author:
vboxsync
Message:

Make VBOX_WITH_RAW_MODE= link.

Location:
trunk/src/VBox/VMM
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/Makefile.kmk

    r43387 r43872  
    119119        VMMR3/DBGFR3Trace.cpp \
    120120        VMMR3/EM.cpp \
    121         VMMR3/EMRaw.cpp \
     121        $(if $(VBOX_WITH_RAW_MODE),VMMR3/EMRaw.cpp) \
    122122        VMMR3/EMHM.cpp \
    123123        VMMR3/FTM.cpp \
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r43387 r43872  
    299299    {
    300300# if    PGM_SHW_TYPE == PGM_TYPE_AMD64 \
    301      || PGM_SHW_TYPE == PGM_TYPE_EPT
     301     || PGM_SHW_TYPE == PGM_TYPE_EPT \
     302     || defined(PGM_WITHOUT_MAPPINGS)
    302303        AssertFailed(); /* can't happen */
    303304        pPT = NULL;     /* shut up MSC */
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r43667 r43872  
    40464046        if (!CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->cs))
    40474047        {
     4048# ifdef VBOX_WITH_RAW_MODE_NOT_R0
    40484049            CPUMGuestLazyLoadHiddenSelectorReg(pVCpu, &pCtx->cs);
     4050# endif
    40494051            if (!CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->cs))
    40504052                return VERR_CPUM_HIDDEN_CS_LOAD_ERROR;
  • trunk/src/VBox/VMM/VMMR3/CSAM.cpp

    r42782 r43872  
    24492449VMMR3DECL(int) CSAMR3CheckGates(PVM pVM, uint32_t iGate, uint32_t cGates)
    24502450{
     2451#ifdef VBOX_WITH_RAW_MODE
    24512452    Assert(pVM->cCpus == 1);
    24522453    PVMCPU      pVCpu = VMMGetCpu0(pVM);
     
    26522653    } /* for */
    26532654    STAM_PROFILE_STOP(&pVM->csam.s.StatCheckGates, a);
     2655#endif /* VBOX_WITH_RAW_MODE */
    26542656    return VINF_SUCCESS;
    26552657}
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r43394 r43872  
    736736             */
    737737            case VINF_EM_DBG_STEP:
     738#ifdef VBOX_WITH_RAW_MODE
    738739                if (    pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_RAW
    739740                    ||  pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER
     
    745746                    rc = emR3RemStep(pVM, pVCpu);
    746747                }
     748#else
     749                AssertLogRelMsgFailed(("%Rrc\n", rc));
     750                rc = VERR_EM_INTERNAL_ERROR;
     751#endif
    747752                break;
    748753
     
    823828                    if (pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER)
    824829                    {
     830#ifdef VBOX_WITH_RAW_MODE
    825831                        rc = emR3RawResumeHyper(pVM, pVCpu);
    826832                        if (rc != VINF_SUCCESS && RT_SUCCESS(rc))
    827833                            continue;
     834#else
     835                        AssertLogRelMsgFailedReturn(("Not implemented\n", rc), VERR_EM_INTERNAL_ERROR);
     836#endif
    828837                    }
    829838                    if (rc == VINF_SUCCESS)
     
    21892198                case EMSTATE_RAW:
    21902199#ifndef IEM_VERIFICATION_MODE /* remove later */
     2200# ifdef VBOX_WITH_RAW_MODE
    21912201                    rc = emR3RawExecute(pVM, pVCpu, &fFFDone);
     2202# else
     2203                    AssertLogRelMsgFailed(("%Rrc\n", rc));
     2204                    rc = VERR_EM_INTERNAL_ERROR;
     2205# endif
    21922206                    break;
    21932207#endif
  • trunk/src/VBox/VMM/VMMR3/PGMBth.h

    r43387 r43872  
    148148        pgmPoolUnlockPage(pPool, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
    149149
     150# ifndef PGM_WITHOUT_MAPPINGS
    150151        /* Remove the hypervisor mappings from the shadow page table. */
    151152        pgmMapDeactivateCR3(pVM, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
     153# endif
    152154
    153155        pgmPoolFreeByPage(pPool, pVCpu->pgm.s.pShwPageCR3R3, pVCpu->pgm.s.iShwUser, pVCpu->pgm.s.iShwUserTable);
     
    184186    CPUMSetHyperCR3(pVCpu, PGMGetHyperCR3(pVCpu));
    185187
     188# ifndef PGM_WITHOUT_MAPPINGS
    186189    /* Apply all hypervisor mappings to the new CR3. */
    187190    rc = pgmMapActivateCR3(pVM, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
     191# endif
     192
    188193    pgmUnlock(pVM);
    189194    return rc;
  • trunk/src/VBox/VMM/VMMR3/PGMMap.cpp

    r43387 r43872  
    3737*   Internal Functions                                                         *
    3838*******************************************************************************/
     39#ifndef PGM_WITHOUT_MAPPINGS
    3940static void pgmR3MapClearPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iOldPDE);
    4041static void pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE);
    4142static int  pgmR3MapIntermediateCheckOne(PVM pVM, uintptr_t uAddress, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
    4243static void pgmR3MapIntermediateDoOne(PVM pVM, uintptr_t uAddress, RTHCPHYS HCPhys, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
     44#else
     45# define pgmR3MapClearPDEs(pVM, pMap, iNewPDE) do { } while (0)
     46# define pgmR3MapSetPDEs(pVM, pMap, iNewPDE)   do { } while (0)
     47#endif
    4348
    4449
     
    210215}
    211216
     217#ifdef VBOX_WITH_UNUSED_CODE
    212218
    213219/**
     
    280286    return VERR_INVALID_PARAMETER;
    281287}
     288
     289#endif /* unused */
    282290
    283291
     
    484492{
    485493    RTGCPTR cb = 0;
     494#ifndef PGM_WITHOUT_MAPPINGS
    486495    for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3)
    487496        cb += pCur->cb;
     497#endif
    488498
    489499    *pcb = cb;
     
    507517         GCPtrBase, cb, pVM->pgm.s.fMappingsFixed, pVM->pgm.s.fMappingsDisabled));
    508518
    509     /*
    510      * Ignore the additions mapping fix call if disabled.
    511      */
    512     if (!pgmMapAreMappingsEnabled(pVM))
    513     {
    514         Assert(HMIsEnabled(pVM));
    515         return VINF_SUCCESS;
    516     }
    517 
    518     /*
    519      * Only applies to VCPU 0 as we don't support SMP guests with raw mode.
    520      */
    521     Assert(pVM->cCpus == 1);
    522     PVMCPU pVCpu = &pVM->aCpus[0];
    523 
    524     /*
    525      * Before we do anything we'll do a forced PD sync to try make sure any
    526      * pending relocations because of these mappings have been resolved.
    527      */
    528     PGMSyncCR3(pVCpu, CPUMGetGuestCR0(pVCpu), CPUMGetGuestCR3(pVCpu), CPUMGetGuestCR4(pVCpu), true);
    529 
    530     return pgmR3MappingsFixInternal(pVM, GCPtrBase, cb);
    531 }
    532 
    533 
     519#ifndef PGM_WITHOUT_MAPPINGS
     520    if (pgmMapAreMappingsEnabled(pVM))
     521    {
     522        /*
     523         * Only applies to VCPU 0 as we don't support SMP guests with raw mode.
     524         */
     525        Assert(pVM->cCpus == 1);
     526        PVMCPU pVCpu = &pVM->aCpus[0];
     527
     528        /*
     529         * Before we do anything we'll do a forced PD sync to try make sure any
     530         * pending relocations because of these mappings have been resolved.
     531         */
     532        PGMSyncCR3(pVCpu, CPUMGetGuestCR0(pVCpu), CPUMGetGuestCR3(pVCpu), CPUMGetGuestCR4(pVCpu), true);
     533
     534        return pgmR3MappingsFixInternal(pVM, GCPtrBase, cb);
     535    }
     536#endif /* !PGM_WITHOUT_MAPPINGS */
     537
     538    Assert(HMIsEnabled(pVM));
     539    return VINF_SUCCESS;
     540}
     541
     542
     543#ifndef PGM_WITHOUT_MAPPINGS
    534544/**
    535545 * Internal worker for PGMR3MappingsFix and pgmR3Load.
     
    671681    return VINF_SUCCESS;
    672682}
     683#endif /*!PGM_WITHOUT_MAPPINGS*/
     684
    673685
    674686
     
    689701        return VINF_SUCCESS;
    690702
     703#ifdef VBOX_WITH_RAW_MODE
    691704    /*
    692705     * Deactivate (only applies to Virtual CPU #0).
     
    699712        AssertRCReturn(rc, rc);
    700713    }
     714#endif /* VBOX_WITH_RAW_MODE */
    701715
    702716    /*
     
    758772}
    759773
     774#ifndef PGM_WITHOUT_MAPPINGS
    760775
    761776/**
     
    13451360}
    13461361
     1362#endif /* !PGM_WITHOUT_MAPPINGS */
    13471363
    13481364/**
  • trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp

    r42931 r43872  
    32153215                && pgmMapAreMappingsEnabled(pVM))
    32163216            {
     3217#ifndef PGM_WITHOUT_MAPPINGS
    32173218                RTGCPTR     GCPtrFixed    = pVM->pgm.s.GCPtrMappingFixed;
    32183219                uint32_t    cbFixed       = pVM->pgm.s.cbMappingFixed;
     
    32353236                    pVM->pgm.s.cbMappingFixed         = cbFixed;
    32363237                }
     3238#else
     3239                AssertFailed();
     3240#endif
    32373241            }
    32383242            else
  • trunk/src/VBox/VMM/VMMR3/SELM.cpp

    r42427 r43872  
    809809}
    810810
     811#ifdef VBOX_WITH_RAW_MODE
    811812
    812813/**
     
    13681369}
    13691370
     1371#endif /*VBOX_WITH_RAW_MODE*/
     1372
    13701373
    13711374/**
     
    13781381VMMR3DECL(VBOXSTRICTRC) SELMR3UpdateFromCPUM(PVM pVM, PVMCPU pVCpu)
    13791382{
     1383#ifdef VBOX_WITH_RAW_MODE
    13801384    if (pVM->selm.s.fDisableMonitoring)
     1385#endif
    13811386    {
    13821387        VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_SELM_SYNC_GDT);
     
    13861391    }
    13871392
     1393#ifdef VBOX_WITH_RAW_MODE
    13881394    STAM_PROFILE_START(&pVM->selm.s.StatUpdateFromCPUM, a);
    13891395
     
    14291435    STAM_PROFILE_STOP(&pVM->selm.s.StatUpdateFromCPUM, a);
    14301436    return rcStrict;
     1437#endif
    14311438}
    14321439
     
    15371544    int    rc;
    15381545
     1546#ifdef VBOX_WITH_RAW_MODE
    15391547    if (pVM->selm.s.fDisableMonitoring)
     1548#endif
    15401549    {
    15411550        VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_SELM_SYNC_TSS);
     
    15431552    }
    15441553
     1554#ifdef VBOX_WITH_RAW_MODE
    15451555    STAM_PROFILE_START(&pVM->selm.s.StatTSSSync, a);
    15461556    Assert(VMCPU_FF_ISSET(pVCpu, VMCPU_FF_SELM_SYNC_TSS));
     
    17271737    STAM_PROFILE_STOP(&pVM->selm.s.StatTSSSync, a);
    17281738    return VINF_SUCCESS;
    1729 }
    1730 
     1739#endif /*VBOX_WITH_RAW_MODE*/
     1740}
     1741
     1742#ifdef VBOX_WITH_RAW_MODE
    17311743
    17321744/**
     
    20082020}
    20092021
     2022#endif /* VBOX_WITH_RAW_MODE */
    20102023
    20112024/**
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r43387 r43872  
    39053905#define PGM_LOCK_ASSERT_OWNER_EX(a_pVM, a_pVCpu)  Assert(PDMCritSectIsOwnerEx(&(a_pVM)->pgm.s.CritSectX, pVCpu))
    39063906
     3907#ifndef PGM_WITHOUT_MAPPINGS
    39073908int             pgmR3MappingsFixInternal(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb);
    39083909int             pgmR3SyncPTResolveConflict(PVM pVM, PPGMMAPPING pMapping, PX86PD pPDSrc, RTGCPTR GCPtrOldMapping);
    39093910int             pgmR3SyncPTResolveConflictPAE(PVM pVM, PPGMMAPPING pMapping, RTGCPTR GCPtrOldMapping);
     3911int             pgmMapResolveConflicts(PVM pVM);
     3912#endif /* !PGM_WITHOUT_MAPPINGS */
    39103913PPGMMAPPING     pgmGetMapping(PVM pVM, RTGCPTR GCPtr);
    3911 int             pgmMapResolveConflicts(PVM pVM);
    39123914DECLCALLBACK(void) pgmR3MapInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    39133915
  • trunk/src/VBox/VMM/include/TRPMInternal.h

    r41943 r43872  
    2727
    2828/** Enable to allow trap forwarding in GC. */
    29 #define TRPM_FORWARD_TRAPS_IN_GC
     29#ifdef VBOX_WITH_RAW_MODE
     30# define TRPM_FORWARD_TRAPS_IN_GC
     31#endif
    3032
    3133/** First interrupt handler. Used for validating input. */
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