Changeset 7739 in vbox for trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
- Timestamp:
- Apr 4, 2008 12:48:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r7730 r7739 522 522 STAM_PROFILE_STOP(&pVM->pgm.s.StatHandlers, b); 523 523 524 /* Check to see if we need to emulate the instruction as X86_CR0_WP has been cleared. */525 if ( CPUMGetGuestCPL(pVM, pRegFrame) == 0526 && ((CPUMGetGuestCR0(pVM) & (X86_CR0_WP|X86_CR0_PG)) == X86_CR0_PG)527 && (uErr & X86_TRAP_PF_RW))528 {529 uint64_t fPageGst;530 rc = PGMGstGetPage(pVM, pvFault, &fPageGst, NULL);531 if ( VBOX_SUCCESS(rc)532 && !(fPageGst & X86_PTE_RW))533 {534 rc = PGMInterpretInstruction(pVM, pRegFrame, pvFault);535 if (VBOX_SUCCESS(rc))536 STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eWPEmulGC);537 else538 STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eWPEmulR3);539 return rc;540 }541 else542 AssertFailed(); /* This shouldn't happen; the above check is paranoid. */543 }544 545 524 # ifdef PGM_OUT_OF_SYNC_IN_GC 546 525 /* … … 697 676 return VINF_SUCCESS; 698 677 } 678 679 /* Check to see if we need to emulate the instruction as X86_CR0_WP has been cleared. */ 680 if ( CPUMGetGuestCPL(pVM, pRegFrame) == 0 681 && ((CPUMGetGuestCR0(pVM) & (X86_CR0_WP|X86_CR0_PG)) == X86_CR0_PG) 682 && (uErr & (X86_TRAP_PF_RW | X86_TRAP_PF_P)) == (X86_TRAP_PF_RW | X86_TRAP_PF_P)) 683 { 684 uint64_t fPageGst; 685 rc = PGMGstGetPage(pVM, pvFault, &fPageGst, NULL); 686 if ( VBOX_SUCCESS(rc) 687 && !(fPageGst & X86_PTE_RW)) 688 { 689 rc = PGMInterpretInstruction(pVM, pRegFrame, pvFault); 690 if (VBOX_SUCCESS(rc)) 691 STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eWPEmulGC); 692 else 693 STAM_COUNTER_INC(&pVM->pgm.s.StatTrap0eWPEmulR3); 694 return rc; 695 } 696 else 697 AssertMsgFailed(("Unexpected r/w page %x flag=%x\n", pvFault, (uint32_t)fPageGst)); 698 } 699 699 700 } 700 701
Note:
See TracChangeset
for help on using the changeset viewer.