Changeset 77481 in vbox
- Timestamp:
- Feb 27, 2019 12:59:58 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0A.asm
r76678 r77481 867 867 ; load the guest ones when necessary. 868 868 ; 869 ; @cproto DECLASM(int) HMR0VMXStartVMhmR0DumpDescriptorM(RTHCUINT fResume, PCPUMCTX pCtx, PVM CSCACHE pCache, PVM pVM,870 ; PVM CPU pVCpu, PFNHMVMXSTARTVM pfnStartVM);869 ; @cproto DECLASM(int) HMR0VMXStartVMhmR0DumpDescriptorM(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSBATCHCACHE pCache, 870 ; PVM pVM, PVMCPU pVCpu, PFNHMVMXSTARTVM pfnStartVM); 871 871 ; 872 872 ; @returns eax … … 874 874 ; @param fResumeVM msc:rcx 875 875 ; @param pCtx msc:rdx 876 ; @param pV MCSCache msc:r8876 ; @param pVmcsCache msc:r8 877 877 ; @param pVM msc:r9 878 878 ; @param pVCpu msc:[rbp+30h] The cross context virtual CPU structure of the calling EMT. … … 898 898 mov [xBP + 010h], rcx ; fResumeVM 899 899 mov [xBP + 018h], rdx ; pCtx 900 mov [xBP + 020h], r8 ; pV MCSCache900 mov [xBP + 020h], r8 ; pVmcsCache 901 901 mov [xBP + 028h], r9 ; pVM 902 902 … … 913 913 mov rcx, [xBP + 010h] ; fResumeVM 914 914 mov rdx, [xBP + 018h] ; pCtx 915 mov r8, [xBP + 020h] ; pV MCSCache915 mov r8, [xBP + 020h] ; pVmcsCache 916 916 mov r9, [xBP + 028h] ; pVM 917 917 call r11 … … 954 954 mov rcx, [xBP + 010h] ; fResumeVM 955 955 mov rdx, [xBP + 018h] ; pCtx 956 mov r8, [xBP + 020h] ; pV MCSCache956 mov r8, [xBP + 020h] ; pVmcsCache 957 957 mov r9, [xBP + 028h] ; pVM 958 958 call r11 … … 1016 1016 mov rcx, [xBP + 010h] ; fResumeVM 1017 1017 mov rdx, [xBP + 018h] ; pCtx 1018 mov r8, [xBP + 020h] ; pV MCSCache1018 mov r8, [xBP + 020h] ; pVmcsCache 1019 1019 mov r9, [xBP + 028h] ; pVM 1020 1020 call r11 … … 1297 1297 1298 1298 %ifdef VMX_USE_CACHED_VMCS_ACCESSES 1299 pop xDX ; Saved p Cache1299 pop xDX ; Saved pVmcsCache 1300 1300 1301 1301 ; Note! If we get here as a result of invalid VMCS pointer, all the following 1302 1302 ; vmread's will fail (only eflags.cf=1 will be set) but that shouldn't cause any 1303 1303 ; trouble only just less efficient. 1304 mov ecx, [ss:xDX + VM CSCACHE.Read.cValidEntries]1304 mov ecx, [ss:xDX + VMXVMCSBATCHCACHE.Read.cValidEntries] 1305 1305 cmp ecx, 0 ; Can't happen 1306 1306 je %%no_cached_read32 … … 1310 1310 %%cached_read32: 1311 1311 dec xCX 1312 mov eax, [ss:xDX + VM CSCACHE.Read.aField + xCX * 4]1312 mov eax, [ss:xDX + VMXVMCSBATCHCACHE.Read.aField + xCX * 4] 1313 1313 ; Note! This leaves the high 32 bits of the cache entry unmodified!! 1314 vmread [ss:xDX + VM CSCACHE.Read.aFieldVal + xCX * 8], xAX1314 vmread [ss:xDX + VMXVMCSBATCHCACHE.Read.aFieldVal + xCX * 8], xAX 1315 1315 cmp xCX, 0 1316 1316 jnz %%cached_read32 … … 1341 1341 ; @param fResume x86:[ebp+8], msc:rcx,gcc:rdi Whether to use vmlauch/vmresume. 1342 1342 ; @param pCtx x86:[ebp+c], msc:rdx,gcc:rsi Pointer to the guest-CPU context. 1343 ; @param p Cachex86:[ebp+10],msc:r8, gcc:rdx Pointer to the VMCS cache.1343 ; @param pVmcsCache x86:[ebp+10],msc:r8, gcc:rdx Pointer to the VMCS cache. 1344 1344 ; @param pVM x86:[ebp+14],msc:r9, gcc:rcx The cross context VM structure. 1345 1345 ; @param pVCpu x86:[ebp+18],msc:[ebp+30],gcc:r8 The cross context virtual CPU structure of the calling EMT. … … 1378 1378 ; fResume already in rdi 1379 1379 ; pCtx already in rsi 1380 mov rbx, rdx ; p Cache1380 mov rbx, rdx ; pVmcsCache 1381 1381 %else 1382 1382 mov rdi, rcx ; fResume 1383 1383 mov rsi, rdx ; pCtx 1384 mov rbx, r8 ; p Cache1384 mov rbx, r8 ; pVmcsCache 1385 1385 %endif 1386 1386 %else 1387 1387 mov edi, [ebp + 8] ; fResume 1388 1388 mov esi, [ebp + 12] ; pCtx 1389 mov ebx, [ebp + 16] ; p Cache1389 mov ebx, [ebp + 16] ; pVmcsCache 1390 1390 %endif 1391 1391 … … 1428 1428 1429 1429 %ifdef VMX_USE_CACHED_VMCS_ACCESSES 1430 mov ecx, [xBX + VM CSCACHE.Write.cValidEntries]1430 mov ecx, [xBX + VMXVMCSBATCHCACHE.Write.cValidEntries] 1431 1431 cmp ecx, 0 1432 1432 je .no_cached_writes … … 1437 1437 ALIGN(16) 1438 1438 .cached_write: 1439 mov eax, [xBX + VM CSCACHE.Write.aField + xCX * 4]1440 vmwrite xAX, [xBX + VM CSCACHE.Write.aFieldVal + xCX * 8]1439 mov eax, [xBX + VMXVMCSBATCHCACHE.Write.aField + xCX * 4] 1440 vmwrite xAX, [xBX + VMXVMCSBATCHCACHE.Write.aFieldVal + xCX * 8] 1441 1441 inc xCX 1442 1442 cmp xCX, xDX 1443 1443 jl .cached_write 1444 1444 1445 mov dword [xBX + VM CSCACHE.Write.cValidEntries], 01445 mov dword [xBX + VMXVMCSBATCHCACHE.Write.cValidEntries], 0 1446 1446 .no_cached_writes: 1447 1447 1448 ; Save the p Cache pointer.1448 ; Save the pVmcsCache pointer. 1449 1449 push xBX 1450 1450 %endif … … 1624 1624 1625 1625 %ifdef VMX_USE_CACHED_VMCS_ACCESSES 1626 pop xDX ; Saved p Cache1626 pop xDX ; Saved pVmcsCache 1627 1627 1628 1628 ; Note! If we get here as a result of invalid VMCS pointer, all the following 1629 1629 ; vmread's will fail (only eflags.cf=1 will be set) but that shouldn't cause any 1630 1630 ; trouble only just less efficient. 1631 mov ecx, [xDX + VM CSCACHE.Read.cValidEntries]1631 mov ecx, [xDX + VMXVMCSBATCHCACHE.Read.cValidEntries] 1632 1632 cmp ecx, 0 ; Can't happen 1633 1633 je %%no_cached_read64 … … 1637 1637 %%cached_read64: 1638 1638 dec xCX 1639 mov eax, [xDX + VM CSCACHE.Read.aField + xCX * 4]1640 vmread [xDX + VM CSCACHE.Read.aFieldVal + xCX * 8], xAX1639 mov eax, [xDX + VMXVMCSBATCHCACHE.Read.aField + xCX * 4] 1640 vmread [xDX + VMXVMCSBATCHCACHE.Read.aFieldVal + xCX * 8], xAX 1641 1641 cmp xCX, 0 1642 1642 jnz %%cached_read64 … … 1667 1667 ; @param fResume msc:rcx, gcc:rdi Whether to use vmlauch/vmresume. 1668 1668 ; @param pCtx msc:rdx, gcc:rsi Pointer to the guest-CPU context. 1669 ; @param p Cachemsc:r8, gcc:rdx Pointer to the VMCS cache.1669 ; @param pVmcsCache msc:r8, gcc:rdx Pointer to the VMCS cache. 1670 1670 ; @param pVM msc:r9, gcc:rcx The cross context VM structure. 1671 1671 ; @param pVCpu msc:[ebp+30], gcc:r8 The cross context virtual CPU structure of the calling EMT. … … 1694 1694 ; fResume already in rdi 1695 1695 ; pCtx already in rsi 1696 mov rbx, rdx ; p Cache1696 mov rbx, rdx ; pVmcsCache 1697 1697 %else 1698 1698 mov rdi, rcx ; fResume 1699 1699 mov rsi, rdx ; pCtx 1700 mov rbx, r8 ; p Cache1700 mov rbx, r8 ; pVmcsCache 1701 1701 %endif 1702 1702 … … 1737 1737 1738 1738 %ifdef VMX_USE_CACHED_VMCS_ACCESSES 1739 mov ecx, [xBX + VM CSCACHE.Write.cValidEntries]1739 mov ecx, [xBX + VMXVMCSBATCHCACHE.Write.cValidEntries] 1740 1740 cmp ecx, 0 1741 1741 je .no_cached_writes … … 1746 1746 ALIGN(16) 1747 1747 .cached_write: 1748 mov eax, [xBX + VM CSCACHE.Write.aField + xCX * 4]1749 vmwrite xAX, [xBX + VM CSCACHE.Write.aFieldVal + xCX * 8]1748 mov eax, [xBX + VMXVMCSBATCHCACHE.Write.aField + xCX * 4] 1749 vmwrite xAX, [xBX + VMXVMCSBATCHCACHE.Write.aFieldVal + xCX * 8] 1750 1750 inc xCX 1751 1751 cmp xCX, xDX 1752 1752 jl .cached_write 1753 1753 1754 mov dword [xBX + VM CSCACHE.Write.cValidEntries], 01754 mov dword [xBX + VMXVMCSBATCHCACHE.Write.cValidEntries], 0 1755 1755 .no_cached_writes: 1756 1756 1757 ; Save the p Cache pointer.1757 ; Save the pVmcsCache pointer. 1758 1758 push xBX 1759 1759 %endif -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r77463 r77481 4988 4988 PVM pVM = pVCpu->CTX_SUFF(pVM); 4989 4989 #ifdef VBOX_WITH_KERNEL_USING_XMM 4990 int rc = hmR0VMXStartVMWrapXMM(fResumeVM, pCtx, &pVCpu->hm.s.vmx.V MCSCache, pVM, pVCpu, pVCpu->hm.s.vmx.pfnStartVM);4990 int rc = hmR0VMXStartVMWrapXMM(fResumeVM, pCtx, &pVCpu->hm.s.vmx.VmcsBatchCache, pVM, pVCpu, pVCpu->hm.s.vmx.pfnStartVM); 4991 4991 #else 4992 int rc = pVCpu->hm.s.vmx.pfnStartVM(fResumeVM, pCtx, &pVCpu->hm.s.vmx.V MCSCache, pVM, pVCpu);4992 int rc = pVCpu->hm.s.vmx.pfnStartVM(fResumeVM, pCtx, &pVCpu->hm.s.vmx.VmcsBatchCache, pVM, pVCpu); 4993 4993 #endif 4994 4994 AssertMsg(rc <= VINF_SUCCESS, ("%Rrc\n", rc)); … … 5267 5267 AssertReturn(pVM->hm.s.pfnHost32ToGuest64R0, VERR_HM_NO_32_TO_64_SWITCHER); 5268 5268 Assert(enmOp > HM64ON32OP_INVALID && enmOp < HM64ON32OP_END); 5269 Assert(pVCpu->hm.s.vmx.V MCSCache.Write.cValidEntries <= RT_ELEMENTS(pVCpu->hm.s.vmx.VMCSCache.Write.aField));5270 Assert(pVCpu->hm.s.vmx.V MCSCache.Read.cValidEntries <= RT_ELEMENTS(pVCpu->hm.s.vmx.VMCSCache.Read.aField));5269 Assert(pVCpu->hm.s.vmx.VmcsBatchCache.Write.cValidEntries <= RT_ELEMENTS(pVCpu->hm.s.vmx.VmcsBatchCache.Write.aField)); 5270 Assert(pVCpu->hm.s.vmx.VmcsBatchCache.Read.cValidEntries <= RT_ELEMENTS(pVCpu->hm.s.vmx.VmcsBatchCache.Read.aField)); 5271 5271 5272 5272 #ifdef VBOX_STRICT 5273 for (uint32_t i = 0; i < pVCpu->hm.s.vmx.V MCSCache.Write.cValidEntries; i++)5274 Assert(hmR0VmxIsValidWriteField(pVCpu->hm.s.vmx.V MCSCache.Write.aField[i]));5275 5276 for (uint32_t i = 0; i <pVCpu->hm.s.vmx.V MCSCache.Read.cValidEntries; i++)5277 Assert(hmR0VmxIsValidReadField(pVCpu->hm.s.vmx.V MCSCache.Read.aField[i]));5273 for (uint32_t i = 0; i < pVCpu->hm.s.vmx.VmcsBatchCache.Write.cValidEntries; i++) 5274 Assert(hmR0VmxIsValidWriteField(pVCpu->hm.s.vmx.VmcsBatchCache.Write.aField[i])); 5275 5276 for (uint32_t i = 0; i <pVCpu->hm.s.vmx.VmcsBatchCache.Read.cValidEntries; i++) 5277 Assert(hmR0VmxIsValidReadField(pVCpu->hm.s.vmx.VmcsBatchCache.Read.aField[i])); 5278 5278 #endif 5279 5279 … … 5343 5343 * @param pVCpu The cross context virtual CPU structure. 5344 5344 */ 5345 DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVM CSCACHE pCache, PVM pVM, PVMCPU pVCpu)5345 DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSBATCHCACHE pCache, PVM pVM, PVMCPU pVCpu) 5346 5346 { 5347 5347 NOREF(fResume); … … 5373 5373 aParam[2] = RT_LO_U32(pVCpu->hm.s.vmx.HCPhysVmcs); /* Param 2: VMCS physical address - Lo. */ 5374 5374 aParam[3] = RT_HI_U32(pVCpu->hm.s.vmx.HCPhysVmcs); /* Param 2: VMCS physical address - Hi. */ 5375 aParam[4] = VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.V MCSCache);5375 aParam[4] = VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.VmcsBatchCache); 5376 5376 aParam[5] = 0; 5377 5377 aParam[6] = VM_RC_ADDR(pVM, pVM); … … 5400 5400 AssertMsg(pCache->TestIn.pCache == pCache->TestOut.pCache, ("%RGv vs %RGv\n", pCache->TestIn.pCache, 5401 5401 pCache->TestOut.pCache)); 5402 AssertMsg(pCache->TestIn.pCache == VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.V MCSCache),5403 ("%RGv vs %RGv\n", pCache->TestIn.pCache, VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.V MCSCache)));5402 AssertMsg(pCache->TestIn.pCache == VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.VmcsBatchCache), 5403 ("%RGv vs %RGv\n", pCache->TestIn.pCache, VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.VmcsBatchCache))); 5404 5404 AssertMsg(pCache->TestIn.pCtx == pCache->TestOut.pCtx, ("%RGv vs %RGv\n", pCache->TestIn.pCtx, 5405 5405 pCache->TestOut.pCtx)); … … 5432 5432 } while (0) 5433 5433 5434 PVM CSCACHE pCache = &pVCpu->hm.s.vmx.VMCSCache;5434 PVMXVMCSBATCHCACHE pCache = &pVCpu->hm.s.vmx.VmcsBatchCache; 5435 5435 uint32_t cReadFields = 0; 5436 5436 … … 5612 5612 { 5613 5613 AssertPtr(pVCpu); 5614 PVM CSCACHE pCache = &pVCpu->hm.s.vmx.VMCSCache;5615 5616 AssertMsgReturn(pCache->Write.cValidEntries < VM CSCACHE_MAX_ENTRY - 1,5614 PVMXVMCSBATCHCACHE pCache = &pVCpu->hm.s.vmx.VmcsBatchCache; 5615 5616 AssertMsgReturn(pCache->Write.cValidEntries < VMX_VMCS_BATCH_CACHE_MAX_ENTRY - 1, 5617 5617 ("entries=%u\n", pCache->Write.cValidEntries), VERR_ACCESS_DENIED); 5618 5618 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.h
r76585 r77481 46 46 VMMR0DECL(int) VMXR0ImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat); 47 47 VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPU pVCpu); 48 DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVM CSCACHE pCache, PVM pVM, PVMCPU pVCpu);49 DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVM CSCACHE pCache, PVM pVM, PVMCPU pVCpu);48 DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSBATCHCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu); 49 DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSBATCHCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu); 50 50 51 51 # if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) 52 DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVM CSCACHE pCache, PVM pVM, PVMCPU pVCpu);52 DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSBATCHCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu); 53 53 VMMR0DECL(int) VMXR0Execute64BitsHandler(PVMCPU pVCpu, HM64ON32OP enmOp, uint32_t cbParam, uint32_t *paParam); 54 54 # endif … … 61 61 { 62 62 Assert(idxCache <= VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX); 63 *pVal = pVCpu->hm.s.vmx.V MCSCache.Read.aFieldVal[idxCache];63 *pVal = pVCpu->hm.s.vmx.VmcsBatchCache.Read.aFieldVal[idxCache]; 64 64 return VINF_SUCCESS; 65 65 } -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r77325 r77481 961 961 PVMCPU pVCpu = &pVM->aCpus[i]; 962 962 963 PVM CSCACHE pCache = &pVCpu->hm.s.vmx.VMCSCache;964 strcpy((char *)p Cache->aMagic, "VMCSCACHE Magic");965 p Cache->uMagic = UINT64_C(0xdeadbeefdeadbeef);963 PVMXVMCSBATCHCACHE pVmcsCache = &pVCpu->hm.s.vmx.VmcsBatchCache; 964 strcpy((char *)pVmcsCache->aMagic, "VMCSCACHE Magic"); 965 pVmcsCache->uMagic = UINT64_C(0xdeadbeefdeadbeef); 966 966 } 967 967 #endif … … 1977 1977 1978 1978 #ifdef VBOX_WITH_CRASHDUMP_MAGIC 1979 memset(pVCpu->hm.s.vmx.V MCSCache.aMagic, 0, sizeof(pVCpu->hm.s.vmx.VMCSCache.aMagic));1980 pVCpu->hm.s.vmx.V MCSCache.uMagic = 0;1981 pVCpu->hm.s.vmx.V MCSCache.uPos = 0xffffffff;1979 memset(pVCpu->hm.s.vmx.VmcsBatchCache.aMagic, 0, sizeof(pVCpu->hm.s.vmx.VmcsBatchCache.aMagic)); 1980 pVCpu->hm.s.vmx.VmcsBatchCache.uMagic = 0; 1981 pVCpu->hm.s.vmx.VmcsBatchCache.uPos = 0xffffffff; 1982 1982 #endif 1983 1983 } … … 2006 2006 2007 2007 /* Reset the contents of the read cache. */ 2008 PVM CSCACHE pCache = &pVCpu->hm.s.vmx.VMCSCache;2009 for (unsigned j = 0; j < p Cache->Read.cValidEntries; j++)2010 p Cache->Read.aFieldVal[j] = 0;2008 PVMXVMCSBATCHCACHE pVmcsCache = &pVCpu->hm.s.vmx.VmcsBatchCache; 2009 for (unsigned j = 0; j < pVmcsCache->Read.cValidEntries; j++) 2010 pVmcsCache->Read.aFieldVal[j] = 0; 2011 2011 2012 2012 #ifdef VBOX_WITH_CRASHDUMP_MAGIC 2013 2013 /* Magic marker for searching in crash dumps. */ 2014 strcpy((char *)p Cache->aMagic, "VMCSCACHE Magic");2015 p Cache->uMagic = UINT64_C(0xdeadbeefdeadbeef);2014 strcpy((char *)pVmcsCache->aMagic, "VMCSCACHE Magic"); 2015 pVmcsCache->uMagic = UINT64_C(0xdeadbeefdeadbeef); 2016 2016 #endif 2017 2017 } -
trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
r76553 r77481 863 863 864 864 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 865 mov qword [rbx + VM CSCACHE.uPos], 2865 mov qword [rbx + VMXVMCSBATCHCACHE.uPos], 2 866 866 %endif 867 867 868 868 %ifdef DEBUG 869 869 mov rax, [rbp + 8 + 8] ; HCPhysCpuPage 870 mov [rbx + VM CSCACHE.TestIn.HCPhysCpuPage], rax870 mov [rbx + VMXVMCSBATCHCACHE.TestIn.HCPhysCpuPage], rax 871 871 mov rax, [rbp + 16 + 8] ; HCPhysVmcs 872 mov [rbx + VM CSCACHE.TestIn.HCPhysVmcs], rax873 mov [rbx + VM CSCACHE.TestIn.pCache], rbx874 mov [rbx + VM CSCACHE.TestIn.pCtx], rsi872 mov [rbx + VMXVMCSBATCHCACHE.TestIn.HCPhysVmcs], rax 873 mov [rbx + VMXVMCSBATCHCACHE.TestIn.pCache], rbx 874 mov [rbx + VMXVMCSBATCHCACHE.TestIn.pCtx], rsi 875 875 %endif 876 876 877 mov ecx, [rbx + VM CSCACHE.Write.cValidEntries]877 mov ecx, [rbx + VMXVMCSBATCHCACHE.Write.cValidEntries] 878 878 cmp ecx, 0 879 879 je .no_cached_writes … … 884 884 ALIGN(16) 885 885 .cached_write: 886 mov eax, [rbx + VM CSCACHE.Write.aField + rcx*4]887 vmwrite rax, qword [rbx + VM CSCACHE.Write.aFieldVal + rcx*8]886 mov eax, [rbx + VMXVMCSBATCHCACHE.Write.aField + rcx*4] 887 vmwrite rax, qword [rbx + VMXVMCSBATCHCACHE.Write.aFieldVal + rcx*8] 888 888 inc rcx 889 889 cmp rcx, rdx 890 890 jl .cached_write 891 891 892 mov dword [rbx + VM CSCACHE.Write.cValidEntries], 0892 mov dword [rbx + VMXVMCSBATCHCACHE.Write.cValidEntries], 0 893 893 .no_cached_writes: 894 894 895 895 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 896 mov qword [rbx + VM CSCACHE.uPos], 3896 mov qword [rbx + VMXVMCSBATCHCACHE.uPos], 3 897 897 %endif 898 898 ; Save the pCache pointer. … … 946 946 947 947 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 948 mov qword [rbx + VM CSCACHE.uPos], 4948 mov qword [rbx + VMXVMCSBATCHCACHE.uPos], 4 949 949 %endif 950 950 … … 969 969 970 970 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 971 mov qword [rbx + VM CSCACHE.uPos], 5971 mov qword [rbx + VMXVMCSBATCHCACHE.uPos], 5 972 972 %endif 973 973 … … 1084 1084 1085 1085 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 1086 mov dword [rdi + VM CSCACHE.uPos], 71086 mov dword [rdi + VMXVMCSBATCHCACHE.uPos], 7 1087 1087 %endif 1088 1088 %ifdef DEBUG 1089 mov [rdi + VM CSCACHE.TestOut.pCache], rdi1090 mov [rdi + VM CSCACHE.TestOut.pCtx], rsi1089 mov [rdi + VMXVMCSBATCHCACHE.TestOut.pCache], rdi 1090 mov [rdi + VMXVMCSBATCHCACHE.TestOut.pCtx], rsi 1091 1091 mov rax, cr8 1092 mov [rdi + VM CSCACHE.TestOut.cr8], rax1092 mov [rdi + VMXVMCSBATCHCACHE.TestOut.cr8], rax 1093 1093 %endif 1094 1094 1095 mov ecx, [rdi + VM CSCACHE.Read.cValidEntries]1095 mov ecx, [rdi + VMXVMCSBATCHCACHE.Read.cValidEntries] 1096 1096 cmp ecx, 0 ; Can't happen 1097 1097 je .no_cached_reads … … 1101 1101 .cached_read: 1102 1102 dec rcx 1103 mov eax, [rdi + VM CSCACHE.Read.aField + rcx*4]1104 vmread qword [rdi + VM CSCACHE.Read.aFieldVal + rcx*8], rax1103 mov eax, [rdi + VMXVMCSBATCHCACHE.Read.aField + rcx*4] 1104 vmread qword [rdi + VMXVMCSBATCHCACHE.Read.aFieldVal + rcx*8], rax 1105 1105 cmp rcx, 0 1106 1106 jnz .cached_read 1107 1107 .no_cached_reads: 1108 1108 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 1109 mov dword [rdi + VM CSCACHE.uPos], 81109 mov dword [rdi + VMXVMCSBATCHCACHE.uPos], 8 1110 1110 %endif 1111 1111 %endif … … 1117 1117 1118 1118 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 1119 mov dword [rdi + VM CSCACHE.uPos], 91119 mov dword [rdi + VMXVMCSBATCHCACHE.uPos], 9 1120 1120 %endif 1121 1121 .vmstart64_end: … … 1124 1124 %ifdef DEBUG 1125 1125 mov rdx, [rsp] ; HCPhysVmcs 1126 mov [rdi + VM CSCACHE.TestOut.HCPhysVmcs], rdx1126 mov [rdi + VMXVMCSBATCHCACHE.TestOut.HCPhysVmcs], rdx 1127 1127 %endif 1128 1128 %endif … … 1143 1143 pushf 1144 1144 pop rdx 1145 mov [rdi + VM CSCACHE.TestOut.eflags], rdx1145 mov [rdi + VMXVMCSBATCHCACHE.TestOut.eflags], rdx 1146 1146 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 1147 mov dword [rdi + VM CSCACHE.uPos], 121147 mov dword [rdi + VMXVMCSBATCHCACHE.uPos], 12 1148 1148 %endif 1149 1149 .skip_flags_save: … … 1169 1169 pop rdi ; pCache 1170 1170 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 1171 mov dword [rdi + VM CSCACHE.uPos], 101171 mov dword [rdi + VMXVMCSBATCHCACHE.uPos], 10 1172 1172 %endif 1173 1173 1174 1174 %ifdef DEBUG 1175 mov [rdi + VM CSCACHE.TestOut.pCache], rdi1176 mov [rdi + VM CSCACHE.TestOut.pCtx], rsi1175 mov [rdi + VMXVMCSBATCHCACHE.TestOut.pCache], rdi 1176 mov [rdi + VMXVMCSBATCHCACHE.TestOut.pCtx], rsi 1177 1177 %endif 1178 1178 %endif … … 1201 1201 1202 1202 %ifdef DEBUG 1203 mov [rdi + VM CSCACHE.TestOut.pCache], rdi1204 mov [rdi + VM CSCACHE.TestOut.pCtx], rsi1203 mov [rdi + VMXVMCSBATCHCACHE.TestOut.pCache], rdi 1204 mov [rdi + VMXVMCSBATCHCACHE.TestOut.pCtx], rsi 1205 1205 %endif 1206 1206 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 1207 mov dword [rdi + VM CSCACHE.uPos], 111207 mov dword [rdi + VMXVMCSBATCHCACHE.uPos], 11 1208 1208 %endif 1209 1209 %endif -
trunk/src/VBox/VMM/include/HMInternal.h
r77325 r77481 600 600 601 601 /* Maximum number of cached entries. */ 602 #define VM CSCACHE_MAX_ENTRY128602 #define VMX_VMCS_BATCH_CACHE_MAX_ENTRY 128 603 603 604 604 /** 605 * Structure for storing read and write VMCS actions.606 */ 607 typedef struct VM CSCACHE605 * Cache of a VMCS for batch reads or writes. 606 */ 607 typedef struct VMXVMCSBATCHCACHE 608 608 { 609 609 #ifdef VBOX_WITH_CRASHDUMP_MAGIC … … 625 625 uint32_t cValidEntries; 626 626 uint32_t uAlignment; 627 uint32_t aField[VM CSCACHE_MAX_ENTRY];628 uint64_t aFieldVal[VM CSCACHE_MAX_ENTRY];627 uint32_t aField[VMX_VMCS_BATCH_CACHE_MAX_ENTRY]; 628 uint64_t aFieldVal[VMX_VMCS_BATCH_CACHE_MAX_ENTRY]; 629 629 } Write; 630 630 struct … … 632 632 uint32_t cValidEntries; 633 633 uint32_t uAlignment; 634 uint32_t aField[VM CSCACHE_MAX_ENTRY];635 uint64_t aFieldVal[VM CSCACHE_MAX_ENTRY];634 uint32_t aField[VMX_VMCS_BATCH_CACHE_MAX_ENTRY]; 635 uint64_t aFieldVal[VMX_VMCS_BATCH_CACHE_MAX_ENTRY]; 636 636 } Read; 637 637 #ifdef VBOX_STRICT … … 659 659 } ScratchPad; 660 660 #endif 661 } VM CSCACHE;662 /** Pointer to VM CSCACHE. */663 typedef VM CSCACHE *PVMCSCACHE;664 AssertCompileSizeAlignment(VM CSCACHE, 8);661 } VMXVMCSBATCHCACHE; 662 /** Pointer to VMXVMCSBATCHCACHE. */ 663 typedef VMXVMCSBATCHCACHE *PVMXVMCSBATCHCACHE; 664 AssertCompileSizeAlignment(VMXVMCSBATCHCACHE, 8); 665 665 666 666 /** … … 670 670 * @param fResume Whether to use VMRESUME (true) or VMLAUNCH (false). 671 671 * @param pCtx The CPU register context. 672 * @param p Cache The VMCScache.672 * @param pVmcsCache The VMCS batch cache. 673 673 * @param pVM Pointer to the cross context VM structure. 674 674 * @param pVCpu Pointer to the cross context per-CPU structure. 675 675 */ 676 typedef DECLCALLBACK(int) FNHMVMXSTARTVM(RTHCUINT fResume, PCPUMCTX pCtx, PVM CSCACHE pCache, PVM pVM, PVMCPU pVCpu);676 typedef DECLCALLBACK(int) FNHMVMXSTARTVM(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSBATCHCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu); 677 677 /** Pointer to a VMX StartVM function. */ 678 678 typedef R0PTRTYPE(FNHMVMXSTARTVM *) PFNHMVMXSTARTVM; … … 835 835 uint64_t u64TscOffset; 836 836 837 /** VMCS cache . */838 VM CSCACHE VMCSCache;837 /** VMCS cache for batched vmread/vmwrites. */ 838 VMXVMCSBATCHCACHE VmcsBatchCache; 839 839 840 840 /** Real-mode emulation state. */ … … 1110 1110 1111 1111 # ifdef VBOX_WITH_KERNEL_USING_XMM 1112 DECLASM(int) hmR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, PVM CSCACHE pCache, PVM pVM, PVMCPU pVCpu,1112 DECLASM(int) hmR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSBATCHCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu, 1113 1113 PFNHMVMXSTARTVM pfnStartVM); 1114 1114 DECLASM(int) hmR0SVMRunWrapXMM(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu, -
trunk/src/VBox/VMM/include/HMInternal.mac
r76553 r77481 21 21 22 22 ;Maximum number of cached entries. 23 %define VM CSCACHE_MAX_ENTRY 12823 %define VMX_VMCS_BATCH_CACHE_MAX_ENTRY 128 24 24 25 25 ; Structure for storing read and write VMCS actions. 26 struc VM CSCACHE26 struc VMXVMCSBATCHCACHE 27 27 %ifdef VBOX_WITH_CRASHDUMP_MAGIC 28 28 .aMagic resb 16 … … 39 39 .Write.cValidEntries resd 1 40 40 .Write.uAlignment resd 1 41 .Write.aField resd VM CSCACHE_MAX_ENTRY42 .Write.aFieldVal resq VM CSCACHE_MAX_ENTRY41 .Write.aField resd VMX_VMCS_BATCH_CACHE_MAX_ENTRY 42 .Write.aFieldVal resq VMX_VMCS_BATCH_CACHE_MAX_ENTRY 43 43 .Read.cValidEntries resd 1 44 44 .Read.uAlignment resd 1 45 .Read.aField resd VM CSCACHE_MAX_ENTRY46 .Read.aFieldVal resq VM CSCACHE_MAX_ENTRY45 .Read.aField resd VMX_VMCS_BATCH_CACHE_MAX_ENTRY 46 .Read.aFieldVal resq VMX_VMCS_BATCH_CACHE_MAX_ENTRY 47 47 %ifdef VBOX_STRICT 48 48 .TestIn.HCPhysCpuPage resq 1
Note:
See TracChangeset
for help on using the changeset viewer.