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.


Latest VMX work that still has bug in guest state causing #GP after launch.
[palacios.git] / palacios / src / palacios / vmx_handler.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/vmx_handler.h>
21 #include <palacios/vmm_types.h>
22 #include <palacios/vmm.h>
23 #include <palacios/vmcs.h>
24 #include <palacios/vmx_lowlevel.h>
25
26
27 static int inline check_vmcs_write(vmcs_field_t field, addr_t val)
28 {
29     int ret = 0;
30     ret = vmcs_write(field,val);
31
32     if (ret != VMX_SUCCESS) {
33         PrintError("VMWRITE error on %s!: %d\n", v3_vmcs_field_to_str(field), ret);
34         return 1;
35     }
36
37     return 0;
38 }
39
40 static int inline check_vmcs_read(vmcs_field_t field, void * val)
41 {
42     int ret = 0;
43     ret = vmcs_read(field,val);
44
45     if(ret != VMX_SUCCESS) {
46         PrintError("VMREAD error on %s!: %d\n", v3_vmcs_field_to_str(field), ret);
47         return 1;
48     }
49
50     return 0;
51 }
52
53 int v3_handle_vmx_exit(struct v3_gprs * gprs)
54 {
55     uint32_t exit_reason;
56     ulong_t exit_qual;
57
58     check_vmcs_read(VMCS_EXIT_REASON, &exit_reason);
59     check_vmcs_read(VMCS_EXIT_QUAL, &exit_qual);
60     PrintDebug("VMX Exit taken, id-qual: %x-%ld\n", exit_reason, exit_qual);
61     return -1;
62 }