X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmx.h;h=9dcaa5d5a599cb19c71e26ff70280955ef958a28;hb=f1d8183ae8c4390dfc74cb2780dd2058c569fc57;hp=4c04647d3f79f4a6ae731621ba58023f77d09768;hpb=e058c75f238c6662f6ae1cd517bbca030cc130ab;p=palacios.git diff --git a/palacios/include/palacios/vmx.h b/palacios/include/palacios/vmx.h index 4c04647..9dcaa5d 100644 --- a/palacios/include/palacios/vmx.h +++ b/palacios/include/palacios/vmx.h @@ -28,6 +28,8 @@ #include #include +#include +#include // Intel VMX Specific MSRs #define VMX_FEATURE_CONTROL_MSR 0x0000003a @@ -74,9 +76,44 @@ typedef enum { NORMAL } vmx_state_t; +struct tss_descriptor { + union { + ulong_t value; + struct { + uint16_t limit1; + uint16_t base1; + uint_t base2 : 8; + /* In IA32, type follows the form 10B1b, where B is the busy flag */ + uint_t type : 4; + uint_t zero1 : 1; + uint_t dpl : 2; + uint_t present : 1; + uint_t limit2 : 4; + uint_t available : 1; + uint_t zero2 : 1; + uint_t zero3 : 1; + uint_t granularity : 1; + uint_t base3 : 8; +#ifdef __V3_64BIT__ + uint32_t base4; + uint_t rsvd1 : 8; + uint_t zero4 : 5; + uint_t rsvd2 : 19; +#endif + } __attribute__((packed)); + } __attribute__((packed)); +}__attribute__((packed)); + +struct vmcs_host_state { + struct v3_segment gdtr; + struct v3_segment idtr; + struct v3_segment tr; +}; + struct vmx_data { vmx_state_t state; - struct vmcs_data vmcs; + addr_t vmcs_ptr_phys; + struct vmcs_host_state host_state; }; @@ -94,17 +131,13 @@ struct Instruction { -int is_vmx_capable(); - -VmxOnRegion * Init_VMX(); -VmxOnRegion * CreateVmxOnRegion(); - -int VMLaunch(struct VMDescriptor *vm); +int v3_is_vmx_capable(); +void v3_init_vmx(struct v3_ctrl_ops* vm_ops); -int Do_VMM(struct VMXRegs regs); - #endif // ! __V3VEE__ #endif + +