VirtualBox

vbox的更動 18927 路徑 trunk/src/VBox/VMM/TRPM.cpp


忽略:
時間撮記:
2009-4-16 上午11:41:38 (16 年 以前)
作者:
vboxsync
訊息:

Big step to separate VMM data structures for guest SMP. (pgm, em)

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/TRPM.cpp

    r18617 r18927  
    570570VMMR3DECL(void) TRPMR3Relocate(PVM pVM, RTGCINTPTR offDelta)
    571571{
     572    /* Only applies to raw mode which supports only 1 VCPU. */
     573    PVMCPU pVCpu = &pVM->aCpus[0];
     574
    572575    LogFlow(("TRPMR3Relocate\n"));
    573576    /*
     
    592595    AssertReleaseMsgRC(rc, ("Couldn't find TRPMGCHandlerTrap12 in VMMGC.gc!\n"));
    593596
    594     RTSEL SelCS = CPUMGetHyperCS(pVM);
     597    RTSEL SelCS = CPUMGetHyperCS(pVCpu);
    595598
    596599    /*
     
    639642     * Update IDTR (limit is including!).
    640643     */
    641     CPUMSetHyperIDTR(pVM, VM_RC_ADDR(pVM, &pVM->trpm.s.aIdt[0]), sizeof(pVM->trpm.s.aIdt)-1);
     644    CPUMSetHyperIDTR(pVCpu, VM_RC_ADDR(pVM, &pVM->trpm.s.aIdt[0]), sizeof(pVM->trpm.s.aIdt)-1);
    642645
    643646    if (!pVM->trpm.s.fDisableMonitoring)
     
    903906 * @returns VBox status code.
    904907 * @param   pVM         The VM handle.
    905  */
    906 VMMR3DECL(int) TRPMR3SyncIDT(PVM pVM)
     908 * @param   pVCpu       The VMCPU handle.
     909 */
     910VMMR3DECL(int) TRPMR3SyncIDT(PVM pVM, PVMCPU pVCpu)
    907911{
    908912    STAM_PROFILE_START(&pVM->trpm.s.StatSyncIDT, a);
     
    932936     */
    933937    VBOXIDTR IDTR;
    934     IDTR.pIdt = CPUMGetGuestIDTR(pVM, &IDTR.cbIdt);
     938    IDTR.pIdt = CPUMGetGuestIDTR(pVCpu, &IDTR.cbIdt);
    935939    if (!IDTR.cbIdt)
    936940    {
     
    985989     */
    986990    X86DESC  Idte3;
    987     rc = PGMPhysSimpleReadGCPtr(pVM, &Idte3, IDTR.pIdt + sizeof(Idte3) * 3,  sizeof(Idte3));
     991    rc = PGMPhysSimpleReadGCPtr(pVCpu, &Idte3, IDTR.pIdt + sizeof(Idte3) * 3,  sizeof(Idte3));
    988992    if (RT_FAILURE(rc))
    989993    {
     
    10781082VMMR3DECL(int) trpmR3ClearPassThroughHandler(PVM pVM, unsigned iTrap)
    10791083{
     1084    /* Only applies to raw mode which supports only 1 VCPU. */
     1085    PVMCPU pVCpu = &pVM->aCpus[0];
     1086
    10801087    /** @todo cleanup trpmR3ClearPassThroughHandler()! */
    10811088    RTRCPTR aGCPtrs[TRPM_HANDLER_MAX];
     
    10981105    ASMBitClear(&pVM->trpm.s.au32IdtPatched[0], iTrap);
    10991106
    1100     RTSEL               SelCS         = CPUMGetHyperCS(pVM);
     1107    RTSEL               SelCS         = CPUMGetHyperCS(pVCpu);
    11011108    PVBOXIDTE           pIdte         = &pVM->trpm.s.aIdt[iTrap];
    11021109    PVBOXIDTE_GENERIC   pIdteTemplate = &g_aIdt[iTrap];
     
    11821189VMMR3DECL(int) TRPMR3SetGuestTrapHandler(PVM pVM, unsigned iTrap, RTRCPTR pHandler)
    11831190{
     1191    /* Only valid in raw mode which implies 1 VCPU */
     1192    Assert(PATMIsEnabled(pVM) && pVM->cCPUs == 1);
     1193    PVMCPU pVCpu = &pVM->aCpus[0];
     1194
    11841195    /*
    11851196     * Validate.
     
    11941205
    11951206    uint16_t    cbIDT;
    1196     RTGCPTR     GCPtrIDT = CPUMGetGuestIDTR(pVM, &cbIDT);
     1207    RTGCPTR     GCPtrIDT = CPUMGetGuestIDTR(pVCpu, &cbIDT);
    11971208    if (iTrap * sizeof(VBOXIDTE) >= cbIDT)
    11981209        return VERR_INVALID_PARAMETER;  /* Silently ignore out of range requests. */
     
    12091220     */
    12101221    VBOXIDTE GuestIdte;
    1211     int rc = PGMPhysSimpleReadGCPtr(pVM, &GuestIdte, GCPtrIDT + iTrap * sizeof(GuestIdte),  sizeof(GuestIdte));
     1222    int rc = PGMPhysSimpleReadGCPtr(pVCpu, &GuestIdte, GCPtrIDT + iTrap * sizeof(GuestIdte),  sizeof(GuestIdte));
    12121223    if (RT_FAILURE(rc))
    12131224    {
     
    13011312VMMR3DECL(bool) TRPMR3IsGateHandler(PVM pVM, RTRCPTR GCPtr)
    13021313{
     1314    /* Only valid in raw mode which implies 1 VCPU */
     1315    Assert(PATMIsEnabled(pVM) && pVM->cCPUs == 1);
     1316    PVMCPU pVCpu = &pVM->aCpus[0];
     1317
    13031318    /*
    13041319     * Read IDTR and calc last entry.
    13051320     */
    13061321    uint16_t    cbIDT;
    1307     RTGCPTR     GCPtrIDTE = CPUMGetGuestIDTR(pVM, &cbIDT);
     1322    RTGCPTR     GCPtrIDTE = CPUMGetGuestIDTR(pVCpu, &cbIDT);
    13081323    unsigned    cEntries = (cbIDT + 1) / sizeof(VBOXIDTE);
    13091324    if (!cEntries)
     
    13221337        PCVBOXIDTE      pIDTE;
    13231338        PGMPAGEMAPLOCK  Lock;
    1324         int rc = PGMPhysGCPtr2CCPtrReadOnly(pVM, GCPtrIDTE, (const void **)&pIDTE, &Lock);
     1339        int rc = PGMPhysGCPtr2CCPtrReadOnly(pVCpu, GCPtrIDTE, (const void **)&pIDTE, &Lock);
    13251340        if (RT_SUCCESS(rc))
    13261341        {
     
    13711386 * @returns VBox status code.
    13721387 * @param   pVM         The VM to operate on.
     1388 * @param   pVCpu       The VMCPU to operate on.
    13731389 * @param   enmEvent    Trpm event type
    13741390 */
    1375 VMMR3DECL(int) TRPMR3InjectEvent(PVM pVM, TRPMEVENT enmEvent)
     1391VMMR3DECL(int) TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent)
    13761392{
    13771393    PCPUMCTX pCtx;
    13781394    int      rc;
    13791395
    1380     pCtx = CPUMQueryGuestCtxPtr(pVM);
     1396    pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    13811397    Assert(!PATMIsPatchGCAddr(pVM, (RTGCPTR)pCtx->eip));
    13821398    Assert(!VM_FF_ISSET(pVM, VM_FF_INHIBIT_INTERRUPTS));
     
    13851401    Assert(enmEvent == TRPM_HARDWARE_INT);
    13861402
    1387     if (REMR3QueryPendingInterrupt(pVM) == REM_NO_PENDING_IRQ)
     1403    if (REMR3QueryPendingInterrupt(pVM, pVCpu) == REM_NO_PENDING_IRQ)
    13881404    {
    13891405#ifdef TRPM_FORWARD_TRAPS_IN_GC
     
    14161432            {
    14171433                /* Must check pending forced actions as our IDT or GDT might be out of sync */
    1418                 rc = EMR3CheckRawForcedActions(pVM);
     1434                rc = EMR3CheckRawForcedActions(pVM, pVCpu);
    14191435                if (rc == VINF_SUCCESS)
    14201436                {
     
    14321448            else
    14331449                STAM_COUNTER_INC(&pVM->trpm.s.StatForwardFailNoHandler);
    1434             REMR3NotifyPendingInterrupt(pVM, u8Interrupt);
     1450            REMR3NotifyPendingInterrupt(pVM, pVCpu, u8Interrupt);
    14351451        }
    14361452        else
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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