- Timestamp:
- Jan 22, 2021 11:26:29 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142376
- Location:
- trunk/src/VBox/VMM/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/HMInternal.h
r87387 r87388 687 687 688 688 689 /** @addtogroup grp_hm_int_svm SVM Internal 690 * @{ */ 691 /** SVM VMRun function, see SVMR0VMRun(). */ 692 typedef DECLCALLBACKTYPE(int, FNHMSVMVMRUN,(PVMCC pVM, PVMCPUCC pVCpu, RTHCPHYS HCPhysVMCB)); 693 /** Pointer to a SVM VMRun function. */ 694 typedef R0PTRTYPE(FNHMSVMVMRUN *) PFNHMSVMVMRUN; 695 /** @} */ 696 697 698 /** @addtogroup grp_hm_int_vmx VMX Internal 699 * @{ */ 689 700 /** 690 701 * VMX StartVM function. … … 700 711 /** Pointer to a VMX StartVM function. */ 701 712 typedef R0PTRTYPE(FNHMVMXSTARTVM *) PFNHMVMXSTARTVM; 702 703 /** SVM VMRun function, see SVMR0VMRun(). */704 typedef DECLCALLBACKTYPE(int, FNHMSVMVMRUN,(PVMCC pVM, PVMCPUCC pVCpu, RTHCPHYS HCPhysVMCB));705 /** Pointer to a SVM VMRun function. */706 typedef R0PTRTYPE(FNHMSVMVMRUN *) PFNHMSVMVMRUN;707 713 708 714 /** … … 845 851 /** @} */ 846 852 } VMXVMCSINFO; 847 /** Pointer to a VMXVMCSINFO struct. */853 /** Pointer to a VMXVMCSINFO struct. */ 848 854 typedef VMXVMCSINFO *PVMXVMCSINFO; 849 855 /** Pointer to a const VMXVMCSINFO struct. */ … … 862 868 AssertCompileMemberAlignment(VMXVMCSINFO, HCPhysVmcs, 8); 863 869 AssertCompileMemberAlignment(VMXVMCSINFO, hMemObj, 8); 870 871 872 /** @name Host-state restoration flags. 873 * @note If you change these values don't forget to update the assembly 874 * defines as well! 875 * @{ 876 */ 877 #define VMX_RESTORE_HOST_SEL_DS RT_BIT(0) 878 #define VMX_RESTORE_HOST_SEL_ES RT_BIT(1) 879 #define VMX_RESTORE_HOST_SEL_FS RT_BIT(2) 880 #define VMX_RESTORE_HOST_SEL_GS RT_BIT(3) 881 #define VMX_RESTORE_HOST_SEL_TR RT_BIT(4) 882 #define VMX_RESTORE_HOST_GDTR RT_BIT(5) 883 #define VMX_RESTORE_HOST_IDTR RT_BIT(6) 884 #define VMX_RESTORE_HOST_GDT_READ_ONLY RT_BIT(7) 885 #define VMX_RESTORE_HOST_GDT_NEED_WRITABLE RT_BIT(8) 886 /** 887 * This _must_ be the top most bit, so that we can easily that that it and 888 * something else is set w/o having to do two checks like this: 889 * @code 890 * if ( (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_REQUIRED) 891 * && (pVCpu->hm.s.vmx.fRestoreHostFlags & ~VMX_RESTORE_HOST_REQUIRED)) 892 * @endcode 893 * Instead we can then do: 894 * @code 895 * if (pVCpu->hm.s.vmx.fRestoreHostFlags > VMX_RESTORE_HOST_REQUIRED) 896 * @endcode 897 */ 898 #define VMX_RESTORE_HOST_REQUIRED RT_BIT(9) 899 /** @} */ 900 901 /** 902 * Host-state restoration structure. 903 * 904 * This holds host-state fields that require manual restoration. 905 * Assembly version found in HMInternal.mac (should be automatically verified). 906 */ 907 typedef struct VMXRESTOREHOST 908 { 909 RTSEL uHostSelDS; /* 0x00 */ 910 RTSEL uHostSelES; /* 0x02 */ 911 RTSEL uHostSelFS; /* 0x04 */ 912 RTSEL uHostSelGS; /* 0x06 */ 913 RTSEL uHostSelTR; /* 0x08 */ 914 uint8_t abPadding0[4]; 915 X86XDTR64 HostGdtr; /**< 0x0e - should be aligned by its 64-bit member. */ 916 uint8_t abPadding1[6]; 917 X86XDTR64 HostGdtrRw; /**< 0x1e - should be aligned by its 64-bit member. */ 918 uint8_t abPadding2[6]; 919 X86XDTR64 HostIdtr; /**< 0x2e - should be aligned by its 64-bit member. */ 920 uint64_t uHostFSBase; /* 0x38 */ 921 uint64_t uHostGSBase; /* 0x40 */ 922 } VMXRESTOREHOST; 923 /** Pointer to VMXRESTOREHOST. */ 924 typedef VMXRESTOREHOST *PVMXRESTOREHOST; 925 AssertCompileSize(X86XDTR64, 10); 926 AssertCompileMemberOffset(VMXRESTOREHOST, HostGdtr.uAddr, 16); 927 AssertCompileMemberOffset(VMXRESTOREHOST, HostGdtrRw.uAddr, 32); 928 AssertCompileMemberOffset(VMXRESTOREHOST, HostIdtr.uAddr, 48); 929 AssertCompileMemberOffset(VMXRESTOREHOST, uHostFSBase, 56); 930 AssertCompileSize(VMXRESTOREHOST, 72); 931 AssertCompileSizeAlignment(VMXRESTOREHOST, 8); 932 933 /** @} */ 864 934 865 935 /** … … 1230 1300 # endif 1231 1301 1232 # ifdef VBOX_WITH_KERNEL_USING_XMM1233 DECLASM(int) hmR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVMCC pVM, PVMCPUCC pVCpu,1234 PFNHMVMXSTARTVM pfnStartVM);1235 # endif1236 1302 DECLASM(void) hmR0MdsClear(void); 1237 1303 #endif /* IN_RING0 */ 1238 1304 1305 1306 /** @addtogroup grp_hm_int_svm SVM Internal 1307 * @{ */ 1239 1308 VMM_INT_DECL(int) hmEmulateSvmMovTpr(PVMCC pVM, PVMCPUCC pVCpu); 1240 1241 VMM_INT_DECL(PVMXVMCSINFO) hmGetVmxActiveVmcsInfo(PVMCPU pVCpu);1242 1309 1243 1310 /** … … 1267 1334 /** @} */ 1268 1335 1269 1270 1336 /** @} */ 1271 1337 1338 1339 /** @addtogroup grp_hm_int_vmx VMX Internal 1340 * @{ */ 1341 VMM_INT_DECL(PVMXVMCSINFO) hmGetVmxActiveVmcsInfo(PVMCPU pVCpu); 1342 1343 /** 1344 * Restores some host-state fields that need not be done on every VM-exit. 1345 * 1346 * @returns VBox status code. 1347 * @param fRestoreHostFlags Flags of which host registers needs to be 1348 * restored. 1349 * @param pRestoreHost Pointer to the host-restore structure. 1350 */ 1351 DECLASM(int) VMXRestoreHostState(uint32_t fRestoreHostFlags, PVMXRESTOREHOST pRestoreHost); 1352 1353 # ifdef VBOX_WITH_KERNEL_USING_XMM 1354 DECLASM(int) hmR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVMCC pVM, PVMCPUCC pVCpu, 1355 PFNHMVMXSTARTVM pfnStartVM); 1356 # endif 1357 /** @} */ 1358 1359 /** @} */ 1360 1272 1361 RT_C_DECLS_END 1273 1362 -
trunk/src/VBox/VMM/include/HMInternal.mac
r87333 r87388 84 84 endstruc 85 85 86 %define VMX_RESTORE_HOST_SEL_DS 0001h ;RT_BIT(0) 87 %define VMX_RESTORE_HOST_SEL_ES 0002h ;RT_BIT(1) 88 %define VMX_RESTORE_HOST_SEL_FS 0004h ;RT_BIT(2) 89 %define VMX_RESTORE_HOST_SEL_GS 0008h ;RT_BIT(3) 90 %define VMX_RESTORE_HOST_SEL_TR 0010h ;RT_BIT(4) 91 %define VMX_RESTORE_HOST_GDTR 0020h ;RT_BIT(5) 92 %define VMX_RESTORE_HOST_IDTR 0040h ;RT_BIT(6) 93 %define VMX_RESTORE_HOST_GDT_READ_ONLY 0080h ;RT_BIT(7) 94 %define VMX_RESTORE_HOST_GDT_NEED_WRITABLE 0100h ;RT_BIT(8) 95 %define VMX_RESTORE_HOST_REQUIRED 0200h ;RT_BIT(9) - must be the highest bit! 96 struc VMXRESTOREHOST 97 .uHostSelDS resw 1 98 .uHostSelES resw 1 99 .uHostSelFS resw 1 100 .uHostSelGS resw 1 101 .uHostSelTR resw 1 102 .abPadding0 resb 4 103 .HostGdtr resb 10 104 .abPadding1 resb 6 105 .HostGdtrRw resb 10 106 .abPadding2 resb 6 107 .HostIdtr resb 10 108 .uHostFSBase resq 1 109 .uHostGSBase resq 1 110 endstruc 111 AssertCompileMemberOffset(VMXRESTOREHOST, HostGdtr, 16-2) 112 AssertCompileMemberOffset(VMXRESTOREHOST, HostGdtrRw, 32-2) 113 AssertCompileMemberOffset(VMXRESTOREHOST, HostIdtr, 48-2) 114 AssertCompileMemberOffset(VMXRESTOREHOST, uHostFSBase, 56) 115 AssertCompileSize(VMXRESTOREHOST, 72) 116 86 117 struc HMCPUVMX 87 118 .VmcsInfo resb VMXVMCSINFO_size
Note:
See TracChangeset
for help on using the changeset viewer.