Changeset 73708 in vbox
- Timestamp:
- Aug 16, 2018 10:22:12 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm_vmx.h
r73628 r73708 850 850 uint32_t uReserved2 : 14; 851 851 } StrIo; 852 /** INVEPT, INVVPID, INVPCID, VMCLEAR, VMPTRLD, VMPTRST, VMXON, VMXOFF, XSAVES, 853 * XRSTORS information. */ 852 struct 853 { 854 /** Scaling; 0=no scaling, 1=scale-by-2, 2=scale-by-4, 3=scale-by-8. */ 855 uint32_t u2Scaling : 2; 856 uint32_t u5Undef0 : 5; 857 /** The address size; 0=16-bit, 1=32-bit, 2=64-bit, rest undefined. */ 858 uint32_t u3AddrSize : 3; 859 /** Cleared to 0. */ 860 uint32_t u1Cleared0 : 1; 861 uint32_t u4Undef0 : 4; 862 /** The segment register (X86_SREG_XXX). */ 863 uint32_t iSegReg : 3; 864 /** The index register (X86_GREG_XXX). */ 865 uint32_t iIdxReg : 4; 866 /** Set if index register is invalid. */ 867 uint32_t fIdxRegInvalid : 1; 868 /** The base register (X86_GREG_XXX). */ 869 uint32_t iBaseReg : 4; 870 /** Set if base register is invalid. */ 871 uint32_t fBaseRegInvalid : 1; 872 /** Register 2 (X86_GREG_XXX). */ 873 uint32_t iReg2 : 4; 874 } Inv; 875 /** VMCLEAR, VMPTRLD, VMPTRST, VMXON, XRSTORS, XSAVES information. */ 854 876 struct 855 877 { … … 859 881 /** The address size; 0=16-bit, 1=32-bit, 2=64-bit, rest undefined. */ 860 882 uint32_t u3AddrSize : 3; 861 /** Memory/Register - Always cleared to 0 to indicate memory operand. */862 uint32_t fIsRegOperand: 1;883 /** Cleared to 0. */ 884 uint32_t u1Cleared0 : 1; 863 885 uint32_t u4Reserved0 : 4; 864 886 /** The segment register (X86_SREG_XXX). */ … … 874 896 /** Register 2 (X86_GREG_XXX). */ 875 897 uint32_t iReg2 : 4; 876 } InvVmxXsaves; 898 } VmxXsave; 899 /** LIDT, LGDT, SIDT, SGDT information. */ 900 struct 901 { 902 /** Scaling; 0=no scaling, 1=scale-by-2, 2=scale-by-4, 3=scale-by-8. */ 903 uint32_t u2Scaling : 2; 904 uint32_t u5Undef0 : 5; 905 /** The address size; 0=16-bit, 1=32-bit, 2=64-bit, rest undefined. */ 906 uint32_t u3AddrSize : 3; 907 /** Always cleared to 0. */ 908 uint32_t u1Cleared0 : 1; 909 /** Operand size; 0=16-bit, 1=32-bit, undefined for 64-bit. */ 910 uint32_t uOperandSize : 1; 911 uint32_t u3Undef0 : 3; 912 /** The segment register (X86_SREG_XXX). */ 913 uint32_t iSegReg : 3; 914 /** The index register (X86_GREG_XXX). */ 915 uint32_t iIdxReg : 4; 916 /** Set if index register is invalid. */ 917 uint32_t fIdxRegInvalid : 1; 918 /** The base register (X86_GREG_XXX). */ 919 uint32_t iBaseReg : 4; 920 /** Set if base register is invalid. */ 921 uint32_t fBaseRegInvalid : 1; 922 /** Instruction identity (VMX_INSTR_ID_XXX). */ 923 uint32_t u2InstrId : 2; 924 uint32_t u2Undef0 : 2; 925 } GdtIdt; 926 /** LLDT, LTR, SLDT, STR information. */ 927 struct 928 { 929 /** Scaling; 0=no scaling, 1=scale-by-2, 2=scale-by-4, 3=scale-by-8. */ 930 uint32_t u2Scaling : 2; 931 uint32_t u1Undef0 : 1; 932 /** Register 1 (X86_GREG_XXX). */ 933 uint32_t iReg1 : 4; 934 /** The address size; 0=16-bit, 1=32-bit, 2=64-bit, rest undefined. */ 935 uint32_t u3AddrSize : 3; 936 /** Memory/Register - Always cleared to 0 to indicate memory operand. */ 937 uint32_t fIsRegOperand : 1; 938 uint32_t u4Undef0 : 4; 939 /** The segment register (X86_SREG_XXX). */ 940 uint32_t iSegReg : 3; 941 /** The index register (X86_GREG_XXX). */ 942 uint32_t iIdxReg : 4; 943 /** Set if index register is invalid. */ 944 uint32_t fIdxRegInvalid : 1; 945 /** The base register (X86_GREG_XXX). */ 946 uint32_t iBaseReg : 4; 947 /** Set if base register is invalid. */ 948 uint32_t fBaseRegInvalid : 1; 949 /** Instruction identity (VMX_INSTR_ID_XXX). */ 950 uint32_t u2InstrId : 2; 951 uint32_t u2Undef0 : 2; 952 } LdtTr; 953 /** RDRAND, RDSEED information. */ 954 struct 955 { 956 /** Scaling; 0=no scaling, 1=scale-by-2, 2=scale-by-4, 3=scale-by-8. */ 957 uint32_t u2Undef0 : 2; 958 /** Destination register (X86_GREG_XXX). */ 959 uint32_t iReg1 : 4; 960 uint32_t u4Undef0 : 4; 961 /** Operand size; 0=16-bit, 1=32-bit, 2=64-bit, 3=unused. */ 962 uint32_t u2OperandSize : 2; 963 uint32_t u19Def0 : 20; 964 } RdrandRdseed; 965 struct 966 { 967 /** Scaling; 0=no scaling, 1=scale-by-2, 2=scale-by-4, 3=scale-by-8. */ 968 uint32_t u2Scaling : 2; 969 uint32_t u1Undef0 : 1; 970 /** Register 1 (X86_GREG_XXX). */ 971 uint32_t iReg1 : 4; 972 /** The address size; 0=16-bit, 1=32-bit, 2=64-bit, rest undefined. */ 973 uint32_t u3AddrSize : 3; 974 /** Memory/Register - Always cleared to 0 to indicate memory operand. */ 975 uint32_t fIsRegOperand : 1; 976 /** Operand size; 0=16-bit, 1=32-bit, 2=64-bit, 3=unused. */ 977 uint32_t u4Undef0 : 4; 978 /** The segment register (X86_SREG_XXX). */ 979 uint32_t iSegReg : 3; 980 /** The index register (X86_GREG_XXX). */ 981 uint32_t iIdxReg : 4; 982 /** Set if index register is invalid. */ 983 uint32_t fIdxRegInvalid : 1; 984 /** The base register (X86_GREG_XXX). */ 985 uint32_t iBaseReg : 4; 986 /** Set if base register is invalid. */ 987 uint32_t fBaseRegInvalid : 1; 988 /** Register 2 (X86_GREG_XXX). */ 989 uint32_t iReg2 : 4; 990 } VmreadVmwrite; 991 /** This is a combination field of all instruction information. Note! Not all field 992 * combinations are valid (e.g., iReg1 is undefined for memory operands). */ 993 struct 994 { 995 /** Scaling; 0=no scaling, 1=scale-by-2, 2=scale-by-4, 3=scale-by-8. */ 996 uint32_t u2Scaling : 2; 997 uint32_t u1Undef0 : 1; 998 /** Register 1 (X86_GREG_XXX). */ 999 uint32_t iReg1 : 4; 1000 /** The address size; 0=16-bit, 1=32-bit, 2=64-bit, rest undefined. */ 1001 uint32_t u3AddrSize : 3; 1002 /** Memory/Register - Always cleared to 0 to indicate memory operand. */ 1003 uint32_t fIsRegOperand : 1; 1004 /** Operand size; 0=16-bit, 1=32-bit, 2=64-bit, 3=unused. */ 1005 uint32_t uOperandSize : 2; 1006 uint32_t u2Undef0 : 2; 1007 /** The segment register (X86_SREG_XXX). */ 1008 uint32_t iSegReg : 3; 1009 /** The index register (X86_GREG_XXX). */ 1010 uint32_t iIdxReg : 4; 1011 /** Set if index register is invalid. */ 1012 uint32_t fIdxRegInvalid : 1; 1013 /** The base register (X86_GREG_XXX). */ 1014 uint32_t iBaseReg : 4; 1015 /** Set if base register is invalid. */ 1016 uint32_t fBaseRegInvalid : 1; 1017 /** Register 2 (X86_GREG_XXX) or instruction identity. */ 1018 uint32_t iReg2 : 4; 1019 } All; 877 1020 } VMXEXITINSTRINFO; 878 1021 AssertCompileSize(VMXEXITINSTRINFO, 4); … … 2122 2265 2123 2266 2267 /** @name VM-exit instruction identity. 2268 * 2269 * These are found in VM-exit instruction information fields for certain 2270 * instructions. 2271 * @{ */ 2272 typedef uint8_t VMXINSTRID; 2273 #define VMX_INSTR_ID_VALID RT_BIT(7) 2274 #define VMX_INSTR_ID_IS_VALID(a) (((a) >> 7) & 1) 2275 #define VMX_INSTR_ID_GET_ID(a) ((a) & ~VMX_INSTR_ID_VALID) 2276 #define VMX_INSTR_ID_NONE 0x7f 2277 /** The following values are in accordance to the VT-x spec: */ 2278 #define VMX_INSTR_ID_SGDT ((VMX_INSTR_ID_VALID) | 0) 2279 #define VMX_INSTR_ID_SIDT ((VMX_INSTR_ID_VALID) | 1) 2280 #define VMX_INSTR_ID_LGDT ((VMX_INSTR_ID_VALID) | 2) 2281 #define VMX_INSTR_ID_LIDT ((VMX_INSTR_ID_VALID) | 3) 2282 2283 #define VMX_INSTR_ID_SLDT ((VMX_INSTR_ID_VALID) | 0) 2284 #define VMX_INSTR_ID_STR ((VMX_INSTR_ID_VALID) | 1) 2285 #define VMX_INSTR_ID_LLDT ((VMX_INSTR_ID_VALID) | 2) 2286 #define VMX_INSTR_ID_LTR ((VMX_INSTR_ID_VALID) | 3) 2287 /** @} */ 2288 2289 2124 2290 /** @name IDT-vectoring information. 2125 2291 * @{ -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r73627 r73708 5874 5874 AssertCompile(RT_ELEMENTS(s_auAccessSizeMasks) == RT_ELEMENTS(s_auAddrSizeMasks)); 5875 5875 5876 uint8_t const uAddrSize = pExitInstrInfo-> InvVmxXsaves.u3AddrSize;5877 uint8_t const iSegReg = pExitInstrInfo-> InvVmxXsaves.iSegReg;5878 bool const fIdxRegValid = !pExitInstrInfo-> InvVmxXsaves.fIdxRegInvalid;5879 uint8_t const iIdxReg = pExitInstrInfo-> InvVmxXsaves.iIdxReg;5880 uint8_t const uScale = pExitInstrInfo-> InvVmxXsaves.u2Scaling;5881 bool const fBaseRegValid = !pExitInstrInfo-> InvVmxXsaves.fBaseRegInvalid;5882 uint8_t const iBaseReg = pExitInstrInfo-> InvVmxXsaves.iBaseReg;5883 bool const fIsMemOperand = !pExitInstrInfo-> InvVmxXsaves.fIsRegOperand;5876 uint8_t const uAddrSize = pExitInstrInfo->All.u3AddrSize; 5877 uint8_t const iSegReg = pExitInstrInfo->All.iSegReg; 5878 bool const fIdxRegValid = !pExitInstrInfo->All.fIdxRegInvalid; 5879 uint8_t const iIdxReg = pExitInstrInfo->All.iIdxReg; 5880 uint8_t const uScale = pExitInstrInfo->All.u2Scaling; 5881 bool const fBaseRegValid = !pExitInstrInfo->All.fBaseRegInvalid; 5882 uint8_t const iBaseReg = pExitInstrInfo->All.iBaseReg; 5883 bool const fIsMemOperand = !pExitInstrInfo->All.fIsRegOperand; 5884 5884 bool const fIsLongMode = CPUMIsGuestInLongModeEx(&pVCpu->cpum.GstCtx); 5885 5885 … … 5901 5901 * See AMD spec. 4.5.2 "Segment Registers". 5902 5902 */ 5903 RTGCPTR GCPtrMem 5903 RTGCPTR GCPtrMem = GCPtrDisp; 5904 5904 if (fBaseRegValid) 5905 5905 GCPtrMem += pVCpu->cpum.GstCtx.aGRegs[iBaseReg].u64;
Note:
See TracChangeset
for help on using the changeset viewer.