Changeset 80281 in vbox for trunk/src/VBox/VMM/VMMR3/MMHyper.cpp
- Timestamp:
- Aug 15, 2019 7:29:37 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/MMHyper.cpp
r80191 r80281 28 28 #include "MMInternal.h" 29 29 #include <VBox/vmm/vm.h> 30 #include <VBox/vmm/gvm.h> 30 31 #include <VBox/err.h> 31 32 #include <VBox/param.h> … … 152 153 /* 153 154 * Map the VM structure into the hypervisor space. 155 * Note! Keeping the mappings here for now in case someone is using 156 * MMHyperR3ToR0 or similar. 154 157 */ 158 AssertCompileSizeAlignment(VM, PAGE_SIZE); 159 AssertCompileSizeAlignment(VMCPU, PAGE_SIZE); 155 160 #ifdef VBOX_BUGREF_9217 156 AssertRelease(pVM->cbSelf >= sizeof(VMCPU) * pVM->cCpus + sizeof(*pVM)); 161 AssertCompileSizeAlignment(GVM, PAGE_SIZE); 162 AssertCompileSizeAlignment(GVMCPU, PAGE_SIZE); 163 AssertRelease(pVM->cbSelf == sizeof(VM)); 164 AssertRelease(pVM->cbVCpu == sizeof(VMCPU)); 165 RTGCPTR GCPtr; 166 rc = MMR3HyperMapPages(pVM, pVM, pVM->pVMR0ForCall, sizeof(VM) >> PAGE_SHIFT, pVM->paVMPagesR3, "VM", &GCPtr); 167 uint32_t offPages = RT_UOFFSETOF(GVM, aCpus) >> PAGE_SHIFT; 168 for (uint32_t idCpu = 0; idCpu < pVM->cCpus && RT_SUCCESS(rc); idCpu++, offPages += sizeof(GVMCPU) >> PAGE_SHIFT) 169 { 170 PVMCPU pVCpu = pVM->apCpusR3[idCpu]; 171 RTGCPTR GCPtrIgn; 172 rc = MMR3HyperMapPages(pVM, pVCpu, pVM->pVMR0ForCall + offPages * PAGE_SIZE, 173 sizeof(VMCPU) >> PAGE_SHIFT, &pVM->paVMPagesR3[offPages], "VMCPU", &GCPtrIgn); 174 } 157 175 #else 158 176 AssertRelease(pVM->cbSelf >= sizeof(VMCPU)); 177 RTGCPTR GCPtr; 178 rc = MMR3HyperMapPages(pVM, pVM, pVM->pVMR0, 179 RT_ALIGN_Z(pVM->cbSelf, PAGE_SIZE) >> PAGE_SHIFT, pVM->paVMPagesR3, "VM", 180 &GCPtr); 159 181 #endif 160 RTGCPTR GCPtr;161 rc = MMR3HyperMapPages(pVM, pVM, pVM->pVMR0, RT_ALIGN_Z(pVM->cbSelf, PAGE_SIZE) >> PAGE_SHIFT, pVM->paVMPagesR3, "VM",162 &GCPtr);163 182 if (RT_SUCCESS(rc)) 164 183 { … … 876 895 //pHeap->pbHeapRC = 0; // set by mmR3HyperHeapMap() 877 896 pHeap->pVMR3 = pVM; 897 #ifdef VBOX_BUGREF_9217 898 pHeap->pVMR0 = pVM->pVMR0ForCall; 899 #else 878 900 pHeap->pVMR0 = pVM->pVMR0; 901 #endif 879 902 pHeap->pVMRC = pVM->pVMRC; 880 903 pHeap->cbHeap = cbAligned - MMYPERHEAP_HDR_SIZE;
Note:
See TracChangeset
for help on using the changeset viewer.