VirtualBox

Changeset 14742 in vbox


Ignore:
Timestamp:
Nov 27, 2008 8:49:11 PM (16 years ago)
Author:
vboxsync
Message:

finally fixed timner starvation for real, also REM improvments
by putting external events check into right places and reverted
PIT DRAM refresh rate frequency code to correct one

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPit-i8254.cpp

    r14707 r14742  
    7575 * Define this to flip the 15usec refresh bit on every read.
    7676 * If not defined, it will be flipped correctly. */
    77 #define FAKE_REFRESH_CLOCK
     77/* #define FAKE_REFRESH_CLOCK */
    7878#ifdef DOXYGEN_RUNNING
    7979# define FAKE_REFRESH_CLOCK
     
    648648        /* bit 5 - mirrors timer 2 output condition. */
    649649        const int fOut = pit_get_out(pThis, 2, u64Now);
    650         /* bit 4 - toggled every with each (DRAM?) refresh request, every 15.085 µs. */
     650        /* bit 4 - toggled with each (DRAM?) refresh request, every 15085 µs.
     651                   our timer resolution is around 100-1000 µs, thus we can just flip
     652                   on every increase of quotient by 1
     653         */
    651654#ifdef FAKE_REFRESH_CLOCK
    652655        pThis->dummy_refresh_clock ^= 1;
    653656        const int fRefresh = pThis->dummy_refresh_clock;
    654657#else
    655         /* To make refresh info statistically correct */
    656         const int freq = 15085;
    657         const int fRefresh = ((u64Now % freq ) > (freq / 2)) ? 1 : 0;
     658        const int fRefresh = (u64Now / 15085 ) & 1;
    658659#endif
    659660        /* bit 2,3 NMI / parity status stuff. */
  • trunk/src/recompiler_new/VBoxRecompiler.c

    r14475 r14742  
    14541454bool remR3IsMonitored(CPUState *env, RTGCPTR GCPtr)
    14551455{
    1456     return PGMHandlerIsAddressMonitored(env->pVM, GCPtr);
     1456     return PGMHandlerIsAddressMonitored(env->pVM, GCPtr);
    14571457}
    14581458#endif
     
    15601560void remR3TimersRun(CPUState *env)
    15611561{
     1562    LogFlow(("remR3TimersRun:\n"));
    15621563    remR3ProfileStop(STATS_QEMU_RUN_EMULATED_CODE);
    15631564    remR3ProfileStart(STATS_QEMU_RUN_TIMERS);
     
    39263927    if (pVM->rem.s.fInREM)
    39273928    {
    3928         if (VM_IS_EMT(pVM))
    3929             cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
    3930         else
    3931             ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
    3932                            CPU_INTERRUPT_EXTERNAL_HARD);
     3929        ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
     3930                       CPU_INTERRUPT_EXTERNAL_HARD);
    39333931    }
    39343932}
     
    39623960    if (pVM->rem.s.fInREM)
    39633961    {
    3964         if (VM_IS_EMT(pVM))
    3965             cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
    3966         else
    3967             ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
    3968                            CPU_INTERRUPT_EXTERNAL_TIMER);
     3962        ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
     3963                       CPU_INTERRUPT_EXTERNAL_TIMER);
    39693964    }
    39703965}
     
    39823977    if (pVM->rem.s.fInREM)
    39833978    {
    3984         if (VM_IS_EMT(pVM))
    3985             cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
    3986         else
    3987             ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
    3988                            CPU_INTERRUPT_EXTERNAL_DMA);
     3979        ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
     3980                       CPU_INTERRUPT_EXTERNAL_DMA);
    39893981    }
    39903982}
     
    40023994    if (pVM->rem.s.fInREM)
    40033995    {
    4004         if (VM_IS_EMT(pVM))
    4005             cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
    4006         else
    4007             ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
    4008                            CPU_INTERRUPT_EXTERNAL_EXIT);
     3996        ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
     3997                       CPU_INTERRUPT_EXTERNAL_EXIT);
    40093998    }
    40103999}
     
    40224011    if (pVM->rem.s.fInREM)
    40234012    {
    4024         if (VM_IS_EMT(pVM))
    4025             cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
    4026         else
    4027             ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
    4028                            CPU_INTERRUPT_EXTERNAL_EXIT);
     4013        ASMAtomicOrS32((int32_t volatile *)&cpu_single_env->interrupt_request,
     4014                       CPU_INTERRUPT_EXTERNAL_EXIT);
    40294015    }
    40304016}
  • trunk/src/recompiler_new/exec-all.h

    r14346 r14742  
    385385#  if !defined(REM_PHYS_ADDR_IN_TLB)
    386386target_ulong remR3HCVirt2GCPhys(CPUState *env1, void *addr);
     387#if 0
     388bool         remR3IsVAMonitored(CPUState *env, RTGCPTR GCPtr);
     389bool         remR3IsPAMonitored(CPUState *env, RTGCPHYS GCPhys);
     390#else
    387391bool         remR3IsMonitored(CPUState *env, RTGCPTR GCPtr);
     392#endif
    388393#  endif
    389394# endif
  • trunk/src/recompiler_new/target-i386/translate.c

    r14702 r14742  
    912912    tcg_gen_movi_tl(cpu_tmp0, pc);
    913913    tcg_gen_st_tl(cpu_tmp0, cpu_env, offsetof(CPUState, eip));
    914 #ifdef VBOX
    915     gen_check_external_event2();
    916 #endif
    917914}
    918915
     
    26712668    if ((pc & TARGET_PAGE_MASK) == (tb->pc & TARGET_PAGE_MASK) ||
    26722669        (pc & TARGET_PAGE_MASK) == ((s->pc - 1) & TARGET_PAGE_MASK))  {
     2670#ifdef VBOX
     2671        gen_check_external_event(s);
     2672#endif /* VBOX */
    26732673        /* jump to same page: we can use a direct jump */
    26742674        tcg_gen_goto_tb(tb_num);
     
    26972697    }
    26982698    if (s->jmp_opt) {
    2699 #ifdef VBOX
    2700         gen_check_external_event(s);
    2701 #endif /* VBOX */
    27022699        l1 = gen_new_label();
    27032700        gen_jcc1(s, cc_op, b, l1);
     
    31203117static void gen_eob(DisasContext *s)
    31213118{
     3119#ifdef VBOX
     3120    gen_check_external_event(s);
     3121#endif /* VBOX */
    31223122    if (s->cc_op != CC_OP_DYNAMIC)
    31233123        gen_op_set_cc_op(s->cc_op);
     
    31543154static void gen_jmp(DisasContext *s, target_ulong eip)
    31553155{
    3156 #ifdef VBOX
    3157     gen_check_external_event(s);
    3158 #endif /* VBOX */
    31593156    gen_jmp_tb(s, eip, 0);
    31603157}
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