Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


cleaned up instrumentation implementation
[palacios.git] / palacios / src / palacios / vmm.c
1 /* 
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.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
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.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #include <palacios/vmm.h>
21 #include <palacios/svm.h>
22 #include <palacios/vmx.h>
23 #include <palacios/vmm_intr.h>
24 #include <palacios/vmm_config.h>
25 #include <palacios/vm_guest.h>
26 #include <palacios/vmm_instrument.h>
27
28
29 v3_cpu_arch_t v3_cpu_type;
30 struct v3_os_hooks * os_hooks = NULL;
31
32
33
34 static struct guest_info * allocate_guest() {
35   void * info = V3_Malloc(sizeof(struct guest_info));
36   memset(info, 0, sizeof(struct guest_info));
37   return info;
38 }
39
40
41
42 void Init_V3(struct v3_os_hooks * hooks, struct v3_ctrl_ops * vmm_ops) {
43   os_hooks = hooks;
44
45   v3_cpu_type = V3_INVALID_CPU;
46
47 #ifdef INSTRUMENT_VMM
48   v3_init_instrumentation();
49 #endif
50
51   if (v3_is_svm_capable()) {
52
53     PrintDebug("Machine is SVM Capable\n");
54     vmm_ops->allocate_guest = &allocate_guest;
55     vmm_ops->config_guest = &v3_config_guest;
56     v3_init_SVM(vmm_ops);
57
58     /*
59   } else if (is_vmx_capable()) {
60     vmm_cpu_type = VMM_VMX_CPU;
61     PrintDebug("Machine is VMX Capable\n");
62     //Init_VMX();*/
63   } else {
64     PrintDebug("CPU has no virtualization Extensions\n");
65   }
66 }
67
68
69 // Get CPU Type..
70