Changeset 87490 in vbox
- Timestamp:
- Jan 29, 2021 6:42:54 PM (4 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0A.asm
r87487 r87490 699 699 ; 700 700 ; @returns VBox status code 701 ; @param NULL msc:rcx, gcc:rdi The cross context VM structure. (unused, passing NULL now)701 ; @param pVmcsInfo msc:rcx, gcc:rdi Pointer to the VMCS info (for cached host RIP and RSP). 702 702 ; @param pVCpu msc:rdx, gcc:rsi The cross context virtual CPU structure of the calling EMT. 703 703 ; @param fResume msc:r8l, gcc:dl Whether to use vmlauch/vmresume. … … 771 771 772 772 ; 773 ; Unify the input parameter registers: r si=pVCpu, bl=fResume, rdi=&pVCpu->cpum.GstCtx;773 ; Unify the input parameter registers: r9=pVmcsInfo, rsi=pVCpu, bl=fResume, rdi=&pVCpu->cpum.GstCtx; 774 774 ; 775 775 %ifdef ASM_CALL64_GCC 776 mov ebx, edx ; fResume 776 mov r9, rdi ; pVmcsInfo 777 mov ebx, edx ; fResume 777 778 %else 778 mov rsi, rdx ; pVCpu 779 mov ebx, r8d ; fResume 779 mov r9, rcx ; pVmcsInfo 780 mov rsi, rdx ; pVCpu 781 mov ebx, r8d ; fResume 780 782 %endif 781 783 lea rdi, [rsi + VMCPU.cpum.GstCtx] … … 903 905 ; before writing here. 904 906 lea rcx, [NAME(RT_CONCAT(hmR0VmxStartVmHostRIP,%1)) wrt rip] 905 cmp rcx, [r si + GVMCPU.hmr0 + HMR0PERVCPU.u + HMR0CPUVMX.uHostRIP]907 cmp rcx, [r9 + VMXVMCSINFO.uHostRip] 906 908 jne .write_host_rip 907 909 .wrote_host_rip: 908 cmp rsp, [r si + GVMCPU.hmr0 + HMR0PERVCPU.u + HMR0CPUVMX.uHostRSP]910 cmp rsp, [r9 + VMXVMCSINFO.uHostRsp] 909 911 jne .write_host_rsp 910 912 .wrote_host_rsp: … … 967 969 ALIGNCODE(8) 968 970 .write_host_rip: 969 mov [r si + GVMCPU.hmr0 + HMR0PERVCPU.u + HMR0CPUVMX.uHostRIP], rcx971 mov [r9 + VMXVMCSINFO.uHostRip], rcx 970 972 mov eax, VMX_VMCS_HOST_RIP ;; @todo It is only strictly necessary to write VMX_VMCS_HOST_RIP when 971 973 vmwrite rax, rcx ;; the VMXVMCSINFO::pfnStartVM function changes (eventually … … 977 979 ALIGNCODE(8) 978 980 .write_host_rsp: 979 mov [r si + GVMCPU.hmr0 + HMR0PERVCPU.u + HMR0CPUVMX.uHostRSP], rsp981 mov [r9 + VMXVMCSINFO.uHostRsp], rsp 980 982 mov eax, VMX_VMCS_HOST_RSP 981 983 vmwrite rax, rsp -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r87489 r87490 4221 4221 * Selector FNHMSVMVMRUN implementation. 4222 4222 */ 4223 static DECLCALLBACK(int) hmR0VmxStartVmSelector(PVM CC pVM, PVMCPUCC pVCpu, bool fResume)4223 static DECLCALLBACK(int) hmR0VmxStartVmSelector(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume) 4224 4224 { 4225 4225 hmR0VmxUpdateStartVmFunction(pVCpu); 4226 return pVCpu->hmr0.s.vmx.pfnStartVm(pV M, pVCpu, fResume);4226 return pVCpu->hmr0.s.vmx.pfnStartVm(pVmcsInfo, pVCpu, fResume); 4227 4227 } 4228 4228 … … 6881 6881 6882 6882 /** @todo Add stats for VMRESUME vs VMLAUNCH. */ 6883 bool const fResumeVM = RT_BOOL(pVmxTransient->pVmcsInfo->fVmcsState & VMX_V_VMCS_LAUNCH_STATE_LAUNCHED); 6884 int rc = pVCpu->hmr0.s.vmx.pfnStartVm(NULL /*pVCpu->CTX_SUFF(pVM) - unused*/, pVCpu, fResumeVM); 6883 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 6884 bool const fResumeVM = RT_BOOL(pVmcsInfo->fVmcsState & VMX_V_VMCS_LAUNCH_STATE_LAUNCHED); 6885 int rc = pVCpu->hmr0.s.vmx.pfnStartVm(pVmcsInfo, pVCpu, fResumeVM); 6885 6886 AssertMsg(rc <= VINF_SUCCESS, ("%Rrc\n", rc)); 6886 6887 return rc; -
trunk/src/VBox/VMM/include/HMInternal.h
r87489 r87490 699 699 * @{ */ 700 700 /** 701 * VMX StartVM function.702 *703 * @returns VBox status code (no informational stuff).704 * @param pVM Pointer to the cross context VM structure.705 * @param pVCpu Pointer to the cross context per-CPU structure.706 * @param fResume Whether to use VMRESUME (true) or VMLAUNCH (false).707 */708 typedef DECLCALLBACKTYPE(int, FNHMVMXSTARTVM,(PVMCC pVM, PVMCPUCC pVCpu, bool fResume));709 /** Pointer to a VMX StartVM function. */710 typedef R0PTRTYPE(FNHMVMXSTARTVM *) PFNHMVMXSTARTVM;711 712 /**713 701 * VMX VMCS information, shared. 714 702 * … … 826 814 /** CR4 guest/host mask. */ 827 815 uint64_t u64Cr4Mask; 816 /** Current VMX_VMCS_HOST_RIP value (only used in HMR0A.asm). */ 817 uint64_t uHostRip; 818 /** Current VMX_VMCS_HOST_RSP value (only used in HMR0A.asm). */ 819 uint64_t uHostRsp; 828 820 /** @} */ 829 821 … … 950 942 AssertCompileSizeAlignment(VMXRESTOREHOST, 8); 951 943 944 /** 945 * VMX StartVM function. 946 * 947 * @returns VBox status code (no informational stuff). 948 * @param pVmcsInfo Pointer to the VMCS info (for cached host RIP and RSP). 949 * @param pVCpu Pointer to the cross context per-CPU structure. 950 * @param fResume Whether to use VMRESUME (true) or VMLAUNCH (false). 951 */ 952 typedef DECLCALLBACKTYPE(int, FNHMVMXSTARTVM,(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume)); 953 /** Pointer to a VMX StartVM function. */ 954 typedef R0PTRTYPE(FNHMVMXSTARTVM *) PFNHMVMXSTARTVM; 952 955 /** @} */ 953 956 … … 1335 1338 /** Alignment. */ 1336 1339 uint32_t u32Alignment0; 1337 /** Current VMX_VMCS_HOST_RIP value (only used in HMR0A.asm).1338 * @todo move to VMXVMCSINFO */1339 uint64_t uHostRIP;1340 /** Current VMX_VMCS_HOST_RSP value (only used in HMR0A.asm).1341 * @todo move to VMXVMCSINFO */1342 uint64_t uHostRSP;1343 1340 /** The host-state restoration structure. */ 1344 1341 VMXRESTOREHOST RestoreHost; … … 1448 1445 * @{ 1449 1446 */ 1450 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1451 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1452 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1453 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1454 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1455 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1456 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1457 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1458 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1459 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1460 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1461 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1462 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1463 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1464 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1465 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1466 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1467 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1468 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1469 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1470 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1471 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1472 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1473 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1474 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1475 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1476 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1477 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1478 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1479 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1480 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1481 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVM CC pVM, PVMCPUCC pVCpu, bool fResume);1447 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1448 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1449 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1450 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1451 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1452 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1453 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1454 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1455 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1456 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1457 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1458 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1459 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1460 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1461 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1462 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_SansIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1463 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1464 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1465 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1466 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1467 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1468 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1469 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1470 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_SansMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1471 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1472 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1473 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1474 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_SansL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1475 DECLASM(int) hmR0VmxStartVm_SansXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1476 DECLASM(int) hmR0VmxStartVm_WithXcr0_SansIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1477 DECLASM(int) hmR0VmxStartVm_SansXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1478 DECLASM(int) hmR0VmxStartVm_WithXcr0_WithIbpbEntry_WithL1dEntry_WithMdsEntry_WithIbpbExit(PVMXVMCSINFO pVmcsInfo, PVMCPUCC pVCpu, bool fResume); 1482 1479 /** @} */ 1483 1480 -
trunk/src/VBox/VMM/include/HMInternal.mac
r87489 r87490 66 66 .u64Cr0Mask resq 1 67 67 .u64Cr4Mask resq 1 68 .uHostRip resq 1 69 .uHostRsp resq 1 68 70 69 71 .pvVmcs RTR0PTR_RES 1 … … 211 213 .fRestoreHostFlags resd 1 212 214 alignb 8 213 .uHostRIP resq 1214 .uHostRSP resq 1215 215 .RestoreHost resb VMXRESTOREHOST_size 216 216 endstruc
Note:
See TracChangeset
for help on using the changeset viewer.