- Timestamp:
- Jun 13, 2009 8:56:16 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMM.cpp
r20406 r20533 95 95 96 96 97 /******************************************************************************* 98 * Defined Constants And Macros * 99 *******************************************************************************/ 97 100 /** The saved state version. */ 98 101 #define VMM_SAVED_STATE_VERSION 3 … … 412 415 */ 413 416 memset(pVCpu->vmm.s.pbEMTStackR3 - PAGE_SIZE, 0xcc, PAGE_SIZE); 414 PGMMapSetPage(pVM, MMHyperR3ToRC(pVM, pVCpu->vmm.s.pbEMTStackR3 - PAGE_SIZE), PAGE_SIZE, 0); 415 RTMemProtect(pVCpu->vmm.s.pbEMTStackR3 - PAGE_SIZE, PAGE_SIZE, RTMEM_PROT_NONE); 417 MMR3HyperSetGuard(pVM, pVCpu->vmm.s.pbEMTStackR3 - PAGE_SIZE, PAGE_SIZE, true /*fSet*/); 416 418 417 419 memset(pVCpu->vmm.s.pbEMTStackR3 + VMM_STACK_SIZE, 0xcc, PAGE_SIZE); 418 PGMMapSetPage(pVM, MMHyperR3ToRC(pVM, pVCpu->vmm.s.pbEMTStackR3 + VMM_STACK_SIZE), PAGE_SIZE, 0); 419 RTMemProtect(pVCpu->vmm.s.pbEMTStackR3 + VMM_STACK_SIZE, PAGE_SIZE, RTMEM_PROT_NONE); 420 #endif 421 422 /* 423 * Set page attributes to r/w for stack pages. 424 */ 420 MMR3HyperSetGuard(pVM, pVCpu->vmm.s.pbEMTStackR3 + VMM_STACK_SIZE, PAGE_SIZE, true /*fSet*/); 421 #endif 422 423 /* 424 * Set page attributes to r/w for stack pages. 425 */ 425 426 rc = PGMMapSetPage(pVM, pVCpu->vmm.s.pbEMTStackRC, VMM_STACK_SIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW); 426 427 AssertRC(rc); … … 641 642 * Make the two stack guard pages present again. 642 643 */ 643 RTMemProtect(pVM->vmm.s.pbEMTStackR3 - PAGE_SIZE, PAGE_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE); 644 RTMemProtect(pVM->vmm.s.pbEMTStackR3 + VMM_STACK_SIZE, PAGE_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE); 644 for (VMCPUID i = 0; i < pVM->cCPUs; i++) 645 { 646 RTMemProtect(pVM->aCpus[i].vmm.s.pbEMTStackR3 - PAGE_SIZE, PAGE_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE); 647 RTMemProtect(pVM->aCpus[i].vmm.s.pbEMTStackR3 + VMM_STACK_SIZE, PAGE_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE); 648 } 645 649 #endif 646 650 return rc; -
trunk/src/VBox/VMM/VMMInternal.h
r20406 r20533 56 56 #if defined(DEBUG_sandervl) || defined(DEBUG_frank) || defined(DOXYGEN_RUNNING) 57 57 # define VBOX_WITH_R0_LOGGING 58 #endif 59 60 /** @def VBOX_STRICT_VMM_STACK 61 * Enables VMM stack guard pages to catch stack over- and underruns. */ 62 #if defined(VBOX_STRICT) || defined(DOXYGEN_RUNNING) 63 # define VBOX_STRICT_VMM_STACK 58 64 #endif 59 65
Note:
See TracChangeset
for help on using the changeset viewer.