Changeset 55889 in vbox for trunk/src/VBox/VMM/VMMR3/TRPM.cpp
- Timestamp:
- May 17, 2015 6:01:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r55000 r55889 455 455 { 456 456 LogFlow(("TRPMR3Init\n")); 457 int rc; 457 458 458 459 /* … … 490 491 { 491 492 bool f; 492 intrc = CFGMR3QueryBool(pTRPMNode, "SafeToDropGuestIDTMonitoring", &f);493 rc = CFGMR3QueryBool(pTRPMNode, "SafeToDropGuestIDTMonitoring", &f); 493 494 if (RT_SUCCESS(rc)) 494 495 pVM->trpm.s.fSafeToDropGuestIDTMonitoring = f; … … 507 508 508 509 /* 510 * Register virtual access handlers. 511 */ 512 pVM->trpm.s.hShadowIdtWriteHandlerType = NIL_PGMVIRTHANDLERTYPE; 513 pVM->trpm.s.hGuestIdtWriteHandlerType = NIL_PGMVIRTHANDLERTYPE; 514 #ifdef VBOX_WITH_RAW_MODE 515 if (!HMIsEnabled(pVM)) 516 { 517 # ifdef TRPM_TRACK_SHADOW_IDT_CHANGES 518 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_HYPERVISOR, false /*fRelocUserRC*/, 519 NULL /*pfnInvalidateR3*/, NULL /*pfnHandlerR3*/, 520 "trpmRCShadowIDTWriteHandler", NULL /*pszModRC*/, 521 "Shadow IDT write access handler", &pVM->trpm.s.hShadowIdtWriteHandlerType); 522 AssertRCReturn(rc, rc); 523 # endif 524 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_WRITE, false /*fRelocUserRC*/, 525 NULL /*pfnInvalidateR3*/, trpmR3GuestIDTWriteHandler, 526 "trpmRCGuestIDTWriteHandler", NULL /*pszModRC*/, 527 "Guest IDT write access handler", &pVM->trpm.s.hGuestIdtWriteHandlerType); 528 AssertRCReturn(rc, rc); 529 } 530 #endif /* VBOX_WITH_RAW_MODE */ 531 532 /* 509 533 * Register the saved state data unit. 510 534 */ 511 intrc = SSMR3RegisterInternal(pVM, "trpm", 1, TRPM_SAVED_STATE_VERSION, sizeof(TRPM),512 513 514 535 rc = SSMR3RegisterInternal(pVM, "trpm", 1, TRPM_SAVED_STATE_VERSION, sizeof(TRPM), 536 NULL, NULL, NULL, 537 NULL, trpmR3Save, NULL, 538 NULL, trpmR3Load, NULL); 515 539 if (RT_FAILURE(rc)) 516 540 return rc; … … 692 716 if (pVM->trpm.s.pvMonShwIdtRC != RTRCPTR_MAX) 693 717 { 694 rc = PGMHandlerVirtualDeregister(pVM, pV M->trpm.s.pvMonShwIdtRC);718 rc = PGMHandlerVirtualDeregister(pVM, pVCpu, pVM->trpm.s.pvMonShwIdtRC, true /*fHypervisor*/); 695 719 AssertRC(rc); 696 720 } 697 721 pVM->trpm.s.pvMonShwIdtRC = VM_RC_ADDR(pVM, &pVM->trpm.s.aIdt[0]); 698 rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_HYPERVISOR, pVM->trpm.s.pvMonShwIdtRC, pVM->trpm.s.pvMonShwIdtRC + sizeof(pVM->trpm.s.aIdt) - 1, 699 0, 0, "trpmRCShadowIDTWriteHandler", 0, "Shadow IDT write access handler"); 722 rc = PGMR3HandlerVirtualRegister(pVM, pVCpu, pVM->trpm.s.hShadowIdtWriteHandlerType, 723 pVM->trpm.s.pvMonShwIdtRC, pVM->trpm.s.pvMonShwIdtRC + sizeof(pVM->trpm.s.aIdt) - 1, 724 NULL /*pvUserR3*/, NIL_RTR0PTR /*pvUserRC*/, NULL /*pszDesc*/); 700 725 AssertRC(rc); 701 726 # endif … … 775 800 if (!pVM->trpm.s.fSafeToDropGuestIDTMonitoring) 776 801 { 777 int rc = PGMHandlerVirtualDeregister(pVM, pVM->trpm.s.GuestIdtr.pIdt);802 int rc = PGMHandlerVirtualDeregister(pVM, VMMGetCpu(pVM), pVM->trpm.s.GuestIdtr.pIdt, false /*fHypervisor*/); 778 803 AssertRC(rc); 779 804 } … … 1090 1115 * [Re]Register write virtual handler for guest's IDT. 1091 1116 */ 1117 PVMCPU pVCpu = VMMGetCpu(pVM); 1092 1118 if (pVM->trpm.s.GuestIdtr.pIdt != RTRCPTR_MAX) 1093 1119 { 1094 rc = PGMHandlerVirtualDeregister(pVM, pV M->trpm.s.GuestIdtr.pIdt);1120 rc = PGMHandlerVirtualDeregister(pVM, pVCpu, pVM->trpm.s.GuestIdtr.pIdt, false /*fHypervisor*/); 1095 1121 AssertRCReturn(rc, rc); 1096 1122 } 1097 1123 /* limit is including */ 1098 rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_WRITE, IDTR.pIdt, IDTR.pIdt + IDTR.cbIdt /* already inclusive */, 1099 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1124 rc = PGMR3HandlerVirtualRegister(pVM, pVCpu, pVM->trpm.s.hGuestIdtWriteHandlerType, 1125 IDTR.pIdt, IDTR.pIdt + IDTR.cbIdt /* already inclusive */, 1126 NULL /*pvUserR3*/, NIL_RTR0PTR /*pvUserRC*/, NULL /*pszDesc*/); 1100 1127 1101 1128 if (rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT) … … 1106 1133 CSAMR3RemovePage(pVM, IDTR.pIdt + IDTR.cbIdt); 1107 1134 1108 rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_WRITE, IDTR.pIdt, IDTR.pIdt + IDTR.cbIdt /* already inclusive */, 1109 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler"); 1135 rc = PGMR3HandlerVirtualRegister(pVM, pVCpu, pVM->trpm.s.hGuestIdtWriteHandlerType, 1136 IDTR.pIdt, IDTR.pIdt + IDTR.cbIdt /* already inclusive */, 1137 NULL /*pvUserR3*/, NIL_RTR0PTR /*pvUserRC*/, NULL /*pszDesc*/); 1110 1138 } 1111 1139
Note:
See TracChangeset
for help on using the changeset viewer.