VirtualBox

vbox的更動 62287 路徑 trunk/src/recompiler


忽略:
時間撮記:
2016-7-15 下午06:44:49 (8 年 以前)
作者:
vboxsync
訊息:

REM: Killed the REMR3NotifyPendingInterrupt interface. Misguided hack for something TRPM should be doing and couldn't because REMR3State wasn't doing it's job wrt TRPM_HARDWARE_INT.

位置:
trunk/src/recompiler
檔案:
修改 3 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/recompiler/VBoxREM.def

    r44528 r62287  
    55
    66;
    7 ; Copyright (C) 2006-2011 Oracle Corporation
     7; Copyright (C) 2006-2016 Oracle Corporation
    88;
    99; This file is part of VirtualBox Open Source Edition (OSE), as
     
    4848    REMR3NotifyCodePageChanged
    4949    REMR3IsPageAccessHandled
    50     REMR3NotifyPendingInterrupt
    51     REMR3QueryPendingInterrupt
    5250
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r60804 r62287  
    55 */
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    376376static DECLCALLBACKPTR(void, pfnREMR3NotifyFF)(PVM);
    377377static DECLCALLBACKPTR(int, pfnREMR3NotifyCodePageChanged)(PVM, PVMCPU, RTGCPTR);
    378 static DECLCALLBACKPTR(void, pfnREMR3NotifyPendingInterrupt)(PVM, PVMCPU, uint8_t);
    379 static DECLCALLBACKPTR(uint32_t, pfnREMR3QueryPendingInterrupt)(PVM, PVMCPU);
    380378static DECLCALLBACKPTR(int, pfnREMR3DisasEnableStepping)(PVM, bool);
    381379static DECLCALLBACKPTR(bool, pfnREMR3IsPageAccessHandled)(PVM, RTGCPHYS);
     
    12001198    { "REMR3NotifyFF",                          (void *)&pfnREMR3NotifyFF,                          &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    12011199    { "REMR3NotifyCodePageChanged",             (void *)&pfnREMR3NotifyCodePageChanged,             &g_aArgsNotifyCodePageChanged[0],           RT_ELEMENTS(g_aArgsNotifyCodePageChanged),             REMFNDESC_FLAGS_RET_INT,    sizeof(int),    NULL },
    1202     { "REMR3NotifyPendingInterrupt",            (void *)&pfnREMR3NotifyPendingInterrupt,            &g_aArgsNotifyPendingInterrupt[0],          RT_ELEMENTS(g_aArgsNotifyPendingInterrupt),            REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    1203     { "REMR3QueryPendingInterrupt",             (void *)&pfnREMR3QueryPendingInterrupt,             &g_aArgsVMandVMCPU[0],                      RT_ELEMENTS(g_aArgsVMandVMCPU),                        REMFNDESC_FLAGS_RET_INT,    sizeof(uint32_t), NULL },
    12041200    { "REMR3DisasEnableStepping",               (void *)&pfnREMR3DisasEnableStepping,               &g_aArgsDisasEnableStepping[0],             RT_ELEMENTS(g_aArgsDisasEnableStepping),               REMFNDESC_FLAGS_RET_INT,    sizeof(int),    NULL },
    12051201    { "REMR3IsPageAccessHandled",               (void *)&pfnREMR3IsPageAccessHandled,               &g_aArgsIsPageAccessHandled[0],             RT_ELEMENTS(g_aArgsIsPageAccessHandled),               REMFNDESC_FLAGS_RET_INT,    sizeof(bool),   NULL }
     
    24482444}
    24492445
    2450 REMR3DECL(void) REMR3NotifyPendingInterrupt(PVM pVM, PVMCPU pVCpu, uint8_t u8Interrupt)
    2451 {
    2452 #ifndef USE_REM_STUBS
    2453     Assert(VALID_PTR(pfnREMR3NotifyPendingInterrupt));
    2454     pfnREMR3NotifyPendingInterrupt(pVM, pVCpu, u8Interrupt);
    2455 #endif
    2456 }
    2457 
    2458 REMR3DECL(uint32_t) REMR3QueryPendingInterrupt(PVM pVM, PVMCPU pVCpu)
    2459 {
    2460 #ifdef USE_REM_STUBS
    2461     return REM_NO_PENDING_IRQ;
    2462 #else
    2463     Assert(VALID_PTR(pfnREMR3QueryPendingInterrupt));
    2464     return pfnREMR3QueryPendingInterrupt(pVM, pVCpu);
    2465 #endif
    2466 }
    2467 
    24682446REMR3DECL(void) REMR3NotifyInterruptSet(PVM pVM, PVMCPU pVCpu)
    24692447{
  • trunk/src/recompiler/VBoxRecompiler.c

    r62286 r62287  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    112112static DECLCALLBACK(int) remR3Save(PVM pVM, PSSMHANDLE pSSM);
    113113static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
     114static DECLCALLBACK(int) remR3LoadDone(PVM pVM, PSSMHANDLE pSSM);
    114115static void     remR3StateUpdate(PVM pVM, PVMCPU pVCpu);
    115116static int      remR3InitPhysRamSizeAndDirtyMap(PVM pVM, bool fGuarded);
     
    352353
    353354    /* Nothing is pending by default */
    354     pVM->rem.s.u32PendingInterrupt = REM_NO_PENDING_IRQ;
     355    pVM->rem.s.uStateLoadPendingInterrupt = REM_NO_PENDING_IRQ;
    355356
    356357    /*
     
    372373                               NULL, NULL, NULL,
    373374                               NULL, remR3Save, NULL,
    374                                NULL, remR3Load, NULL);
     375                               NULL, remR3Load, remR3LoadDone);
    375376    if (RT_FAILURE(rc))
    376377        return rc;
     
    637638    /* Remember if we've entered raw mode (vital for ring 1 checks in e.g. iret emulation). */
    638639    SSMR3PutU32(pSSM, !!(pRem->Env.state & CPU_RAW_RING0));
    639     SSMR3PutU32(pSSM, pVM->rem.s.u32PendingInterrupt);
     640    SSMR3PutU32(pSSM, REM_NO_PENDING_IRQ);
    640641
    641642    return SSMR3PutU32(pSSM, ~0);       /* terminator */
     
    732733    }
    733734
    734     rc = SSMR3GetUInt(pSSM, &pVM->rem.s.u32PendingInterrupt);
    735     if (RT_FAILURE(rc))
    736         return rc;
     735    rc = SSMR3GetUInt(pSSM, &pVM->rem.s.uStateLoadPendingInterrupt);
     736    AssertRCReturn(rc, rc);
     737    AssertLogRelMsgReturn(   pVM->rem.s.uStateLoadPendingInterrupt == REM_NO_PENDING_IRQ
     738                          || pVM->rem.s.uStateLoadPendingInterrupt < 256,
     739                          ("uStateLoadPendingInterrupt=%#x\n", pVM->rem.s.uStateLoadPendingInterrupt),
     740                          VERR_SSM_UNEXPECTED_DATA);
    737741
    738742    /* check the terminator. */
     
    769773}
    770774
     775
     776/**
     777 * @callback_method_impl{FNSSMINTLOADDONE,
     778 *    For pushing misdesigned pending-interrupt mess to TRPM where it belongs. }
     779 */
     780static DECLCALLBACK(int) remR3LoadDone(PVM pVM, PSSMHANDLE pSSM)
     781{
     782    if (pVM->rem.s.uStateLoadPendingInterrupt != REM_NO_PENDING_IRQ)
     783    {
     784        int rc = TRPMAssertTrap(&pVM->aCpus[0], pVM->rem.s.uStateLoadPendingInterrupt, TRPM_HARDWARE_INT);
     785        AssertLogRelMsgReturn(rc, ("uStateLoadPendingInterrupt=%#x rc=%Rrc\n", pVM->rem.s.uStateLoadPendingInterrupt, rc), rc);
     786        pVM->rem.s.uStateLoadPendingInterrupt = REM_NO_PENDING_IRQ;
     787    }
     788    return VINF_SUCCESS;
     789}
    771790
    772791
     
    11191138        pVM->rem.s.Env.interrupt_request = CPU_INTERRUPT_SINGLE_INSTR;
    11201139#endif
    1121         if (   VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC)
    1122             || pVM->rem.s.u32PendingInterrupt != REM_NO_PENDING_IRQ)
     1140        if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC))
    11231141            pVM->rem.s.Env.interrupt_request |= CPU_INTERRUPT_HARD;
    11241142        RTLogPrintf("remR3RunLoggingStep: interrupt_request=%#x halted=%d exception_index=%#x\n",
     
    25202538        APICUpdatePendingInterrupts(pVCpu);
    25212539#endif
    2522     if (    pVM->rem.s.u32PendingInterrupt != REM_NO_PENDING_IRQ
    2523         ||  VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC))
    2524     {
     2540    if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC))
    25252541        pVM->rem.s.Env.interrupt_request |= CPU_INTERRUPT_HARD;
    2526     }
    25272542
    25282543    /*
     
    42424257
    42434258/* -+- FF notifications -+- */
    4244 
    4245 
    4246 /**
    4247  * Notification about a pending interrupt.
    4248  *
    4249  * @param   pVM             VM Handle.
    4250  * @param   pVCpu           VMCPU Handle.
    4251  * @param   u8Interrupt     Interrupt
    4252  * @thread  The emulation thread.
    4253  */
    4254 REMR3DECL(void) REMR3NotifyPendingInterrupt(PVM pVM, PVMCPU pVCpu, uint8_t u8Interrupt)
    4255 {
    4256     Assert(pVM->rem.s.u32PendingInterrupt == REM_NO_PENDING_IRQ);
    4257     pVM->rem.s.u32PendingInterrupt = u8Interrupt;
    4258 }
    4259 
    4260 /**
    4261  * Notification about a pending interrupt.
    4262  *
    4263  * @returns Pending interrupt or REM_NO_PENDING_IRQ
    4264  * @param   pVM             VM Handle.
    4265  * @param   pVCpu           VMCPU Handle.
    4266  * @thread  The emulation thread.
    4267  */
    4268 REMR3DECL(uint32_t) REMR3QueryPendingInterrupt(PVM pVM, PVMCPU pVCpu)
    4269 {
    4270     return pVM->rem.s.u32PendingInterrupt;
    4271 }
    42724259
    42734260/**
     
    45214508     */
    45224509    /* Note! We assume we will go directly to the recompiler to handle the pending interrupt! */
    4523     /** @todo r=bird: In the long run we should just do the interrupt handling in EM/CPUM/TRPM/somewhere and
    4524      * if we cannot execute the interrupt handler in raw-mode just reschedule to REM. Once that is done we
    4525      * remove this kludge. */
    4526     if (env->pVM->rem.s.u32PendingInterrupt != REM_NO_PENDING_IRQ)
    4527     {
    4528         rc = VINF_SUCCESS;
    4529         Assert(env->pVM->rem.s.u32PendingInterrupt <= 255);
    4530         u8Interrupt = env->pVM->rem.s.u32PendingInterrupt;
    4531         env->pVM->rem.s.u32PendingInterrupt = REM_NO_PENDING_IRQ;
    4532     }
    4533     else
    4534         rc = PDMGetInterrupt(env->pVCpu, &u8Interrupt);
    4535 
     4510    rc = PDMGetInterrupt(env->pVCpu, &u8Interrupt);
    45364511    LogFlow(("cpu_get_pic_interrupt: u8Interrupt=%d rc=%Rrc pc=%04x:%08llx ~flags=%08llx\n",
    45374512             u8Interrupt, rc, env->segs[R_CS].selector, (uint64_t)env->eip, (uint64_t)env->eflags));
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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