Changeset 93554 in vbox for trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
- Timestamp:
- Feb 2, 2022 10:57:02 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r93115 r93554 890 890 */ 891 891 const uint32_t cbVM = RT_UOFFSETOF_DYN(GVM, aCpus[cCpus]); 892 const uint32_t cPages = RT_ALIGN_32(cbVM, PAGE_SIZE) >>PAGE_SHIFT;892 const uint32_t cPages = RT_ALIGN_32(cbVM, HOST_PAGE_SIZE) >> HOST_PAGE_SHIFT; 893 893 RTR0MEMOBJ hVMMemObj = NIL_RTR0MEMOBJ; 894 rc = RTR0MemObjAllocPage(&hVMMemObj, cPages << PAGE_SHIFT, false /* fExecutable */);894 rc = RTR0MemObjAllocPage(&hVMMemObj, cPages << HOST_PAGE_SHIFT, false /* fExecutable */); 895 895 if (RT_SUCCESS(rc)) 896 896 { … … 901 901 * Initialise the structure. 902 902 */ 903 RT_BZERO(pGVM, cPages << PAGE_SHIFT);903 RT_BZERO(pGVM, cPages << HOST_PAGE_SHIFT); 904 904 gvmmR0InitPerVMData(pGVM, iHandle, cCpus, pSession); 905 905 pGVM->gvmm.s.VMMemObj = hVMMemObj; … … 931 931 * Map the page array, VM and VMCPU structures into ring-3. 932 932 */ 933 AssertCompileSizeAlignment(VM, PAGE_SIZE);933 AssertCompileSizeAlignment(VM, HOST_PAGE_SIZE); 934 934 rc = RTR0MemObjMapUserEx(&pGVM->gvmm.s.VMMapObj, pGVM->gvmm.s.VMMemObj, (RTR3PTR)-1, 0, 935 935 RTMEM_PROT_READ | RTMEM_PROT_WRITE, NIL_RTR0PROCESS, … … 937 937 for (VMCPUID i = 0; i < cCpus && RT_SUCCESS(rc); i++) 938 938 { 939 AssertCompileSizeAlignment(VMCPU, PAGE_SIZE);939 AssertCompileSizeAlignment(VMCPU, HOST_PAGE_SIZE); 940 940 rc = RTR0MemObjMapUserEx(&pGVM->aCpus[i].gvmm.s.VMCpuMapObj, pGVM->gvmm.s.VMMemObj, 941 941 (RTR3PTR)-1, 0, RTMEM_PROT_READ | RTMEM_PROT_WRITE, NIL_RTR0PROCESS, … … 1254 1254 */ 1255 1255 AssertPtrReturn(pGVM, VERR_INVALID_POINTER); 1256 AssertReturn(!((uintptr_t)pGVM & PAGE_OFFSET_MASK), VERR_INVALID_POINTER);1256 AssertReturn(!((uintptr_t)pGVM & HOST_PAGE_OFFSET_MASK), VERR_INVALID_POINTER); 1257 1257 AssertMsgReturn(pGVM->enmVMState >= VMSTATE_CREATING && pGVM->enmVMState <= VMSTATE_TERMINATED, ("%d\n", pGVM->enmVMState), 1258 1258 VERR_WRONG_ORDER); … … 1861 1861 int rc; 1862 1862 if (RT_LIKELY( RT_VALID_PTR(pGVM) 1863 && ((uintptr_t)pGVM & PAGE_OFFSET_MASK) == 0 ))1863 && ((uintptr_t)pGVM & HOST_PAGE_OFFSET_MASK) == 0 )) 1864 1864 { 1865 1865 /* … … 1951 1951 */ 1952 1952 AssertPtrReturn(pGVM, VERR_INVALID_POINTER); 1953 AssertReturn(((uintptr_t)pGVM & PAGE_OFFSET_MASK) == 0, VERR_INVALID_POINTER);1953 AssertReturn(((uintptr_t)pGVM & HOST_PAGE_OFFSET_MASK) == 0, VERR_INVALID_POINTER); 1954 1954 1955 1955 /* … … 2269 2269 uintptr_t const off = (uintptr_t)pv - (uintptr_t)pGVM; 2270 2270 Assert(off < RT_UOFFSETOF_DYN(GVM, aCpus[pGVM->cCpus])); 2271 return RTR0MemObjGetPagePhysAddr(pGVM->gvmm.s.VMMemObj, off >> PAGE_SHIFT) | ((uintptr_t)pv &PAGE_OFFSET_MASK);2271 return RTR0MemObjGetPagePhysAddr(pGVM->gvmm.s.VMMemObj, off >> HOST_PAGE_SHIFT) | ((uintptr_t)pv & HOST_PAGE_OFFSET_MASK); 2272 2272 } 2273 2273
Note:
See TracChangeset
for help on using the changeset viewer.