Changeset 45533 in vbox
- Timestamp:
- Apr 13, 2013 4:13:22 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
include/VBox/vmm/selm.h (modified) (2 diffs)
-
include/VBox/vmm/trpm.h (modified) (1 diff)
-
include/VBox/vmm/vm.h (modified) (6 diffs)
-
src/VBox/VMM/VMMAll/EMAll.cpp (modified) (1 diff)
-
src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h (modified) (1 diff)
-
src/VBox/VMM/VMMR3/DBGF.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/EM.cpp (modified) (6 diffs)
-
src/VBox/VMM/VMMR3/EMHM.cpp (modified) (3 diffs)
-
src/VBox/VMM/VMMR3/HM.cpp (modified) (1 diff)
-
src/VBox/VMM/VMMR3/SELM.cpp (modified) (30 diffs)
-
src/VBox/VMM/VMMR3/TRPM.cpp (modified) (20 diffs)
-
src/VBox/VMM/VMMR3/VMM.cpp (modified) (1 diff)
-
src/VBox/VMM/VMMR3/VMMTests.cpp (modified) (2 diffs)
-
src/VBox/VMM/include/SELMInternal.h (modified) (2 diffs)
-
src/recompiler/VBoxRecompiler.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/selm.h
r45276 r45533 95 95 VMMR3DECL(int) SELMR3Term(PVM pVM); 96 96 VMMR3DECL(void) SELMR3Reset(PVM pVM); 97 # ifdef VBOX_WITH_RAW_MODE 98 VMMR3DECL(void) SELMR3DisableMonitoring(PVM pVM); 97 99 VMMR3DECL(VBOXSTRICTRC) SELMR3UpdateFromCPUM(PVM pVM, PVMCPU pVCpu); 98 100 VMMR3DECL(int) SELMR3SyncTSS(PVM pVM, PVMCPU pVCpu); 101 # endif 99 102 VMMR3DECL(int) SELMR3GetSelectorInfo(PVM pVM, PVMCPU pVCpu, RTSEL Sel, PDBGFSELINFO pSelInfo); 100 103 VMMR3DECL(int) SELMR3GetShadowSelectorInfo(PVM pVM, RTSEL Sel, PDBGFSELINFO pSelInfo); 101 VMMR3DECL(void) SELMR3DisableMonitoring(PVM pVM);102 104 VMMR3DECL(void) SELMR3DumpDescriptor(X86DESC Desc, RTSEL Sel, const char *pszMsg); 103 105 VMMR3DECL(void) SELMR3DumpHyperGDT(PVM pVM); … … 107 109 VMMR3DECL(bool) SELMR3CheckTSS(PVM pVM); 108 110 VMMR3DECL(int) SELMR3DebugCheck(PVM pVM); 109 # ifdef VBOX_WITH_SAFE_STR111 # ifdef VBOX_WITH_SAFE_STR 110 112 VMMR3DECL(bool) SELMR3CheckShadowTR(PVM pVM); 111 # endif113 # endif 112 114 113 115 /** @def SELMR3_DEBUG_CHECK -
trunk/include/VBox/vmm/trpm.h
r45531 r45533 101 101 VMMR3DECL(void) TRPMR3Reset(PVM pVM); 102 102 VMMR3DECL(int) TRPMR3Term(PVM pVM); 103 VMMR3DECL(void) TRPMR3DisableMonitoring(PVM pVM);104 VMMR3DECL(int) TRPMR3SyncIDT(PVM pVM, PVMCPU pVCpu);105 103 VMMR3DECL(int) TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent); 106 104 # ifdef VBOX_WITH_RAW_MODE 105 VMMR3DECL(void) TRPMR3DisableMonitoring(PVM pVM); 107 106 VMMR3_INT_DECL(int) TRPMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue); 107 VMMR3DECL(int) TRPMR3SyncIDT(PVM pVM, PVMCPU pVCpu); 108 108 VMMR3DECL(bool) TRPMR3IsGateHandler(PVM pVM, RTRCPTR GCPtr); 109 109 VMMR3DECL(uint32_t) TRPMR3QueryGateByHandler(PVM pVM, RTRCPTR GCPtr); -
trunk/include/VBox/vmm/vm.h
r45301 r45533 271 271 /** The name of the Ring 0 Context VMM Core module. */ 272 272 #define VMMR0_MAIN_MODULE_NAME "VMMR0.r0" 273 274 /** 275 * Wrapper macro for avoiding too much \#ifdef VBOX_WITH_RAW_MODE. 276 */ 277 #ifdef VBOX_WITH_RAW_MODE 278 # define VM_WHEN_RAW_MODE(a_WithExpr, a_WithoutExpr) a_WithExpr 279 #else 280 # define VM_WHEN_RAW_MODE(a_WithExpr, a_WithoutExpr) a_WithoutExpr 281 #endif 282 273 283 274 284 /** VM Forced Action Flags. … … 370 380 /** The bit number for VMCPU_FF_TLB_FLUSH. */ 371 381 #define VMCPU_FF_TLB_FLUSH_BIT 19 382 #ifdef VBOX_WITH_RAW_MODE 372 383 /** Check the interrupt and trap gates */ 373 # define VMCPU_FF_TRPM_SYNC_IDTRT_BIT_32(20)384 # define VMCPU_FF_TRPM_SYNC_IDT RT_BIT_32(20) 374 385 /** Check Guest's TSS ring 0 stack */ 375 # define VMCPU_FF_SELM_SYNC_TSSRT_BIT_32(21)386 # define VMCPU_FF_SELM_SYNC_TSS RT_BIT_32(21) 376 387 /** Check Guest's GDT table */ 377 # define VMCPU_FF_SELM_SYNC_GDTRT_BIT_32(22)388 # define VMCPU_FF_SELM_SYNC_GDT RT_BIT_32(22) 378 389 /** Check Guest's LDT table */ 379 #define VMCPU_FF_SELM_SYNC_LDT RT_BIT_32(23) 390 # define VMCPU_FF_SELM_SYNC_LDT RT_BIT_32(23) 391 #endif /* VBOX_WITH_RAW_MODE */ 380 392 /** Inhibit interrupts pending. See EMGetInhibitInterruptsPC(). */ 381 393 #define VMCPU_FF_INHIBIT_INTERRUPTS RT_BIT_32(24) 394 #ifdef VBOX_WITH_RAW_MODE 382 395 /** CSAM needs to scan the page that's being executed */ 383 # define VMCPU_FF_CSAM_SCAN_PAGERT_BIT_32(26)396 # define VMCPU_FF_CSAM_SCAN_PAGE RT_BIT_32(26) 384 397 /** CSAM needs to do some homework. */ 385 #define VMCPU_FF_CSAM_PENDING_ACTION RT_BIT_32(27) 398 # define VMCPU_FF_CSAM_PENDING_ACTION RT_BIT_32(27) 399 #endif /* VBOX_WITH_RAW_MODE */ 386 400 /** Force return to Ring-3. */ 387 401 #define VMCPU_FF_TO_R3 RT_BIT_32(28) … … 396 410 | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA | VM_FF_EMT_RENDEZVOUS) 397 411 /** Externally forced VMCPU actions. Used to quit the idle/wait loop. */ 398 #define VMCPU_FF_EXTERNAL_HALTED_MASK (VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_REQUEST | VMCPU_FF_TIMER) 412 #define VMCPU_FF_EXTERNAL_HALTED_MASK ( VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_REQUEST \ 413 | VMCPU_FF_TIMER) 399 414 400 415 /** High priority VM pre-execution actions. */ 401 416 #define VM_FF_HIGH_PRIORITY_PRE_MASK ( VM_FF_CHECK_VM_STATE | VM_FF_DBGF | VM_FF_TM_VIRTUAL_SYNC \ 402 | VM_FF_DEBUG_SUSPEND | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS) 417 | VM_FF_DEBUG_SUSPEND | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY \ 418 | VM_FF_EMT_RENDEZVOUS) 403 419 /** High priority VMCPU pre-execution actions. */ 404 #define VMCPU_FF_HIGH_PRIORITY_PRE_MASK ( VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 \ 405 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT \ 406 | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT | VMCPU_FF_INHIBIT_INTERRUPTS) 420 #define VMCPU_FF_HIGH_PRIORITY_PRE_MASK ( VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC \ 421 | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL \ 422 | VMCPU_FF_INHIBIT_INTERRUPTS \ 423 | VM_WHEN_RAW_MODE( VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT \ 424 | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT, 0 ) ) 407 425 408 426 /** High priority VM pre raw-mode execution mask. */ 409 427 #define VM_FF_HIGH_PRIORITY_PRE_RAW_MASK (VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY) 410 428 /** High priority VMCPU pre raw-mode execution mask. */ 411 #define VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK ( VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT \ 412 | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT | VMCPU_FF_INHIBIT_INTERRUPTS) 429 #define VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK ( VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL \ 430 | VMCPU_FF_INHIBIT_INTERRUPTS \ 431 | VM_WHEN_RAW_MODE( VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT \ 432 | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT, 0) ) 413 433 414 434 /** High priority post-execution actions. */ 415 435 #define VM_FF_HIGH_PRIORITY_POST_MASK (VM_FF_PGM_NO_MEMORY) 416 436 /** High priority post-execution actions. */ 417 #define VMCPU_FF_HIGH_PRIORITY_POST_MASK ( VMCPU_FF_PDM_CRITSECT | VM CPU_FF_CSAM_PENDING_ACTION\437 #define VMCPU_FF_HIGH_PRIORITY_POST_MASK ( VMCPU_FF_PDM_CRITSECT | VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_PENDING_ACTION, 0) \ 418 438 | VMCPU_FF_HM_UPDATE_CR3 | VMCPU_FF_HM_UPDATE_PAE_PDPES) 419 439 … … 422 442 | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS) 423 443 /** Normal priority VMCPU post-execution actions. */ 424 #define VMCPU_FF_NORMAL_PRIORITY_POST_MASK (VMCPU_FF_CSAM_SCAN_PAGE)444 #define VMCPU_FF_NORMAL_PRIORITY_POST_MASK VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_SCAN_PAGE, 0) 425 445 426 446 /** Normal priority VM actions. */ 427 #define VM_FF_NORMAL_PRIORITY_MASK (VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA | VM_FF_REM_HANDLER_NOTIFY | VM_FF_EMT_RENDEZVOUS) 447 #define VM_FF_NORMAL_PRIORITY_MASK ( VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA | VM_FF_REM_HANDLER_NOTIFY \ 448 | VM_FF_EMT_RENDEZVOUS) 428 449 /** Normal priority VMCPU actions. */ 429 450 #define VMCPU_FF_NORMAL_PRIORITY_MASK (VMCPU_FF_REQUEST) … … 433 454 434 455 /** VM Flags that cause the HM loops to go back to ring-3. */ 435 #define VM_FF_HM_TO_R3_MASK (VM_FF_TM_VIRTUAL_SYNC | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY | VM_FF_PDM_QUEUES | VM_FF_EMT_RENDEZVOUS) 456 #define VM_FF_HM_TO_R3_MASK ( VM_FF_TM_VIRTUAL_SYNC | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY \ 457 | VM_FF_PDM_QUEUES | VM_FF_EMT_RENDEZVOUS) 436 458 /** VMCPU Flags that cause the HM loops to go back to ring-3. */ 437 #define VMCPU_FF_HM_TO_R3_MASK (VMCPU_FF_TO_R3 | VMCPU_FF_TIMER | VMCPU_FF_PDM_CRITSECT)459 #define VMCPU_FF_HM_TO_R3_MASK (VMCPU_FF_TO_R3 | VMCPU_FF_TIMER | VMCPU_FF_PDM_CRITSECT) 438 460 439 461 /** All the forced VM flags. */ … … 447 469 /** All the forced VMCPU flags except those related to raw-mode and hardware 448 470 * assisted execution. */ 449 #define VMCPU_FF_ALL_REM_MASK (~(VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK | VMCPU_FF_CSAM_PENDING_ACTION | VMCPU_FF_PDM_CRITSECT | VMCPU_FF_TLB_FLUSH | VMCPU_FF_TLB_SHOOTDOWN)) 450 471 #define VMCPU_FF_ALL_REM_MASK (~( VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK | VMCPU_FF_PDM_CRITSECT \ 472 | VMCPU_FF_TLB_FLUSH | VMCPU_FF_TLB_SHOOTDOWN \ 473 | VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_PENDING_ACTION, 0) )) 451 474 /** @} */ 452 475 -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r45528 r45533 1537 1537 } 1538 1538 # endif 1539 # ifdef VBOX_WITH_RAW_MODE 1539 1540 if ((val ^ oldval) & X86_CR4_VME) 1540 1541 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 1542 # endif 1541 1543 1542 1544 rc2 = PGMChangeMode(pVCpu, CPUMGetGuestCR0(pVCpu), CPUMGetGuestCR4(pVCpu), CPUMGetGuestEFER(pVCpu)); -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r45305 r45533 3416 3416 Log(("iemCImpl_load_CrX: VME %d -> %d => Setting VMCPU_FF_SELM_SYNC_TSS\n", 3417 3417 RT_BOOL(uOldCrX & X86_CR4_VME), RT_BOOL(uNewCrX & X86_CR4_VME) )); 3418 #ifdef VBOX_WITH_RAW_MODE 3418 3419 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 3420 #endif 3419 3421 } 3420 3422 -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r45006 r45533 364 364 if (pVM->dbgf.s.enmVMMCmd != DBGFCMD_NO_COMMAND) 365 365 { 366 #ifdef VBOX_WITH_RAW_MODE 366 367 /** @todo stupid GDT/LDT sync hack. go away! */ 367 368 SELMR3UpdateFromCPUM(pVM, pVCpu); 369 #endif 368 370 369 371 /* … … 671 673 LogFlow(("dbgfR3VMMWait:\n")); 672 674 675 #ifdef VBOX_WITH_RAW_MODE 673 676 /** @todo stupid GDT/LDT sync hack. go away! */ 674 677 SELMR3UpdateFromCPUM(pVM, pVCpu); 678 #endif 675 679 int rcRet = VINF_SUCCESS; 676 680 -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r45528 r45533 1147 1147 TMTimerPollVoid(pVM, pVCpu); 1148 1148 #endif 1149 AssertCompile( (VMCPU_FF_ALL_REM_MASK & ~(VMCPU_FF_CSAM_PENDING_ACTION | VMCPU_FF_CSAM_SCAN_PAGE))& VMCPU_FF_TIMER);1149 AssertCompile(VMCPU_FF_ALL_REM_MASK & VMCPU_FF_TIMER); 1150 1150 if ( VM_FF_ISPENDING(pVM, VM_FF_ALL_REM_MASK) 1151 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_ALL_REM_MASK & ~(VMCPU_FF_CSAM_PENDING_ACTION | VMCPU_FF_CSAM_SCAN_PAGE))) 1151 || VMCPU_FF_ISPENDING(pVCpu, 1152 VMCPU_FF_ALL_REM_MASK 1153 & VM_WHEN_RAW_MODE(~(VMCPU_FF_CSAM_PENDING_ACTION | VMCPU_FF_CSAM_SCAN_PAGE), UINT32_MAX)) ) 1152 1154 { 1153 1155 l_REMDoForcedActions: … … 1531 1533 */ 1532 1534 if ( VM_FF_ISPENDING(pVM, VM_FF_NORMAL_PRIORITY_POST_MASK) 1533 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_NORMAL_PRIORITY_POST_MASK))1535 || (VMCPU_FF_NORMAL_PRIORITY_POST_MASK && VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_NORMAL_PRIORITY_POST_MASK)) ) 1534 1536 { 1535 1537 /* … … 1595 1597 } 1596 1598 1599 #ifdef VBOX_WITH_RAW_MODE 1597 1600 /* 1598 1601 * CSAM page scanning. … … 1606 1609 Log(("Forced action VMCPU_FF_CSAM_SCAN_PAGE\n")); 1607 1610 1608 #ifdef VBOX_WITH_RAW_MODE1609 1611 CSAMR3CheckCodeEx(pVM, CPUMCTX2CORE(pCtx), pCtx->eip); 1610 1612 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_CSAM_SCAN_PAGE); 1611 #endif 1612 } 1613 } 1614 #endif 1613 1615 1614 1616 /* … … 1625 1627 /* check that we got them all */ 1626 1628 AssertCompile(VM_FF_NORMAL_PRIORITY_POST_MASK == (VM_FF_CHECK_VM_STATE | VM_FF_DBGF | VM_FF_RESET | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS)); 1627 AssertCompile(VMCPU_FF_NORMAL_PRIORITY_POST_MASK == VM CPU_FF_CSAM_SCAN_PAGE);1629 AssertCompile(VMCPU_FF_NORMAL_PRIORITY_POST_MASK == VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_SCAN_PAGE, 0)); 1628 1630 } 1629 1631 … … 1923 1925 /* check that we got them all */ 1924 1926 AssertCompile(VM_FF_HIGH_PRIORITY_PRE_MASK == (VM_FF_TM_VIRTUAL_SYNC | VM_FF_DBGF | VM_FF_CHECK_VM_STATE | VM_FF_DEBUG_SUSPEND | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS)); 1925 AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_ SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT | VMCPU_FF_INHIBIT_INTERRUPTS));1927 AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_INHIBIT_INTERRUPTS | VM_WHEN_RAW_MODE(VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT, 0))); 1926 1928 } 1927 1929 -
trunk/src/VBox/VMM/VMMR3/EMHM.cpp
r45305 r45533 403 403 return rc; 404 404 405 #ifdef VBOX_WITH_RAW_MODE 405 406 Assert(!VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT)); 407 #endif 406 408 407 409 /* Prefetch pages for EIP and ESP. */ … … 422 424 } 423 425 /** @todo maybe prefetch the supervisor stack page as well */ 426 #ifdef VBOX_WITH_RAW_MODE 424 427 Assert(!VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT)); 428 #endif 425 429 } 426 430 … … 494 498 * Process high priority pre-execution raw-mode FFs. 495 499 */ 500 #ifdef VBOX_WITH_RAW_MODE 501 /** @todo change this FF hack into an assertion, they simply SHALL NOT be set in 502 * HM mode. */ 496 503 VMCPU_FF_CLEAR(pVCpu, (VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_TSS)); /* not relevant in HM mode; shouldn't be set really. */ 504 #endif 497 505 if ( VM_FF_ISPENDING(pVM, VM_FF_HIGH_PRIORITY_PRE_RAW_MASK) 498 506 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK)) -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r45531 r45533 728 728 PATMR3AllowPatching(pVM->pUVM, false); 729 729 CSAMDisableScanning(pVM); 730 #endif731 730 732 731 /* Turn off IDT/LDT/GDT and TSS monitoring and sycing. */ 733 732 SELMR3DisableMonitoring(pVM); 734 733 TRPMR3DisableMonitoring(pVM); 734 #endif 735 735 736 736 /* Disable the switcher code (safety precaution). */ -
trunk/src/VBox/VMM/VMMR3/SELM.cpp
r45485 r45533 237 237 STAM_REL_REG(pVM, &pVM->selm.s.StatLoadHidSelGstNoGood, STAMTYPE_COUNTER, "/SELM/LoadHidSel/NoGoodGuest", STAMUNIT_OCCURENCES, "SELMLoadHiddenSelectorReg: No good guest table entry."); 238 238 239 #ifdef VBOX_WITH_RAW_MODE 239 240 /* 240 241 * Default action when entering raw mode for the first time … … 244 245 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_GDT); 245 246 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_LDT); 247 #endif 246 248 247 249 /* … … 267 269 VMMR3DECL(int) SELMR3InitFinalize(PVM pVM) 268 270 { 271 #ifdef VBOX_WITH_RAW_MODE 269 272 /** @cfgm{/DoubleFault,bool,false} 270 273 * Enables catching of double faults in the raw-mode context VMM code. This can … … 299 302 AssertRC(rc); 300 303 } 304 #endif /* VBOX_WITH_RAW_MODE */ 301 305 return VINF_SUCCESS; 302 306 } … … 596 600 pVM->selm.s.fSyncTSSRing0Stack = false; 597 601 602 #ifdef VBOX_WITH_RAW_MODE 598 603 /* 599 604 * Default action when entering raw mode for the first time … … 603 608 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_GDT); 604 609 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_LDT); 605 } 606 610 #endif 611 } 612 613 614 #ifdef VBOX_WITH_RAW_MODE 607 615 /** 608 616 * Disable GDT/LDT/TSS monitoring and syncing … … 618 626 if (pVM->selm.s.GuestGdtr.pGdt != RTRCPTR_MAX && pVM->selm.s.fGDTRangeRegistered) 619 627 { 620 # ifdef SELM_TRACK_GUEST_GDT_CHANGES628 # ifdef SELM_TRACK_GUEST_GDT_CHANGES 621 629 rc = PGMHandlerVirtualDeregister(pVM, pVM->selm.s.GuestGdtr.pGdt); 622 630 AssertRC(rc); 623 # endif631 # endif 624 632 pVM->selm.s.GuestGdtr.pGdt = RTRCPTR_MAX; 625 633 pVM->selm.s.GuestGdtr.cbGdt = 0; … … 628 636 if (pVM->selm.s.GCPtrGuestLdt != RTRCPTR_MAX) 629 637 { 630 # ifdef SELM_TRACK_GUEST_LDT_CHANGES638 # ifdef SELM_TRACK_GUEST_LDT_CHANGES 631 639 rc = PGMHandlerVirtualDeregister(pVM, pVM->selm.s.GCPtrGuestLdt); 632 640 AssertRC(rc); 633 # endif641 # endif 634 642 pVM->selm.s.GCPtrGuestLdt = RTRCPTR_MAX; 635 643 } 636 644 if (pVM->selm.s.GCPtrGuestTss != RTRCPTR_MAX) 637 645 { 638 # ifdef SELM_TRACK_GUEST_TSS_CHANGES646 # ifdef SELM_TRACK_GUEST_TSS_CHANGES 639 647 rc = PGMHandlerVirtualDeregister(pVM, pVM->selm.s.GCPtrGuestTss); 640 648 AssertRC(rc); 641 # endif649 # endif 642 650 pVM->selm.s.GCPtrGuestTss = RTRCPTR_MAX; 643 651 pVM->selm.s.GCSelTss = RTSEL_MAX; … … 647 655 * Unregister shadow GDT/LDT/TSS write access handlers. 648 656 */ 649 # ifdef SELM_TRACK_SHADOW_GDT_CHANGES657 # ifdef SELM_TRACK_SHADOW_GDT_CHANGES 650 658 if (pVM->selm.s.paGdtRC != NIL_RTRCPTR) 651 659 { … … 654 662 pVM->selm.s.paGdtRC = NIL_RTRCPTR; 655 663 } 656 # endif657 # ifdef SELM_TRACK_SHADOW_TSS_CHANGES664 # endif 665 # ifdef SELM_TRACK_SHADOW_TSS_CHANGES 658 666 if (pVM->selm.s.pvMonShwTssRC != RTRCPTR_MAX) 659 667 { … … 662 670 pVM->selm.s.pvMonShwTssRC = RTRCPTR_MAX; 663 671 } 664 # endif665 # ifdef SELM_TRACK_SHADOW_LDT_CHANGES672 # endif 673 # ifdef SELM_TRACK_SHADOW_LDT_CHANGES 666 674 if (pVM->selm.s.pvLdtRC != RTRCPTR_MAX) 667 675 { … … 670 678 pVM->selm.s.pvLdtRC = RTRCPTR_MAX; 671 679 } 672 # endif680 # endif 673 681 674 682 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies on VCPU */ … … 679 687 pVM->selm.s.fDisableMonitoring = true; 680 688 } 689 #endif /* VBOX_WITH_RAW_MODE */ 681 690 682 691 … … 782 791 static DECLCALLBACK(int) selmR3LoadDone(PVM pVM, PSSMHANDLE pSSM) 783 792 { 793 #ifdef VBOX_WITH_RAW_MODE 784 794 PVMCPU pVCpu = VMMGetCpu(pVM); 785 795 … … 811 821 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 812 822 823 #endif /*VBOX_WITH_RAW_MODE*/ 813 824 return VINF_SUCCESS; 814 825 } … … 1413 1424 } 1414 1425 1415 #endif /*VBOX_WITH_RAW_MODE*/1416 1417 1426 1418 1427 /** … … 1425 1434 VMMR3DECL(VBOXSTRICTRC) SELMR3UpdateFromCPUM(PVM pVM, PVMCPU pVCpu) 1426 1435 { 1427 #ifdef VBOX_WITH_RAW_MODE1428 1436 if (pVM->selm.s.fDisableMonitoring) 1429 #endif1430 1437 { 1431 1438 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_SELM_SYNC_GDT); … … 1435 1442 } 1436 1443 1437 #ifdef VBOX_WITH_RAW_MODE1438 1444 STAM_PROFILE_START(&pVM->selm.s.StatUpdateFromCPUM, a); 1439 1445 … … 1479 1485 STAM_PROFILE_STOP(&pVM->selm.s.StatUpdateFromCPUM, a); 1480 1486 return rcStrict; 1481 #endif /* VBOX_WITH_RAW_MODE */ 1482 } 1483 1487 } 1488 1489 #endif /*VBOX_WITH_RAW_MODE*/ 1484 1490 1485 1491 #ifdef SELM_TRACK_GUEST_GDT_CHANGES … … 1576 1582 #endif 1577 1583 1584 #ifdef VBOX_WITH_RAW_MODE 1578 1585 1579 1586 /** … … 1593 1600 int rc; 1594 1601 1595 #ifdef VBOX_WITH_RAW_MODE1596 1602 if (pVM->selm.s.fDisableMonitoring) 1597 #endif1598 1603 { 1599 1604 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_SELM_SYNC_TSS); … … 1601 1606 } 1602 1607 1603 #ifdef VBOX_WITH_RAW_MODE1604 1608 STAM_PROFILE_START(&pVM->selm.s.StatTSSSync, a); 1605 1609 Assert(VMCPU_FF_ISSET(pVCpu, VMCPU_FF_SELM_SYNC_TSS)); … … 1701 1705 if (RT_SUCCESS(rc)) 1702 1706 { 1703 # ifdef LOG_ENABLED1707 # ifdef LOG_ENABLED 1704 1708 if (LogIsEnabled()) 1705 1709 { … … 1718 1722 Log(("offIoBitmap=%#x\n", Tss.offIoBitmap)); 1719 1723 } 1720 # endif /* LOG_ENABLED */1724 # endif /* LOG_ENABLED */ 1721 1725 AssertMsg(!(Tss.ss0 & 3), ("ring-1 leak into TSS.SS0? %04X:%08X\n", Tss.ss0, Tss.esp0)); 1722 1726 … … 1725 1729 pVM->selm.s.fSyncTSSRing0Stack = fNoRing1Stack = false; 1726 1730 1727 # ifdef VBOX_WITH_RAW_RING11731 # ifdef VBOX_WITH_RAW_RING1 1728 1732 /* Update our TSS structure for the guest's ring 2 stack */ 1729 1733 if (EMIsRawRing1Enabled(pVM)) … … 1734 1738 selmSetRing2Stack(pVM, (Tss.ss1 & ~1) | 2, Tss.esp1); 1735 1739 } 1736 # endif1740 # endif 1737 1741 } 1738 1742 } … … 1771 1775 if (cbMonitoredTss != 0) 1772 1776 { 1773 # ifdef SELM_TRACK_GUEST_TSS_CHANGES1777 # ifdef SELM_TRACK_GUEST_TSS_CHANGES 1774 1778 rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_WRITE, GCPtrTss, GCPtrTss + cbMonitoredTss - 1, 1775 1779 0, selmR3GuestTSSWriteHandler, … … 1777 1781 if (RT_FAILURE(rc)) 1778 1782 { 1779 # ifdef VBOX_WITH_RAW_RING11783 # ifdef VBOX_WITH_RAW_RING1 1780 1784 /** @todo !HACK ALERT! 1781 1785 * Some guest OSes (QNX) share code and the TSS on the same page; … … 1799 1803 } 1800 1804 } 1801 # else1805 # else 1802 1806 STAM_PROFILE_STOP(&pVM->selm.s.StatUpdateFromCPUM, a); 1803 1807 return rc; 1804 # endif1808 # endif 1805 1809 } 1806 # endif /* SELM_TRACK_GUEST_TSS_CHANGES */1810 # endif /* SELM_TRACK_GUEST_TSS_CHANGES */ 1807 1811 1808 1812 /* Update saved Guest TSS info. */ … … 1823 1827 STAM_PROFILE_STOP(&pVM->selm.s.StatTSSSync, a); 1824 1828 return VINF_SUCCESS; 1825 #endif /*VBOX_WITH_RAW_MODE*/ 1826 } 1827 1828 #ifdef VBOX_WITH_RAW_MODE 1829 } 1830 1829 1831 1830 1832 /** -
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r45528 r45533 424 424 425 425 426 /** Enable or disable tracking of Guest's IDT. */ 426 #ifdef VBOX_WITH_RAW_MODE 427 / ** Enable or disable tracking of Guest's IDT. */ 427 428 #define TRPM_TRACK_GUEST_IDT_CHANGES 428 429 429 /** Enable or disable tracking of Shadow IDT. */ 430 #define TRPM_TRACK_SHADOW_IDT_CHANGES 430 # define TRPM_TRACK_SHADOW_IDT_CHANGES 431 #endif 431 432 432 433 /** TRPM saved state version. */ … … 440 441 static DECLCALLBACK(int) trpmR3Save(PVM pVM, PSSMHANDLE pSSM); 441 442 static DECLCALLBACK(int) trpmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 443 #ifdef TRPM_TRACK_GUEST_IDT_CHANGES 442 444 static DECLCALLBACK(int) trpmR3GuestIDTWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser); 445 #endif 443 446 444 447 … … 571 574 STAM_REG(pVM, &pVM->trpm.s.StatTrap0dRdTsc, STAMTYPE_COUNTER, "/TRPM/RC/Traps/0d/RdTsc", STAMUNIT_OCCURENCES, "Number of RDTSC #GPs."); 572 575 576 #ifdef VBOX_WITH_RAW_MODE 573 577 /* 574 578 * Default action when entering raw mode for the first time … … 576 580 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies on VCPU */ 577 581 VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 582 #endif 578 583 return 0; 579 584 } … … 773 778 TRPMR3Relocate(pVM, 0); 774 779 780 #ifdef VBOX_WITH_RAW_MODE 775 781 /* 776 782 * Default action when entering raw mode for the first time … … 778 784 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies on VCPU */ 779 785 VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 786 #endif 780 787 } 781 788 … … 847 854 SSMR3PutBool(pSSM, pTrpm->fDisableMonitoring); 848 855 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies 1 VCPU */ 849 SSMR3PutUInt(pSSM, VM CPU_FF_ISSET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT));856 SSMR3PutUInt(pSSM, VM_WHEN_RAW_MODE(VMCPU_FF_ISSET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT), 0)); 850 857 SSMR3PutMem(pSSM, &pTrpm->au32IdtPatched[0], sizeof(pTrpm->au32IdtPatched)); 851 858 SSMR3PutU32(pSSM, ~0); /* separator. */ … … 947 954 return VERR_SSM_DATA_UNIT_FORMAT_CHANGED; 948 955 } 956 #ifdef VBOX_WITH_RAW_MODE 949 957 if (fSyncIDT) 950 958 { … … 953 961 } 954 962 /* else: cleared by reset call above. */ 963 #endif 955 964 956 965 SSMR3GetMem(pSSM, &pTrpm->au32IdtPatched[0], sizeof(pTrpm->au32IdtPatched)); … … 1000 1009 } 1001 1010 1011 #ifdef VBOX_WITH_RAW_MODE 1002 1012 1003 1013 /** … … 1021 1031 } 1022 1032 1023 #ifdef VBOX_WITH_RAW_MODE1024 1033 if (fRawRing0 && CSAMIsEnabled(pVM)) 1025 1034 { … … 1033 1042 CSAMR3CheckGates(pVM, 0, 256); 1034 1043 } 1035 #endif /* VBOX_WITH_RAW_MODE */1036 1044 1037 1045 /* … … 1046 1054 } 1047 1055 1048 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES1056 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES 1049 1057 /* 1050 1058 * Check if Guest's IDTR has changed. … … 1068 1076 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1069 1077 1070 # ifdef VBOX_WITH_RAW_MODE1071 1078 if (rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT) 1072 1079 { … … 1079 1086 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1080 1087 } 1081 # endif /* VBOX_WITH_RAW_MODE */1082 1088 1083 1089 AssertRCReturn(rc, rc); … … 1087 1093 pVM->trpm.s.GuestIdtr = IDTR; 1088 1094 } 1089 # endif1095 # endif 1090 1096 1091 1097 /* … … 1125 1131 * Deregister any virtual handlers. 1126 1132 */ 1127 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES1133 # ifdef TRPM_TRACK_GUEST_IDT_CHANGES 1128 1134 if (pVM->trpm.s.GuestIdtr.pIdt != RTRCPTR_MAX) 1129 1135 { … … 1136 1142 } 1137 1143 pVM->trpm.s.GuestIdtr.cbIdt = 0; 1138 # endif1139 1140 # ifdef TRPM_TRACK_SHADOW_IDT_CHANGES1144 # endif 1145 1146 # ifdef TRPM_TRACK_SHADOW_IDT_CHANGES 1141 1147 if (pVM->trpm.s.pvMonShwIdtRC != RTRCPTR_MAX) 1142 1148 { … … 1145 1151 pVM->trpm.s.pvMonShwIdtRC = RTRCPTR_MAX; 1146 1152 } 1147 # endif1153 # endif 1148 1154 1149 1155 PVMCPU pVCpu = &pVM->aCpus[0]; /* raw mode implies on VCPU */ … … 1181 1187 } 1182 1188 1183 #ifdef VBOX_WITH_RAW_MODE1184 1189 1185 1190 /** -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r45525 r45533 2382 2382 PRINT_FLAG(VMCPU_FF_,PGM_SYNC_CR3_NON_GLOBAL); 2383 2383 PRINT_FLAG(VMCPU_FF_,TLB_FLUSH); 2384 PRINT_FLAG(VMCPU_FF_,INHIBIT_INTERRUPTS); 2385 PRINT_FLAG(VMCPU_FF_,TO_R3); 2386 #ifdef VBOX_WITH_RAW_MODE 2384 2387 PRINT_FLAG(VMCPU_FF_,TRPM_SYNC_IDT); 2385 2388 PRINT_FLAG(VMCPU_FF_,SELM_SYNC_TSS); 2386 2389 PRINT_FLAG(VMCPU_FF_,SELM_SYNC_GDT); 2387 2390 PRINT_FLAG(VMCPU_FF_,SELM_SYNC_LDT); 2388 PRINT_FLAG(VMCPU_FF_,INHIBIT_INTERRUPTS);2389 2391 PRINT_FLAG(VMCPU_FF_,CSAM_SCAN_PAGE); 2390 2392 PRINT_FLAG(VMCPU_FF_,CSAM_PENDING_ACTION); 2391 PRINT_FLAG(VMCPU_FF_,TO_R3); 2393 #endif 2392 2394 if (f) 2393 2395 pHlp->pfnPrintf(pHlp, "%s\n Unknown bits: %#RX32\n", c ? "," : "", f); -
trunk/src/VBox/VMM/VMMR3/VMMTests.cpp
r44528 r45533 490 490 } 491 491 492 #ifdef VBOX_WITH_RAW_MODE 492 493 /* 493 494 * These forced actions are not necessary for the test and trigger breakpoints too. … … 495 496 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 496 497 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 498 #endif 497 499 498 500 /* Enable mapping of the hypervisor into the shadow page table. */ -
trunk/src/VBox/VMM/include/SELMInternal.h
r45485 r45533 34 34 */ 35 35 36 /** 37 * Enable or disable tracking of Shadow GDT/LDT/TSS. 36 /** Enable or disable tracking of Shadow GDT/LDT/TSS. 38 37 * @{ 39 38 */ 40 #define SELM_TRACK_SHADOW_GDT_CHANGES 41 #define SELM_TRACK_SHADOW_LDT_CHANGES 42 #define SELM_TRACK_SHADOW_TSS_CHANGES 39 #if defined(VBOX_WITH_RAW_MODE) || defined(DOXYGEN_RUNNING) 40 # define SELM_TRACK_SHADOW_GDT_CHANGES 41 # define SELM_TRACK_SHADOW_LDT_CHANGES 42 # define SELM_TRACK_SHADOW_TSS_CHANGES 43 #endif 43 44 /** @} */ 44 45 45 /** 46 * Enable or disable tracking of Guest GDT/LDT/TSS. 46 /** Enable or disable tracking of Guest GDT/LDT/TSS. 47 47 * @{ 48 48 */ 49 #define SELM_TRACK_GUEST_GDT_CHANGES 50 #define SELM_TRACK_GUEST_LDT_CHANGES 51 #define SELM_TRACK_GUEST_TSS_CHANGES 49 #if defined(VBOX_WITH_RAW_MODE) || defined(DOXYGEN_RUNNING) 50 # define SELM_TRACK_GUEST_GDT_CHANGES 51 # define SELM_TRACK_GUEST_LDT_CHANGES 52 # define SELM_TRACK_GUEST_TSS_CHANGES 53 #endif 52 54 /** @} */ 53 55 … … 98 100 RTINT offVM; 99 101 102 /** @todo #ifdef VBOX_WITH_RAW_MODE */ 100 103 /** Flat CS, DS, 64 bit mode CS, TSS & trap 8 TSS. */ 101 104 RTSEL aHyperSel[SELM_HYPER_SEL_MAX]; -
trunk/src/recompiler/VBoxRecompiler.c
r45528 r45533 1796 1796 pCtx->cr0 = env->cr[0]; 1797 1797 pCtx->cr3 = env->cr[3]; 1798 #ifdef VBOX_WITH_RAW_MODE 1798 1799 if ((env->cr[4] ^ pCtx->cr4) & X86_CR4_VME) 1799 1800 VMCPU_FF_SET(env->pVCpu, VMCPU_FF_SELM_SYNC_TSS); 1801 #endif 1800 1802 pCtx->cr4 = env->cr[4]; 1801 1803 … … 1917 1919 pCtx->cr0 = env->cr[0]; 1918 1920 pCtx->cr3 = env->cr[3]; 1921 #ifdef VBOX_WITH_RAW_MODE 1919 1922 if ((env->cr[4] ^ pCtx->cr4) & X86_CR4_VME) 1920 1923 VMCPU_FF_SET(env->pVCpu, VMCPU_FF_SELM_SYNC_TSS); 1924 #endif 1921 1925 pCtx->cr4 = env->cr[4]; 1922 1926 … … 1957 1961 pCtx->cr0 = env->cr[0]; 1958 1962 pCtx->cr3 = env->cr[3]; 1963 #ifdef VBOX_WITH_RAW_MODE 1959 1964 if ((env->cr[4] ^ pCtx->cr4) & X86_CR4_VME) 1960 1965 VMCPU_FF_SET(env->pVCpu, VMCPU_FF_SELM_SYNC_TSS); 1966 #endif 1961 1967 pCtx->cr4 = env->cr[4]; 1962 1968 #ifdef TARGET_X86_64 … … 2644 2650 pCtx->cr2 = pVM->rem.s.Env.cr[2]; 2645 2651 pCtx->cr3 = pVM->rem.s.Env.cr[3]; 2652 #ifdef VBOX_WITH_RAW_MODE 2646 2653 if ((pVM->rem.s.Env.cr[4] ^ pCtx->cr4) & X86_CR4_VME) 2647 2654 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 2655 #endif 2648 2656 pCtx->cr4 = pVM->rem.s.Env.cr[4]; 2649 2657 … … 2656 2664 pCtx->gdtr.pGdt = pVM->rem.s.Env.gdt.base; 2657 2665 STAM_COUNTER_INC(&gStatREMGDTChange); 2666 #ifdef VBOX_WITH_RAW_MODE 2658 2667 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_GDT); 2668 #endif 2659 2669 } 2660 2670 … … 2664 2674 pCtx->idtr.pIdt = pVM->rem.s.Env.idt.base; 2665 2675 STAM_COUNTER_INC(&gStatREMIDTChange); 2676 #ifdef VBOX_WITH_RAW_MODE 2666 2677 VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 2678 #endif 2667 2679 } 2668 2680 … … 2682 2694 pCtx->ldtr.Attr.u = (pVM->rem.s.Env.ldt.flags >> 8) & 0xF0FF; 2683 2695 STAM_COUNTER_INC(&gStatREMLDTRChange); 2696 #ifdef VBOX_WITH_RAW_MODE 2684 2697 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_LDT); 2698 #endif 2685 2699 } 2686 2700 … … 2709 2723 pCtx->tr.Attr.u |= DESC_TSS_BUSY_MASK >> 8; 2710 2724 STAM_COUNTER_INC(&gStatREMTRChange); 2725 #ifdef VBOX_WITH_RAW_MODE 2711 2726 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 2727 #endif 2712 2728 } 2713 2729 … … 2866 2882 pCtx->cr2 = pVM->rem.s.Env.cr[2]; 2867 2883 pCtx->cr3 = pVM->rem.s.Env.cr[3]; 2884 #ifdef VBOX_WITH_RAW_MODE 2868 2885 if ((pVM->rem.s.Env.cr[4] ^ pCtx->cr4) & X86_CR4_VME) 2869 2886 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 2887 #endif 2870 2888 pCtx->cr4 = pVM->rem.s.Env.cr[4]; 2871 2889 … … 2878 2896 pCtx->gdtr.pGdt = (RTGCPTR)pVM->rem.s.Env.gdt.base; 2879 2897 STAM_COUNTER_INC(&gStatREMGDTChange); 2898 #ifdef VBOX_WITH_RAW_MODE 2880 2899 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_GDT); 2900 #endif 2881 2901 } 2882 2902 … … 2886 2906 pCtx->idtr.pIdt = (RTGCPTR)pVM->rem.s.Env.idt.base; 2887 2907 STAM_COUNTER_INC(&gStatREMIDTChange); 2908 #ifdef VBOX_WITH_RAW_MODE 2888 2909 VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT); 2910 #endif 2889 2911 } 2890 2912 … … 2904 2926 pCtx->ldtr.Attr.u = (pVM->rem.s.Env.ldt.flags >> 8) & 0xF0FF; 2905 2927 STAM_COUNTER_INC(&gStatREMLDTRChange); 2928 #ifdef VBOX_WITH_RAW_MODE 2906 2929 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_LDT); 2930 #endif 2907 2931 } 2908 2932 … … 2931 2955 pCtx->tr.Attr.u |= DESC_TSS_BUSY_MASK >> 8; 2932 2956 STAM_COUNTER_INC(&gStatREMTRChange); 2957 #ifdef VBOX_WITH_RAW_MODE 2933 2958 VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS); 2959 #endif 2934 2960 } 2935 2961
Note:
See TracChangeset
for help on using the changeset viewer.

