Added code to register the extension. Also added an interface header file.
Added a case statement for exits on software interrupts in svm_handler.c. Also included
a compilation option for enabling swintr-specific debugging.
--- /dev/null
+/*
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National
+ * Science Foundation and the Department of Energy.
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico. You can find out more at
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2011, Kyle C. Hale <kh@u.northwestern.edu>
+ * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
+ * All rights reserved.
+ *
+ * Author: Kyle C. Hale <kh@u.northwestern.edu>
+ *
+ * This is free software. You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
+
+#ifndef __SW_INTR_H__
+#define __SW_INTR_H__
+
+#include <palacios/vmm.h>
+
+
+int v3_handle_swintr (struct guest_info * core);
+int v3_signal_swintr (struct guest_info * core, int vec);
+
+
+#endif
of software interrupts (i.e. the INTn instruction) and enable
any INT vector to be hooked
+config DEBUG_EXT_SW_INTERRUPTS
+ bool "Enable debugging of software interrupt interception code"
+ depends on EXT_SW_INTERRUPTS
+ default n
+ help
+ This will enable useful debugging printouts for software
+ intercept code
+
config EXT_SWINTR_PASSTHROUGH
bool "Hook all unhandled sofware interrupts for passthrough"
depends on EXT_SW_INTERRUPTS
*/
#include <palacios/vmm.h>
+#include <palacios/vmcb.h>
#include <palacios/vm_guest.h>
#include <palacios/vmm_extensions.h>
-
+#include <interfaces/sw_intr.h>
static int init_swintr_intercept (struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv_data);
static int init_swintr_intercept_core (struct guest_info * core, void * priv_data) {
+ vmcb_t * vmcb = (vmcb_t*)core->vmm_data;
+ vmcb_ctrl_t * ctrl_area = GET_VMCB_CTRL_AREA(vmcb);
+
+ ctrl_rea->instrs.INTn = 1;
return 0;
}
#include <palacios/vmm_telemetry.h>
#endif
-
+#ifdef V3_CONFIG_EXT_SW_INTERRUPTS
+#include <interfaces/sw_intr.h>
+#endif
int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_info1, addr_t exit_info2) {
// Force exit on other cores
break;
+#ifdef V3_CONFIG_EXT_SW_INTERRUPTS
+ case VMEXIT_SWINT:
+#ifdef V3_CONFIG_DEBUG_EXT_SW_INTERRUPTS
+ PrintDebug("Intercepted a software interrupt\n");
+#endif
+ if (v3_handle_swintr(info) == -1) {
+ PrintError("Error handling software interrupt\n");
+ return -1;
+ }
+ break;
+#endif
/* Exits Following this line are NOT HANDLED */