Changeset 74469 in vbox for trunk/include/VBox
- Timestamp:
- Sep 26, 2018 6:46:28 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm_vmx.h
r74468 r74469 2441 2441 * instructions. 2442 2442 * @{ */ 2443 typedef uint8_t VMXINSTRID; 2444 #define VMXINSTRID_VALID RT_BIT(7) 2445 #define VMXINSTRID_IS_VALID(a) (((a) >> 7) & 1) 2446 #define VMXINSTRID_GET_ID(a) ((a) & ~VMXINSTRID_VALID) 2443 typedef uint32_t VMXINSTRID; 2444 /** Whether the instruction ID field is valid. */ 2445 #define VMXINSTRID_VALID RT_BIT_32(31) 2446 /** Whether the instruction's primary operand in the Mod R/M byte (bits 0:3) is a 2447 * read or write. */ 2448 #define VMXINSTRID_MODRM_PRIMARY_OP_W RT_BIT_32(30) 2449 /** Gets whether the instruction ID is valid or not. */ 2450 #define VMXINSTRID_IS_VALID(a) (((a) >> 31) & 1) 2451 #define VMXINSTRID_IS_MODRM_PRIMARY_OP_W(a) (((a) >> 30) & 1) 2452 /** Gets the instruction ID. */ 2453 #define VMXINSTRID_GET_ID(a) ((a) & ~(VMXINSTRID_VALID | VMXINSTRID_MODRM_PRIMARY_OP_W)) 2454 /** No instruction ID info. */ 2447 2455 #define VMXINSTRID_NONE 0 2456 2448 2457 /** The OR'd rvalues are from the VT-x spec (valid bit is VBox specific): */ 2449 #define VMXINSTRID_SGDT ((VMXINSTRID_VALID) | 0) 2450 #define VMXINSTRID_SIDT ((VMXINSTRID_VALID) | 1) 2451 #define VMXINSTRID_LGDT ((VMXINSTRID_VALID) | 2) 2452 #define VMXINSTRID_LIDT ((VMXINSTRID_VALID) | 3) 2453 2454 #define VMXINSTRID_SLDT ((VMXINSTRID_VALID) | 0) 2455 #define VMXINSTRID_STR ((VMXINSTRID_VALID) | 1) 2456 #define VMXINSTRID_LLDT ((VMXINSTRID_VALID) | 2) 2457 #define VMXINSTRID_LTR ((VMXINSTRID_VALID) | 3) 2458 2459 /** The following are used internally and are not based on the VT-x spec: */ 2460 #define VMXINSTRID_VMLAUNCH ((VMXINSTRID_VALID) | 50) 2461 #define VMXINSTRID_VMRESUME ((VMXINSTRID_VALID) | 51) 2458 #define VMXINSTRID_SGDT (0x0 | VMXINSTRID_VALID | VMXINSTRID_MODRM_PRIMARY_OP_W) 2459 #define VMXINSTRID_SIDT (0x1 | VMXINSTRID_VALID | VMXINSTRID_MODRM_PRIMARY_OP_W) 2460 #define VMXINSTRID_LGDT (0x2 | VMXINSTRID_VALID) 2461 #define VMXINSTRID_LIDT (0x3 | VMXINSTRID_VALID) 2462 2463 #define VMXINSTRID_SLDT (0x0 | VMXINSTRID_VALID | VMXINSTRID_MODRM_PRIMARY_OP_W) 2464 #define VMXINSTRID_STR (0x1 | VMXINSTRID_VALID | VMXINSTRID_MODRM_PRIMARY_OP_W) 2465 #define VMXINSTRID_LLDT (0x2 | VMXINSTRID_VALID) 2466 #define VMXINSTRID_LTR (0x3 | VMXINSTRID_VALID) 2467 2468 /** The following IDs are used internally (some for logging, others for conveying 2469 * the ModR/M primary operand write bit): */ 2470 #define VMXINSTRID_VMLAUNCH (0x10 | VMXINSTRID_VALID) 2471 #define VMXINSTRID_VMRESUME (0x12 | VMXINSTRID_VALID) 2472 #define VMXINSTRID_VMWRITE (0x13 | VMXINSTRID_VALID | VMXINSTRID_MODRM_PRIMARY_OP_W) 2462 2473 /** @} */ 2463 2474 … … 3034 3045 /** The VM-exit instruction information. */ 3035 3046 VMXEXITINSTRINFO InstrInfo; 3036 /** Padding. */3037 uint32_t u32Padding0;3047 /** The VM-exit instruction ID. */ 3048 VMXINSTRID uInstrId; 3038 3049 3039 3050 /** The VM-exit qualification field. */ … … 3044 3055 * instruction VM-exit. */ 3045 3056 RTGCPTR GCPtrEffAddr; 3046 3047 /** The VM-exit instruction ID. */3048 VMXINSTRID uInstrId;3049 3057 } VMXVEXITINFO; 3050 3058 /** Pointer to the VMXVEXITINFO struct. */ … … 3052 3060 /** Pointer to a const VMXVEXITINFO struct. */ 3053 3061 typedef const VMXVEXITINFO *PCVMXVEXITINFO; 3062 AssertCompileMemberAlignment(VMXVEXITINFO, u64Qual, 8); 3054 3063 3055 3064 /** … … 3063 3072 * Intel but for our own requirements) as we use it to offset into guest memory. 3064 3073 * 3074 * Although the guest is supposed to access the VMCS only through the execution of 3075 * VMX instructions (VMREAD, VMWRITE etc.), since the VMCS may reside in guest 3076 * memory (e.g, active but not current VMCS), for saved-states compatibility, and 3077 * for teleportation purposes, any newly added fields should be added to the 3078 * appropriate reserved sections or at the end of the structure. 3079 * 3065 3080 * We always treat natural-width fields as 64-bit in our implementation since 3066 3081 * it's easier, allows for teleporation in the future and does not affect guest 3067 3082 * software. 3068 *3069 * Although the guest is supposed to access the VMCS only through the execution of3070 * VMX instructions (VMREAD, VMWRITE etc.), since the VMCS may reside in guest3071 * memory (e.g, active but not current VMCS), for saved-states compatibility, and3072 * for teleportation (when implemented) any newly added fields should be added to3073 * the appropriate reserved sections or at the end of the structure.3074 3083 */ 3075 3084 #pragma pack(1)
Note:
See TracChangeset
for help on using the changeset viewer.