Changeset 21645 in vbox
- Timestamp:
- Jul 16, 2009 12:05:21 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VMMDev.h
r21644 r21645 131 131 VMMDevReq_GetHypervisorInfo = 20, 132 132 VMMDevReq_SetHypervisorInfo = 21, 133 VMMDevReq_ SetPatchMemory = 22,134 VMMDevReq_ ClearPatchMemory = 23,133 VMMDevReq_RegisterPatchMemory = 22, 134 VMMDevReq_DeregisterPatchMemory = 23, 135 135 VMMDevReq_SetPowerStatus = 30, 136 136 VMMDevReq_AcknowledgeEvents = 41, … … 462 462 463 463 /** @name Default patch memory size . 464 * Used by VMMDevReq_ SetPatchMemory and VMMDevReq_ClearPatchMemory.464 * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory. 465 465 * @{ */ 466 466 #define VMMDEV_GUEST_DEFAULT_PATCHMEM_SIZE 8192 … … 470 470 * Patching memory structure. (locked executable & read-only page from the guest's perspective) 471 471 * 472 * Used by VMMDevReq_ SetPatchMemory and VMMDevReq_ClearPatchMemory472 * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory 473 473 */ 474 474 typedef struct … … 1404 1404 case VMMDevReq_SetHypervisorInfo: 1405 1405 return sizeof(VMMDevReqHypervisorInfo); 1406 case VMMDevReq_ SetPatchMemory:1407 case VMMDevReq_ ClearPatchMemory:1406 case VMMDevReq_RegisterPatchMemory: 1407 case VMMDevReq_DeregisterPatchMemory: 1408 1408 return sizeof(VMMDevReqPatchMemory); 1409 1409 case VMMDevReq_SetPowerStatus: -
trunk/include/VBox/hwaccm.h
r21217 r21645 141 141 VMMR3DECL(int) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx); 142 142 VMMR3DECL(int) HWACCMR3RestartPendingIOInstr(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx); 143 VMMR3DECL(int) HWACMMR3EnablePatching(PVM pVM); 144 VMMR3DECL(int) HWACMMR3DisablePatching(PVM pVM); 143 145 144 146 /** @} */ -
trunk/include/VBox/vmm.h
r21644 r21645 192 192 VMMR3DECL(void) VMMR3SendSipi(PVM pVM, VMCPUID idCpu, uint32_t uVector); 193 193 VMMR3DECL(void) VMMR3SendInitIpi(PVM pVM, VMCPUID idCpu); 194 VMMR3DECL(int) VMMR3 SetPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);195 VMMR3DECL(int) VMMR3 ClearPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);194 VMMR3DECL(int) VMMR3RegisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem); 195 VMMR3DECL(int) VMMR3DeregisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem); 196 196 VMMR3DECL(int) VMMR3AtomicExecuteHandler(PVM pVM, PFNATOMICHANDLER pfnHandler, void *pvUser); 197 197 VMMR3DECL(int) VMMR3EmtRendezvous(PVM pVM, uint32_t fFlags, PFNVMMEMTRENDEZVOUS pfnRendezvous, void *pvUser); -
trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp
r21644 r21645 1743 1743 { 1744 1744 VMMDevReqPatchMemory *req = NULL; 1745 int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_ SetPatchMemory);1745 int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_RegisterPatchMemory); 1746 1746 if (RT_SUCCESS(rc)) 1747 1747 { … … 1756 1756 if (RT_FAILURE(rc) || RT_FAILURE(req->header.rc)) 1757 1757 { 1758 dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_ SetPatchMemory error!"1758 dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_RegisterPatchMemory error!" 1759 1759 "rc = %d, VMMDev rc = %Rrc\n", rc, req->header.rc)); 1760 1760 RTR0MemObjFree(pDevExt->PatchMemObj, true); … … 1783 1783 { 1784 1784 VMMDevReqPatchMemory *req = NULL; 1785 int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_ ClearPatchMemory);1785 int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_DeregisterPatchMemory); 1786 1786 if (RT_SUCCESS(rc)) 1787 1787 { … … 1792 1792 if (RT_FAILURE(rc) || RT_FAILURE(req->header.rc)) 1793 1793 { 1794 dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_ ClearPatchMemory error!"1794 dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_DeregisterPatchMemory error!" 1795 1795 "rc = %d, VMMDev rc = %Rrc\n", rc, req->header.rc)); 1796 1796 /* We intentially leak the memory object here as there still could -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r21644 r21645 811 811 } 812 812 813 case VMMDevReq_ SetPatchMemory:813 case VMMDevReq_RegisterPatchMemory: 814 814 { 815 815 if (pRequestHeader->size != sizeof(VMMDevReqPatchMemory)) 816 816 { 817 AssertMsgFailed(("VMMDevReq_ SetPatchMemory structure has invalid size!\n"));817 AssertMsgFailed(("VMMDevReq_RegisterPatchMemory structure has invalid size!\n")); 818 818 pRequestHeader->rc = VERR_INVALID_PARAMETER; 819 819 } … … 822 822 VMMDevReqPatchMemory *pPatchRequest = (VMMDevReqPatchMemory*)pRequestHeader; 823 823 824 pRequestHeader->rc = VMMR3 SetPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem);825 } 826 break; 827 } 828 829 case VMMDevReq_ ClearPatchMemory:824 pRequestHeader->rc = VMMR3RegisterPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem); 825 } 826 break; 827 } 828 829 case VMMDevReq_DeregisterPatchMemory: 830 830 { 831 831 if (pRequestHeader->size != sizeof(VMMDevReqPatchMemory)) 832 832 { 833 AssertMsgFailed(("VMMDevReq_ ClearPatchMemory structure has invalid size!\n"));833 AssertMsgFailed(("VMMDevReq_DeregisterPatchMemory structure has invalid size!\n")); 834 834 pRequestHeader->rc = VERR_INVALID_PARAMETER; 835 835 } … … 838 838 VMMDevReqPatchMemory *pPatchRequest = (VMMDevReqPatchMemory*)pRequestHeader; 839 839 840 pRequestHeader->rc = VMMR3 ClearPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem);840 pRequestHeader->rc = VMMR3DeregisterPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem); 841 841 } 842 842 break; -
trunk/src/VBox/VMM/HWACCM.cpp
r21213 r21645 1383 1383 1384 1384 /** 1385 * Enable patching in a VT-x/AMD-V guest 1386 * 1387 * @returns VBox status code. 1388 * @param pVM The VM to operate on. 1389 */ 1390 VMMR3DECL(int) HWACMMR3EnablePatching(PVM pVM) 1391 { 1392 return VINF_SUCCESS; 1393 } 1394 1395 /** 1396 * Disable patching in a VT-x/AMD-V guest 1397 * 1398 * @returns VBox status code. 1399 * @param pVM The VM to operate on. 1400 */ 1401 VMMR3DECL(int) HWACMMR3DisablePatching(PVM pVM) 1402 { 1403 return VINF_SUCCESS; 1404 } 1405 1406 /** 1385 1407 * Force execution of the current IO code in the recompiler 1386 1408 * -
trunk/src/VBox/VMM/VMM.cpp
r21644 r21645 1305 1305 1306 1306 /** 1307 * Sets the guest memory range that can be used for patching 1308 * 1307 * Registers the guest memory range that can be used for patching 1308 * 1309 * @returns VBox status code. 1309 1310 * @param pVM The VM to operate on. 1310 1311 * @param pPatchMem Patch memory range 1311 1312 * @param cbPatchMem Size of the memory range 1312 1313 */ 1313 VMMR3DECL(int) VMMR3SetPatchMemory(PVM pVM, RTGCPTR pPatchPage, unsigned cbPatch) 1314 { 1314 VMMR3DECL(int) VMMR3RegisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem) 1315 { 1316 if (HWACCMIsEnabled(pVM)) 1317 HWACMMR3EnablePatching(pVM); 1318 1315 1319 return VERR_ACCESS_DENIED; 1316 1320 } 1317 1321 1318 1322 /** 1319 * Clears the guest memory range that can be used for patching 1320 * 1323 * Deregisters the guest memory range that can be used for patching 1324 * 1325 * @returns VBox status code. 1321 1326 * @param pVM The VM to operate on. 1322 1327 * @param pPatchMem Patch memory range 1323 1328 * @param cbPatchMem Size of the memory range 1324 1329 */ 1325 VMMR3DECL(int) VMMR3ClearPatchMemory(PVM pVM, RTGCPTR pPatchPage, unsigned cbPatch) 1326 { 1330 VMMR3DECL(int) VMMR3DeregisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem) 1331 { 1332 if (HWACCMIsEnabled(pVM)) 1333 { 1334 int rc = HWACMMR3DisablePatching(pVM); 1335 if (VBOX_FAILURE(rc)) 1336 return rc; 1337 } 1338 1327 1339 return VINF_SUCCESS; 1328 1340 }
Note:
See TracChangeset
for help on using the changeset viewer.