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".
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>
27 static int inline check_vmcs_write(vmcs_field_t field, addr_t val)
30 ret = vmcs_write(field,val);
32 if (ret != VMX_SUCCESS) {
33 PrintError("VMWRITE error on %s!: %d\n", v3_vmcs_field_to_str(field), ret);
40 static int inline check_vmcs_read(vmcs_field_t field, void * val)
43 ret = vmcs_read(field,val);
45 if(ret != VMX_SUCCESS) {
46 PrintError("VMREAD error on %s!: %d\n", v3_vmcs_field_to_str(field), ret);
53 int v3_handle_vmx_exit(struct v3_gprs * gprs)
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);