X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_msr.h;h=f8cbd4e1f6f486ff602e8cec57c7c2e42e253b05;hb=a9e204d157a33976ca454b2ce8b161c2a5501b14;hp=5d3d2eb505adb91d6621e27d170dde284b1dd4d8;hpb=6c56ead58f57e08c23eab5d67f2a58f95ce712b4;p=palacios.git diff --git a/palacios/include/palacios/vmm_msr.h b/palacios/include/palacios/vmm_msr.h index 5d3d2eb..f8cbd4e 100644 --- a/palacios/include/palacios/vmm_msr.h +++ b/palacios/include/palacios/vmm_msr.h @@ -26,33 +26,46 @@ #include #include +#define SYSENTER_CS_MSR 0x00000174 +#define SYSENTER_ESP_MSR 0x00000175 +#define SYSENTER_EIP_MSR 0x00000176 +#define EFER_MSR 0xc0000080 +#define IA32_STAR_MSR 0xc0000081 +#define IA32_LSTAR_MSR 0xc0000082 +#define IA32_CSTAR_MSR 0xc0000083 +#define IA32_FMASK_MSR 0xc0000084 +#define FS_BASE_MSR 0xc0000100 +#define GS_BASE_MSR 0xc0000101 +#define IA32_KERN_GS_BASE_MSR 0xc0000102 + + struct guest_info; +struct v3_vm_info; struct v3_msr { - union { - ullong_t value; + union { + uint64_t value; - struct { - uint_t lo; - uint_t hi; + struct { + uint32_t lo; + uint32_t hi; + } __attribute__((packed)); } __attribute__((packed)); - } __attribute__((packed)); } __attribute__((packed)); - typedef struct v3_msr v3_msr_t; struct v3_msr_hook { - uint_t msr; + uint32_t msr; - int (*read)(uint_t msr, struct v3_msr * dst, void * priv_data); - int (*write)(uint_t msr, struct v3_msr src, void * priv_data); + int (*read)(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data); + int (*write)(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data); - void * priv_data; + void * priv_data; - struct list_head link; + struct list_head link; }; @@ -60,24 +73,37 @@ struct v3_msr_hook { struct v3_msr_hook; struct v3_msr_map { - uint_t num_hooks; - struct list_head hook_list; + uint_t num_hooks; + struct list_head hook_list; + + int (*update_map)(struct v3_vm_info * vm, uint32_t msr, int hook_read, int hook_write); + void * arch_data; + }; -void v3_init_msr_map(struct guest_info * info); +void v3_init_msr_map(struct v3_vm_info * vm); +int v3_deinit_msr_map(struct v3_vm_info * vm); -int v3_unhook_msr(struct guest_info * info, uint_t msr); +int v3_unhook_msr(struct v3_vm_info * vm, uint32_t msr); -int v3_hook_msr(struct guest_info * info, uint_t msr, - int (*read)(uint_t msr, struct v3_msr * dst, void * priv_data), - int (*write)(uint_t msr, struct v3_msr src, void * priv_data), +int v3_hook_msr(struct v3_vm_info * vm, uint32_t msr, + int (*read)(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data), + int (*write)(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data), void * priv_data); -struct v3_msr_hook * v3_get_msr_hook(struct guest_info * info, uint_t msr); +int v3_msr_unhandled_read(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data); +int v3_msr_unhandled_write(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data); + +struct v3_msr_hook * v3_get_msr_hook(struct v3_vm_info * vm, uint32_t msr); + +void v3_refresh_msr_map(struct v3_vm_info * vm); + +void v3_print_msr_map(struct v3_vm_info * vm); -void v3_print_msr_map(struct guest_info * info); +int v3_handle_msr_write(struct guest_info * info); +int v3_handle_msr_read(struct guest_info * info);