X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmx_assist.h;h=d9fc31d8cf63ddbb8c300248551030c0d853284e;hb=0121a4503305424096e2b5c5bd3b6c3af2d813e5;hp=3f5ec93f27f1b300df4a891f29f7bc3c6074e9af;hpb=2b9b1852a1c754b10f13576358b494fb04fe9940;p=palacios.git diff --git a/palacios/include/palacios/vmx_assist.h b/palacios/include/palacios/vmx_assist.h index 3f5ec93..d9fc31d 100644 --- a/palacios/include/palacios/vmx_assist.h +++ b/palacios/include/palacios/vmx_assist.h @@ -32,14 +32,15 @@ #define VMXASSIST_BASE 0xD0000 #define VMXASSIST_MAGIC 0x17101966 -#define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8) -#define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12) -#define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4) -#define NR_EXCEPTION_HANDLER 32 -#define NR_INTERRUPT_HANDLERS 16 -#define NR_TRAPS (NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS) +struct vmx_assist_header { + uint64_t rsvd; // 8 bytes of nothing + uint32_t magic; + uint32_t new_ctx_gpa; + uint32_t old_ctx_gpa; +} __attribute__((packed)); + union vmcs_arbytes { struct arbyte_fields { @@ -54,9 +55,16 @@ union vmcs_arbytes { g : 1, null_bit : 1, reserved2 : 15; - } fields; + } __attribute__((packed)) fields; unsigned int bytes; -}; +} __attribute__((packed)); + +struct vmx_assist_segment { + uint32_t sel; + uint32_t limit; + uint32_t base; + union vmcs_arbytes arbytes; +} __attribute__((packed)); /* * World switch state @@ -68,45 +76,25 @@ struct vmx_assist_context { uint32_t cr0; uint32_t cr3; /* page table directory */ uint32_t cr4; + uint32_t idtr_limit; /* idt */ uint32_t idtr_base; + uint32_t gdtr_limit; /* gdt */ uint32_t gdtr_base; - uint32_t cs_sel; /* cs selector */ - uint32_t cs_limit; - uint32_t cs_base; - union vmcs_arbytes cs_arbytes; - uint32_t ds_sel; /* ds selector */ - uint32_t ds_limit; - uint32_t ds_base; - union vmcs_arbytes ds_arbytes; - uint32_t es_sel; /* es selector */ - uint32_t es_limit; - uint32_t es_base; - union vmcs_arbytes es_arbytes; - uint32_t ss_sel; /* ss selector */ - uint32_t ss_limit; - uint32_t ss_base; - union vmcs_arbytes ss_arbytes; - uint32_t fs_sel; /* fs selector */ - uint32_t fs_limit; - uint32_t fs_base; - union vmcs_arbytes fs_arbytes; - uint32_t gs_sel; /* gs selector */ - uint32_t gs_limit; - uint32_t gs_base; - union vmcs_arbytes gs_arbytes; - uint32_t tr_sel; /* task selector */ - uint32_t tr_limit; - uint32_t tr_base; - union vmcs_arbytes tr_arbytes; - uint32_t ldtr_sel; /* ldtr selector */ - uint32_t ldtr_limit; - uint32_t ldtr_base; - union vmcs_arbytes ldtr_arbytes; + + struct vmx_assist_segment cs; + struct vmx_assist_segment ds; + struct vmx_assist_segment es; + struct vmx_assist_segment ss; + struct vmx_assist_segment fs; + struct vmx_assist_segment gs; + struct vmx_assist_segment tr; + struct vmx_assist_segment ldtr; + unsigned char rm_irqbase[2]; -}; +} __attribute__((packed)); typedef struct vmx_assist_context vmx_assist_context_t;