1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
4 #include <palacios/vmm.h>
5 #include <palacios/svm.h>
6 #include <palacios/vmx.h>
7 #include <palacios/vmm_intr.h>
8 #include <palacios/vmm_config.h>
9 #include <palacios/vm_guest.h>
10 #include <palacios/vmm_decoder.h>
12 v3_cpu_arch_t v3_cpu_type;
13 struct vmm_os_hooks * os_hooks = NULL;
17 struct guest_info * allocate_guest() {
18 void * info = V3_Malloc(sizeof(struct guest_info));
19 memset(info, 0, sizeof(struct guest_info));
25 void Init_V3(struct vmm_os_hooks * hooks, struct vmm_ctrl_ops * vmm_ops) {
28 v3_cpu_type = V3_INVALID_CPU;
32 if (is_svm_capable()) {
34 PrintDebug("Machine is SVM Capable\n");
35 vmm_ops->allocate_guest = &allocate_guest;
36 vmm_ops->config_guest = &config_guest;
40 } else if (is_vmx_capable()) {
41 vmm_cpu_type = VMM_VMX_CPU;
42 PrintDebug("Machine is VMX Capable\n");
45 PrintDebug("CPU has no virtualization Extensions\n");