From: Jack Lange Date: Tue, 1 Feb 2011 01:10:56 +0000 (-0600) Subject: added stricter types to the msr hook framework X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=912f74aae257be698044de894124289ba5356621;hp=18713f98a14335b09cb7d87b3bea087255eaf10d;p=palacios.git added stricter types to the msr hook framework --- diff --git a/palacios/include/palacios/vmm_msr.h b/palacios/include/palacios/vmm_msr.h index 645baa8..0d2391a 100644 --- a/palacios/include/palacios/vmm_msr.h +++ b/palacios/include/palacios/vmm_msr.h @@ -45,10 +45,10 @@ struct v3_msr { typedef struct v3_msr v3_msr_t; struct v3_msr_hook { - uint_t msr; + uint32_t msr; - int (*read)(struct guest_info * core, uint_t msr, struct v3_msr * dst, void * priv_data); - int (*write)(struct guest_info * core, 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; @@ -63,7 +63,7 @@ struct v3_msr_map { uint_t num_hooks; struct list_head hook_list; - int (*update_map)(struct v3_vm_info * vm, uint_t msr, int hook_read, int hook_write); + int (*update_map)(struct v3_vm_info * vm, uint32_t msr, int hook_read, int hook_write); void * arch_data; }; @@ -72,15 +72,15 @@ struct v3_msr_map { 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 v3_vm_info * vm, uint_t msr); +int v3_unhook_msr(struct v3_vm_info * vm, uint32_t msr); -int v3_hook_msr(struct v3_vm_info * vm, uint_t msr, - int (*read)(struct guest_info * core, uint_t msr, struct v3_msr * dst, void * priv_data), - int (*write)(struct guest_info * core, 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 v3_vm_info * vm, uint_t msr); +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); diff --git a/palacios/src/palacios/vmm_msr.c b/palacios/src/palacios/vmm_msr.c index 5fe8ecf..68d4767 100644 --- a/palacios/src/palacios/vmm_msr.c +++ b/palacios/src/palacios/vmm_msr.c @@ -48,7 +48,7 @@ int v3_deinit_msr_map(struct v3_vm_info * vm) { } int v3_handle_msr_write(struct guest_info * info) { - uint_t msr_num = info->vm_regs.rcx; + uint32_t msr_num = info->vm_regs.rcx; struct v3_msr msr_val; struct v3_msr_hook * hook = NULL; @@ -77,7 +77,7 @@ int v3_handle_msr_write(struct guest_info * info) { int v3_handle_msr_read(struct guest_info * info) { - uint_t msr_num = info->vm_regs.rcx; + uint32_t msr_num = info->vm_regs.rcx; struct v3_msr msr_val; struct v3_msr_hook * hook = NULL; @@ -102,9 +102,9 @@ int v3_handle_msr_read(struct guest_info * info) { return 0; } -int v3_hook_msr(struct v3_vm_info * vm, uint_t msr, - int (*read)(struct guest_info * core, uint_t msr, struct v3_msr * dst, void * priv_data), - int (*write)(struct guest_info * core, 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_map * msr_map = &(vm->msr_map); @@ -148,7 +148,7 @@ static int free_hook(struct v3_vm_info * vm, struct v3_msr_hook * hook) { } -int v3_unhook_msr(struct v3_vm_info * vm, uint_t msr) { +int v3_unhook_msr(struct v3_vm_info * vm, uint32_t msr) { struct v3_msr_hook * hook = v3_get_msr_hook(vm, msr); if (hook == NULL) { @@ -163,7 +163,7 @@ int v3_unhook_msr(struct v3_vm_info * vm, uint_t msr) { -struct v3_msr_hook * v3_get_msr_hook(struct v3_vm_info * vm, uint_t msr) { +struct v3_msr_hook * v3_get_msr_hook(struct v3_vm_info * vm, uint32_t msr) { struct v3_msr_map * msr_map = &(vm->msr_map); struct v3_msr_hook * hook = NULL;