Changeset 980 in vbox
- Timestamp:
- Feb 19, 2007 2:45:38 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18765
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/REMInternal.h
r164 r980 158 158 * I.e. the correct CPU state and some other bits are with REM. */ 159 159 bool fInREM; 160 160 /** In REMR3State. */ 161 bool fInStateSync; 162 163 /** Ignore all that can be ignored. */ 164 bool fIgnoreAll; 161 165 /** Ignore CR3 load notifications from the REM. */ 162 166 bool fIgnoreCR3Load; … … 165 169 /** Ignore CR0, CR4 and EFER load. */ 166 170 bool fIgnoreCpuMode; 171 /** Ignore set page. */ 172 bool fIgnoreSetPage; 173 167 174 /** Number of times REMR3CanExecuteRaw has been called. 168 175 * It is used to prevent rescheduling on the first call. */ … … 172 179 RTUINT u32PendingInterrupt; 173 180 174 #if HC_ARCH_BITS == 32175 /** Padding for MS / GC alignment difference. */181 #if HC_ARCH_BITS == 64 182 /** Alignment padding. */ 176 183 uint32_t u32Padding; 177 184 #endif … … 186 193 /** Array of recorded handler noticications. 187 194 * These are replayed when entering REM. */ 188 REMHANDLERNOTIFICATION aHandlerNotifications[32]; 195 // REMHANDLERNOTIFICATION aHandlerNotifications[32]; 196 REMHANDLERNOTIFICATION aHandlerNotifications[12]; 189 197 190 198 /** Pointer to an array of hc virt to gc phys records. */ … … 228 236 #if HC_ARCH_BITS != 32 229 237 /** Padding the CPUX86State structure to 32 byte. */ 230 uint32_t abPadding[HC_ARCH_BITS == 32 ? 0 : 6];238 uint32_t abPadding[HC_ARCH_BITS == 32 ? 0 : 4]; 231 239 #endif 232 240 -
trunk/src/recompiler/new/VBoxRecompiler.c
r841 r980 253 253 */ 254 254 AssertReleaseMsg(sizeof(pVM->rem.padding) >= sizeof(pVM->rem.s), ("%#x >= %#x; sizeof(Env)=%#x\n", sizeof(pVM->rem.padding), sizeof(pVM->rem.s), sizeof(pVM->rem.s.Env))); 255 //AssertReleaseMsg(sizeof(pVM->rem.s.Env) <= REM_ENV_SIZE, ("%#x == %#x\n", sizeof(pVM->rem.s.Env), REM_ENV_SIZE));255 AssertReleaseMsg(sizeof(pVM->rem.s.Env) <= REM_ENV_SIZE, ("%#x == %#x\n", sizeof(pVM->rem.s.Env), REM_ENV_SIZE)); 256 256 AssertReleaseMsg(!(RT_OFFSETOF(VM, rem) & 31), ("off=%#x\n", RT_OFFSETOF(VM, rem))); 257 257 Assert(!testmath()); … … 285 285 AssertMsg(MMR3PhysGetRamSize(pVM) == 0, ("Init order have changed! REM depends on notification about ALL physical memory registrations\n")); 286 286 287 /* ignore all notifications */ 288 pVM->rem.s.fIgnoreAll = true; 289 287 290 /* 288 291 * Init the recompiler. … … 319 322 AssertReleaseMsg(pVM->rem.s.iHandlerMemType >= 0, ("pVM->rem.s.iHandlerMemType=%d\n", pVM->rem.s.iHandlerMemType)); 320 323 Log2(("REM: iMMIOMemType=%d iHandlerMemType=%d\n", pVM->rem.s.iMMIOMemType, pVM->rem.s.iHandlerMemType)); 324 325 /* stop ignoring. */ 326 pVM->rem.s.fIgnoreAll = false; 321 327 322 328 /* … … 422 428 REMR3DECL(void) REMR3Reset(PVM pVM) 423 429 { 424 pVM->rem.s.fIgnoreCR3Load = true;425 pVM->rem.s.fIgnoreInvlPg = true;426 pVM->rem.s.fIgnoreCpuMode = true;427 428 430 /* 429 431 * Reset the REM cpu. 430 432 */ 433 pVM->rem.s.fIgnoreAll = true; 431 434 cpu_reset(&pVM->rem.s.Env); 432 435 pVM->rem.s.cInvalidatedPages = 0; 433 434 pVM->rem.s.fIgnoreCR3Load = false; 435 pVM->rem.s.fIgnoreInvlPg = false; 436 pVM->rem.s.fIgnoreCpuMode = false; 436 pVM->rem.s.fIgnoreAll = false; 437 437 } 438 438 … … 502 502 /* 503 503 * Ignore all ignorable notifications. 504 * Not doing this will cause big trouble. 505 */ 506 pVM->rem.s.fIgnoreCR3Load = true; 507 pVM->rem.s.fIgnoreInvlPg = true; 508 pVM->rem.s.fIgnoreCpuMode = true; 504 * (Not doing this will cause serious trouble.) 505 */ 506 pVM->rem.s.fIgnoreAll = true; 509 507 510 508 /* … … 576 574 * Stop ignoring ignornable notifications. 577 575 */ 578 pVM->rem.s.fIgnoreCpuMode = false; 579 pVM->rem.s.fIgnoreInvlPg = false; 580 pVM->rem.s.fIgnoreCR3Load = false; 576 pVM->rem.s.fIgnoreAll = false; 581 577 582 578 return VINF_SUCCESS; … … 1337 1333 * state we disable this path. 1338 1334 */ 1339 if (pVM->rem.s.fIgnoreInvlPg )1335 if (pVM->rem.s.fIgnoreInvlPg || pVM->rem.s.fIgnoreAll) 1340 1336 return; 1341 1337 Log(("remR3FlushPage: GCPtr=%VGv\n", GCPtr)); 1338 Assert(pVM->rem.s.fInREM); 1342 1339 1343 1340 //RAWEx_ProfileStop(env, STATS_QEMU_TOTAL); … … 1371 1368 { 1372 1369 target_ulong phys_addr, virt_addr, addend; 1370 if (env->pVM->rem.s.fIgnoreSetPage || env->pVM->rem.s.fIgnoreAll) 1371 return; 1372 Assert(env->pVM->rem.s.fInREM || env->pVM->rem.s.fInStateSync); 1373 1373 1374 1374 if(!is_user && !(env->state & CPU_RAW_RING0)) … … 1472 1472 void remR3ProtectCode(CPUState *env, RTGCPTR GCPtr) 1473 1473 { 1474 Assert(env->pVM->rem.s.fInREM); 1474 1475 if ( (env->cr[0] & X86_CR0_PG) /* paging must be enabled */ 1475 1476 && !(env->state & CPU_EMULATE_SINGLE_INSTR) /* ignore during single instruction execution */ … … 1495 1496 * state we disable this path. 1496 1497 */ 1497 if (pVM->rem.s.fIgnoreCR3Load )1498 if (pVM->rem.s.fIgnoreCR3Load || pVM->rem.s.fIgnoreAll) 1498 1499 return; 1500 Assert(pVM->rem.s.fInREM); 1499 1501 1500 1502 /* … … 1534 1536 * state this path is disabled. 1535 1537 */ 1536 if (pVM->rem.s.fIgnoreCpuMode )1538 if (pVM->rem.s.fIgnoreCpuMode || pVM->rem.s.fIgnoreAll) 1537 1539 return; 1540 Assert(pVM->rem.s.fInREM); 1538 1541 1539 1542 /* … … 1677 1680 register const CPUMCTX *pCtx = pVM->rem.s.pCtx; 1678 1681 register unsigned fFlags; 1682 1683 pVM->rem.s.fInStateSync = true; 1679 1684 1680 1685 /* … … 2076 2081 */ 2077 2082 pVM->rem.s.fInREM = true; 2083 pVM->rem.s.fInStateSync = false; 2078 2084 pVM->rem.s.cCanExecuteRaw = 0; 2079 2085 STAM_PROFILE_STOP(&pVM->rem.s.StatsState, a); … … 2625 2631 * Register the ram. 2626 2632 */ 2633 Assert(!pVM->rem.s.fIgnoreAll); 2634 pVM->rem.s.fIgnoreAll = true; 2635 2627 2636 AssertRelease(phys_ram_base); 2628 2637 cpu_register_physical_memory(GCPhys, cb, ((uintptr_t)pvRam - (uintptr_t)phys_ram_base) 2629 2638 | (fFlags & MM_RAM_FLAGS_RESERVED ? IO_MEM_UNASSIGNED : 0)); 2639 Assert(pVM->rem.s.fIgnoreAll); 2640 pVM->rem.s.fIgnoreAll = false; 2630 2641 } 2631 2642 … … 2656 2667 * Register the rom. 2657 2668 */ 2669 Assert(!pVM->rem.s.fIgnoreAll); 2670 pVM->rem.s.fIgnoreAll = true; 2671 2658 2672 AssertRelease(phys_ram_base); 2659 2673 cpu_register_physical_memory(GCPhys, cb, ((uintptr_t)pvCopy - (uintptr_t)phys_ram_base) | IO_MEM_ROM); 2660 2674 Log2(("%.64Vhxd\n", (char *)pvCopy + cb - 64)); 2675 2676 Assert(pVM->rem.s.fIgnoreAll); 2677 pVM->rem.s.fIgnoreAll = false; 2661 2678 } 2662 2679 … … 2684 2701 * Unassigning the memory. 2685 2702 */ 2703 Assert(!pVM->rem.s.fIgnoreAll); 2704 pVM->rem.s.fIgnoreAll = true; 2705 2686 2706 cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED); 2707 2708 Assert(pVM->rem.s.fIgnoreAll); 2709 pVM->rem.s.fIgnoreAll = false; 2687 2710 } 2688 2711 … … 2708 2731 Assert(RT_ALIGN_T(cb, PAGE_SIZE, RTGCPHYS) == cb); 2709 2732 2710 bool fIgnoreCR3Load = pVM->rem.s.fIgnoreCR3Load;2711 pVM->rem.s.fIgnoreCR3Load = true;2712 2713 2733 if (pVM->rem.s.cHandlerNotifications) 2714 2734 REMR3ReplayHandlerNotifications(pVM); 2735 2736 Assert(!pVM->rem.s.fIgnoreAll); 2737 pVM->rem.s.fIgnoreAll = true; 2715 2738 2716 2739 if (enmType == PGMPHYSHANDLERTYPE_MMIO) … … 2719 2742 cpu_register_physical_memory(GCPhys, cb, pVM->rem.s.iHandlerMemType); 2720 2743 2721 pVM->rem.s.fIgnoreCR3Load = fIgnoreCR3Load; 2744 Assert(pVM->rem.s.fIgnoreAll); 2745 pVM->rem.s.fIgnoreAll = false; 2722 2746 } 2723 2747 … … 2739 2763 VM_ASSERT_EMT(pVM); 2740 2764 2741 bool fIgnoreCR3Load = pVM->rem.s.fIgnoreCR3Load;2742 pVM->rem.s.fIgnoreCR3Load = true;2743 2744 2765 if (pVM->rem.s.cHandlerNotifications) 2745 2766 REMR3ReplayHandlerNotifications(pVM); 2767 2768 Assert(!pVM->rem.s.fIgnoreAll); 2769 pVM->rem.s.fIgnoreAll = true; 2746 2770 2747 2771 if (enmType == PGMPHYSHANDLERTYPE_MMIO) … … 2764 2788 } 2765 2789 2766 pVM->rem.s.fIgnoreCR3Load = fIgnoreCR3Load; 2790 Assert(pVM->rem.s.fIgnoreAll); 2791 pVM->rem.s.fIgnoreAll = false; 2767 2792 } 2768 2793 … … 2786 2811 AssertReleaseMsg(enmType != PGMPHYSHANDLERTYPE_MMIO, ("enmType=%d\n", enmType)); 2787 2812 2788 bool fIgnoreCR3Load = pVM->rem.s.fIgnoreCR3Load;2789 pVM->rem.s.fIgnoreCR3Load = true;2790 2791 2813 if (pVM->rem.s.cHandlerNotifications) 2792 2814 REMR3ReplayHandlerNotifications(pVM); … … 2794 2816 if (fHasHCHandler) 2795 2817 { 2818 Assert(!pVM->rem.s.fIgnoreAll); 2819 pVM->rem.s.fIgnoreAll = true; 2820 2796 2821 /* 2797 2822 * Reset the old page. … … 2815 2840 Assert(RT_ALIGN_T(cb, PAGE_SIZE, RTGCPHYS) == cb); 2816 2841 cpu_register_physical_memory(GCPhysNew, cb, pVM->rem.s.iHandlerMemType); 2817 } 2818 2819 pVM->rem.s.fIgnoreCR3Load = fIgnoreCR3Load; 2842 2843 Assert(pVM->rem.s.fIgnoreAll); 2844 pVM->rem.s.fIgnoreAll = false; 2845 } 2820 2846 } 2821 2847
Note:
See TracChangeset
for help on using the changeset viewer.