Changeset 56052 in vbox
- Timestamp:
- May 24, 2015 2:56:38 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pgm.h
r56051 r56052 291 291 * @param pvUser User argument. 292 292 * @thread EMT(pVCpu) 293 * 294 * @todo FNPGMR3VIRTINVALIDATE might not longer actually be called! Don't 295 * know for how long... 293 296 */ 294 297 typedef DECLCALLBACK(int) FNPGMR3VIRTINVALIDATE(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, void *pvUser); … … 701 704 PFNPGMR3VIRTINVALIDATE pfnInvalidateR3, 702 705 PFNPGMVIRTHANDLER pfnHandlerR3, 706 RCPTRTYPE(FNPGMVIRTHANDLER) pfnHandlerRC, 703 707 RCPTRTYPE(FNPGMRCVIRTPFHANDLER) pfnPfHandlerRC, 704 708 const char *pszDesc, PPGMVIRTHANDLERTYPE phType); … … 706 710 PFNPGMR3VIRTINVALIDATE pfnInvalidateR3, 707 711 PFNPGMVIRTHANDLER pfnHandlerR3, 708 const char *psz PfHandlerRC, const char *pszDesc,712 const char *pszHandlerRC, const char *pszPfHandlerRC, const char *pszDesc, 709 713 PPGMVIRTHANDLERTYPE phType); 710 714 VMMR3_INT_DECL(int) PGMR3HandlerVirtualRegister(PVM pVM, PVMCPU pVCpu, PGMVIRTHANDLERTYPE hType, RTGCPTR GCPtr, -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r55937 r56052 255 255 NULL /*pfnInvalidateR3 */, 256 256 csamCodePageWriteHandler, 257 "csam RCCodePageWritePfHandler",257 "csamCodePageWriteHandler", "csamRCCodePageWritePfHandler", 258 258 "CSAM code page write handler", 259 259 &pVM->csam.s.hCodePageWriteType); … … 262 262 csamR3CodePageInvalidate, 263 263 csamCodePageWriteHandler, 264 "csam RCCodePageWritePfHandler",264 "csamCodePageWriteHandler", "csamRCCodePageWritePfHandler", 265 265 "CSAM code page write and invlpg handler", 266 266 &pVM->csam.s.hCodePageWriteAndInvPgType); -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r55937 r56052 223 223 NULL /*pfnInvalidateR3*/, 224 224 patmVirtPageHandler, 225 "patm RCVirtPagePfHandler",225 "patmVirtPageHandler", "patmRCVirtPagePfHandler", 226 226 "PATMMonitorPatchJump", &pVM->patm.s.hMonitorPageType); 227 227 AssertRCReturn(rc, rc); -
trunk/src/VBox/VMM/VMMR3/PGMHandler.cpp
r56051 r56052 73 73 * @param enmKind The kind of access handler. 74 74 * @param pfnHandlerR3 Pointer to the ring-3 handler callback. 75 * @param pfnHandlerR0 Pointer to the ring-0 handler callback. 75 76 * @param pfnPfHandlerR0 Pointer to the ring-0 \#PF handler callback. 77 * @param pfnHandlerRC Pointer to the raw-mode context handler callback. 76 78 * @param pfnPfHandlerRC Pointer to the raw-mode context \#PF handler 77 79 * callback. … … 313 315 * @param pfnInvalidateR3 Pointer to the ring-3 invalidation handler callback. 314 316 * @param pfnHandlerR3 Pointer to the ring-3 handler callback. 315 * @param pfnPfHandlerRC Pointer to the raw-mode context handler callback. 317 * @param pfnHandlerRC Pointer to the raw-mode context handler callback. 318 * @param pfnPfHandlerRC Pointer to the raw-mode context \#PF handler 319 * callback. 316 320 * @param pszDesc The type description. 317 321 * @param phType Where to return the type handle (cross context … … 322 326 PFNPGMR3VIRTINVALIDATE pfnInvalidateR3, 323 327 PFNPGMVIRTHANDLER pfnHandlerR3, 328 RCPTRTYPE(FNPGMVIRTHANDLER) pfnHandlerRC, 324 329 RCPTRTYPE(FNPGMRCVIRTPFHANDLER) pfnPfHandlerRC, 325 330 const char *pszDesc, PPGMVIRTHANDLERTYPE phType) 326 331 { 327 332 AssertReturn(!HMIsEnabled(pVM), VERR_NOT_AVAILABLE); /* Not supported/relevant for VT-x and AMD-V. */ 328 AssertReturn(RT_VALID_PTR(pfnHandlerR3) || enmKind == PGMVIRTHANDLERKIND_HYPERVISOR, VERR_INVALID_POINTER);329 AssertPtrNullReturn(pfnInvalidateR3, VERR_INVALID_POINTER);330 AssertReturn(pfnPfHandlerRC != NIL_RTRCPTR, VERR_INVALID_POINTER);331 AssertPtrReturn(pszDesc, VERR_INVALID_POINTER);332 333 AssertReturn( enmKind == PGMVIRTHANDLERKIND_WRITE 333 334 || enmKind == PGMVIRTHANDLERKIND_ALL 334 335 || enmKind == PGMVIRTHANDLERKIND_HYPERVISOR, 335 336 VERR_INVALID_PARAMETER); 337 if (enmKind != PGMVIRTHANDLERKIND_HYPERVISOR) 338 { 339 AssertPtrNullReturn(pfnInvalidateR3, VERR_INVALID_POINTER); 340 AssertPtrReturn(pfnHandlerR3, VERR_INVALID_POINTER); 341 AssertPtrReturn(pfnHandlerRC, VERR_INVALID_POINTER); 342 } 343 else 344 { 345 AssertReturn(pfnInvalidateR3 == NULL, VERR_INVALID_POINTER); 346 AssertReturn(pfnHandlerR3 == NULL, VERR_INVALID_POINTER); 347 AssertReturn(pfnHandlerRC == NIL_RTR0PTR, VERR_INVALID_POINTER); 348 } 349 AssertReturn(pfnPfHandlerRC != NIL_RTRCPTR, VERR_INVALID_POINTER); 350 AssertPtrReturn(pszDesc, VERR_INVALID_POINTER); 336 351 337 352 PPGMVIRTHANDLERTYPEINT pType; … … 347 362 pType->pfnInvalidateR3 = pfnInvalidateR3; 348 363 pType->pfnHandlerR3 = pfnHandlerR3; 364 pType->pfnHandlerRC = pfnHandlerRC; 349 365 pType->pfnPfHandlerRC = pfnPfHandlerRC; 350 366 pType->pszDesc = pszDesc; … … 375 391 * (optional, can be NULL). 376 392 * @param pfnHandlerR3 Pointer to the ring-3 handler callback. 377 * @param pszPfHandlerRC The name of the raw-mode context handler. 393 * @param pszHandlerRC The name of the raw-mode context handler callback 394 * (in VMMRC.rc). 395 * @param pszPfHandlerRC The name of the raw-mode context \#PF handler (in 396 * VMMRC.rc). 378 397 * @param pszDesc The type description. 379 398 * @param phType Where to return the type handle (cross context … … 384 403 PFNPGMR3VIRTINVALIDATE pfnInvalidateR3, 385 404 PFNPGMVIRTHANDLER pfnHandlerR3, 386 const char *psz PfHandlerRC, const char *pszDesc,405 const char *pszHandlerRC, const char *pszPfHandlerRC, const char *pszDesc, 387 406 PPGMVIRTHANDLERTYPE phType) 388 407 { … … 393 412 * Validate input. 394 413 */ 414 AssertPtrNullReturn(pszHandlerRC, VERR_INVALID_POINTER); 395 415 AssertPtrReturn(pszPfHandlerRC, VERR_INVALID_POINTER); 396 416 … … 398 418 * Resolve the GC handler. 399 419 */ 400 RTRCPTR pfnPfHandlerRC = NIL_RTRCPTR; 401 int rc = PDMR3LdrGetSymbolRCLazy(pVM, VMMRC_MAIN_MODULE_NAME, NULL /*pszSearchPath*/, pszPfHandlerRC, &pfnPfHandlerRC); 420 RTRCPTR pfnHandlerRC = NIL_RTRCPTR; 421 int rc = VINF_SUCCESS; 422 if (pszHandlerRC) 423 rc = PDMR3LdrGetSymbolRCLazy(pVM, VMMRC_MAIN_MODULE_NAME, NULL /*pszSearchPath*/, pszHandlerRC, &pfnHandlerRC); 402 424 if (RT_SUCCESS(rc)) 403 return PGMR3HandlerVirtualTypeRegisterEx(pVM, enmKind, fRelocUserRC, 404 pfnInvalidateR3, pfnHandlerR3, 405 pfnPfHandlerRC, 406 pszDesc, phType); 407 408 AssertMsgFailed(("Failed to resolve %s.%s, rc=%Rrc.\n", VMMRC_MAIN_MODULE_NAME, pszPfHandlerRC, rc)); 425 { 426 RTRCPTR pfnPfHandlerRC = NIL_RTRCPTR; 427 int rc = PDMR3LdrGetSymbolRCLazy(pVM, VMMRC_MAIN_MODULE_NAME, NULL /*pszSearchPath*/, pszPfHandlerRC, &pfnPfHandlerRC); 428 if (RT_SUCCESS(rc)) 429 return PGMR3HandlerVirtualTypeRegisterEx(pVM, enmKind, fRelocUserRC, 430 pfnInvalidateR3, pfnHandlerR3, 431 pfnHandlerRC, pfnPfHandlerRC, 432 pszDesc, phType); 433 434 AssertMsgFailed(("Failed to resolve %s.%s, rc=%Rrc.\n", VMMRC_MAIN_MODULE_NAME, pszPfHandlerRC, rc)); 435 } 436 else 437 AssertMsgFailed(("Failed to resolve %s.%s, rc=%Rrc.\n", VMMRC_MAIN_MODULE_NAME, pszHandlerRC, rc)); 409 438 return rc; 410 439 } -
trunk/src/VBox/VMM/VMMR3/SELM.cpp
r56013 r56052 200 200 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_HYPERVISOR, false /*fRelocUserRC*/, 201 201 NULL /*pfnInvalidateR3*/, NULL /*pfnHandlerR3*/, 202 "selmRCShadowGDTWritePfHandler",202 NULL /*pszHandlerRC*/, "selmRCShadowGDTWritePfHandler", 203 203 "Shadow GDT write access handler", &pVM->selm.s.hShadowGdtWriteHandlerType); 204 204 AssertRCReturn(rc, rc); … … 207 207 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_HYPERVISOR, false /*fRelocUserRC*/, 208 208 NULL /*pfnInvalidateR3*/, NULL /*pfnHandlerR3*/, 209 "selmRCShadowTSSWritePfHandler",209 NULL /*pszHandlerRC*/, "selmRCShadowTSSWritePfHandler", 210 210 "Shadow TSS write access handler", &pVM->selm.s.hShadowTssWriteHandlerType); 211 211 AssertRCReturn(rc, rc); … … 214 214 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_HYPERVISOR, false /*fRelocUserRC*/, 215 215 NULL /*pfnInvalidateR3*/, NULL /*pfnHandlerR3*/, 216 "selmRCShadowLDTWritePfHandler",216 NULL /*pszHandlerRC*/, "selmRCShadowLDTWritePfHandler", 217 217 "Shadow LDT write access handler", &pVM->selm.s.hShadowLdtWriteHandlerType); 218 218 AssertRCReturn(rc, rc); … … 220 220 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_WRITE, false /*fRelocUserRC*/, 221 221 NULL /*pfnInvalidateR3*/, selmGuestGDTWriteHandler, 222 "selm RCGuestGDTWritePfHandler",222 "selmGuestGDTWriteHandler", "selmRCGuestGDTWritePfHandler", 223 223 "Guest GDT write access handler", &pVM->selm.s.hGuestGdtWriteHandlerType); 224 224 AssertRCReturn(rc, rc); 225 225 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_WRITE, false /*fRelocUserRC*/, 226 226 NULL /*pfnInvalidateR3*/, selmGuestLDTWriteHandler, 227 "selm RCGuestLDTWritePfHandler",227 "selmGuestLDTWriteHandler", "selmRCGuestLDTWritePfHandler", 228 228 "Guest LDT write access handler", &pVM->selm.s.hGuestLdtWriteHandlerType); 229 229 AssertRCReturn(rc, rc); 230 230 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_WRITE, false /*fRelocUserRC*/, 231 231 NULL /*pfnInvalidateR3*/, selmGuestTSSWriteHandler, 232 "selm RCGuestTSSWritePfHandler",232 "selmGuestTSSWriteHandler", "selmRCGuestTSSWritePfHandler", 233 233 "Guest TSS write access handler", &pVM->selm.s.hGuestTssWriteHandlerType); 234 234 AssertRCReturn(rc, rc); -
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r56051 r56052 508 508 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_HYPERVISOR, false /*fRelocUserRC*/, 509 509 NULL /*pfnInvalidateR3*/, NULL /*pfnHandlerR3*/, 510 "trpmRCShadowIDTWritePfHandler",510 NULL /*pszHandlerRC*/, "trpmRCShadowIDTWritePfHandler", 511 511 "Shadow IDT write access handler", &pVM->trpm.s.hShadowIdtWriteHandlerType); 512 512 AssertRCReturn(rc, rc); … … 514 514 rc = PGMR3HandlerVirtualTypeRegister(pVM, PGMVIRTHANDLERKIND_WRITE, false /*fRelocUserRC*/, 515 515 NULL /*pfnInvalidateR3*/, trpmGuestIDTWriteHandler, 516 "trpm RCGuestIDTWritePfHandler",516 "trpmGuestIDTWriteHandler", "trpmRCGuestIDTWritePfHandler", 517 517 "Guest IDT write access handler", &pVM->trpm.s.hGuestIdtWriteHandlerType); 518 518 AssertRCReturn(rc, rc); -
trunk/src/VBox/VMM/include/PGMInternal.h
r56051 r56052 711 711 /** Whether the pvUserRC argument should be automatically relocated or not. */ 712 712 bool fRelocUserRC; 713 bool afPadding[3]; 713 bool afPadding[HC_ARCH_BITS == 64 ? 3 : 7]; 714 /** Pointer to RC callback function. */ 715 RCPTRTYPE(PFNPGMVIRTHANDLER) pfnHandlerRC; 714 716 /** Pointer to RC callback function for \#PFs. */ 715 717 RCPTRTYPE(PFNPGMRCVIRTPFHANDLER) pfnPfHandlerRC; … … 2712 2714 /** Virtual access handlers (AVL range + GC ptr tree). */ 2713 2715 AVLROGCPTRTREE VirtHandlers; 2714 /** Virtual access handlers (Phys range AVL range + offsetptr tree). */ 2716 /** Virtual access handlers (Phys range AVL range + offsetptr tree). 2717 * @remarks Handler of the hypervisor kind are of course not present. */ 2715 2718 AVLROGCPHYSTREE PhysToVirtHandlers; 2716 2719 /** Virtual access handlers for the hypervisor (AVL range + GC ptr tree). */ -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r55896 r56052 791 791 GEN_CHECK_OFF(PGMPHYSHANDLERTYPEINT, uState); 792 792 GEN_CHECK_OFF(PGMPHYSHANDLERTYPEINT, pfnHandlerR3); 793 GEN_CHECK_OFF(PGMPHYSHANDLERTYPEINT, pfnHandlerR0); 793 794 GEN_CHECK_OFF(PGMPHYSHANDLERTYPEINT, pfnPfHandlerR0); 795 GEN_CHECK_OFF(PGMPHYSHANDLERTYPEINT, pfnHandlerRC); 794 796 GEN_CHECK_OFF(PGMPHYSHANDLERTYPEINT, pfnPfHandlerRC); 795 797 GEN_CHECK_OFF(PGMPHYSHANDLERTYPEINT, pszDesc); … … 811 813 GEN_CHECK_OFF(PGMVIRTHANDLERTYPEINT, uState); 812 814 GEN_CHECK_OFF(PGMVIRTHANDLERTYPEINT, fRelocUserRC); 815 GEN_CHECK_OFF(PGMVIRTHANDLERTYPEINT, pfnHandlerRC); 813 816 GEN_CHECK_OFF(PGMVIRTHANDLERTYPEINT, pfnPfHandlerRC); 814 817 GEN_CHECK_OFF(PGMVIRTHANDLERTYPEINT, pfnInvalidateR3);
Note:
See TracChangeset
for help on using the changeset viewer.