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) 2011, Kyle C. Hale <kh@u.norhtwestern.edu>
11 * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Kyle C. Hale <kh@u.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/vmm.h>
21 #include <palacios/vmcb.h>
22 #include <palacios/vm_guest.h>
23 #include <palacios/vmm_extensions.h>
25 #include <interfaces/sw_intr.h>
27 static int init_swintr_intercept (struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv_data);
33 static int deinit_swintr_intercept (struct v3_vm_info * vm, void * priv_data) {
39 static int init_swintr_intercept_core (struct guest_info * core, void * priv_data) {
40 vmcb_t * vmcb = (vmcb_t*)core->vmm_data;
41 vmcb_ctrl_t * ctrl_area = GET_VMCB_CTRL_AREA(vmcb);
43 ctrl_rea->instrs.INTn = 1;
49 static int deinit_swintr_intercept_core (struct guest_info * core, void * priv_data) {
55 static int swintr_entry (struct guest_info * core, void * priv_data) {
60 static int swintr_exit (struct guest_info * core, void * priv_data) {
67 static struct v3_extension_impl swintr_impl = {
68 .name = "swintr_intercept",
69 .init = init_swintr_intercept,
70 .deinit = deinit_swintr_intercept,
71 .core_init = init_swintr_intercept_core,
72 .core_deinit = deinit_swintr_intercept_core,
73 .on_entry = swintr_entry,
74 .on_exit = swintr_exit
77 register_extension(&swintr_impl);
80 int v3_handle_swintr (struct guest_info * core) {