2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
26 #include <palacios/vmm_types.h>
27 #include <palacios/vmm_list.h>
29 #define SYSENTER_CS_MSR 0x00000174
30 #define SYSENTER_ESP_MSR 0x00000175
31 #define SYSENTER_EIP_MSR 0x00000176
32 #define EFER_MSR 0xc0000080
33 #define IA32_STAR_MSR 0xc0000081
34 #define IA32_LSTAR_MSR 0xc0000082
35 #define IA32_CSTAR_MSR 0xc0000083
36 #define IA32_FMASK_MSR 0xc0000084
37 #define FS_BASE_MSR 0xc0000100
38 #define GS_BASE_MSR 0xc0000101
39 #define IA32_KERN_GS_BASE_MSR 0xc0000102
53 } __attribute__((packed));
54 } __attribute__((packed));
55 } __attribute__((packed));
58 typedef struct v3_msr v3_msr_t;
63 int (*read)(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data);
64 int (*write)(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data);
68 struct list_head link;
77 struct list_head hook_list;
79 int (*update_map)(struct v3_vm_info * vm, uint32_t msr, int hook_read, int hook_write);
85 void v3_init_msr_map(struct v3_vm_info * vm);
86 int v3_deinit_msr_map(struct v3_vm_info * vm);
88 int v3_unhook_msr(struct v3_vm_info * vm, uint32_t msr);
90 int v3_hook_msr(struct v3_vm_info * vm, uint32_t msr,
91 int (*read)(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data),
92 int (*write)(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data),
96 struct v3_msr_hook * v3_get_msr_hook(struct v3_vm_info * vm, uint32_t msr);
98 void v3_refresh_msr_map(struct v3_vm_info * vm);
100 void v3_print_msr_map(struct v3_vm_info * vm);
102 int v3_handle_msr_write(struct guest_info * info);
104 int v3_handle_msr_read(struct guest_info * info);
108 #endif // ! __V3VEE__