X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fextensions%2Fext_sw_intr.c;h=5fbb72f8046af947186b12351f0e1a06cd8902c3;hb=94429f4b9268cf4d5f86dee5c3d929110811ac80;hp=ff43f3f713ea3b4e16793989f2a84ebfe87cef89;hpb=3da6af957c0c6d8b478898278969c0b5efb77365;p=palacios.git diff --git a/palacios/src/extensions/ext_sw_intr.c b/palacios/src/extensions/ext_sw_intr.c index ff43f3f..5fbb72f 100644 --- a/palacios/src/extensions/ext_sw_intr.c +++ b/palacios/src/extensions/ext_sw_intr.c @@ -23,9 +23,15 @@ #include #include #include +#include #include +#ifndef V3_CONFIG_DEBUG_EXT_SW_INTERRUPTS +#undef PrintDebug +#define PrintDebug(fmt, args...) +#endif + static int init_swintr_intercept (struct v3_vm_info * vm, v3_cfg_tree_t * cfg, void ** priv_data) { @@ -105,15 +111,13 @@ int v3_handle_swintr (struct guest_info * core) { hook = swintr_hooks[vector]; #else core->rip += instr.instr_length; - return v3_signal_swintr(core, vector); + return v3_raise_swintr(core, vector); #endif } ret = hook->handler(core, vector, NULL); if (ret == -1) { -#ifdef V3_CONFIG_DEBUG_EXT_SW_INTERRUPTS PrintDebug("V3 SWintr Handler: Error in swintr hook\n"); -#endif return -1; } @@ -121,21 +125,9 @@ int v3_handle_swintr (struct guest_info * core) { so that they finish in time for the next instruction... */ core->rip += instr.instr_length; - return v3_signal_swintr(core, vector); + return v3_raise_swintr(core, vector); } -int v3_signal_swintr (struct guest_info * core, uint8_t vector) { - struct v3_intr_core_state * intr_state = &(core->intr_core_state); - -#ifdef V3_CONFIG_DEBUG_EXT_SW_INTERRUPTS - PrintDebug("Signaling software interrupt in v3_signal_swintr()\n"); - PrintDebug("\tINT vector: %d\n", vector); -#endif - - intr_state->swintr_posted = 1; - intr_state->swintr_vector = vector; - return 0; -} int v3_hook_swintr (struct guest_info * core, @@ -164,10 +156,8 @@ int v3_hook_swintr (struct guest_info * core, static int passthrough_swintr_handler (struct guest_info * core, uint8_t vector, void * priv_data) { -#ifdef V3_CONFIG_DEBUG_EXT_SW_INTERRUPTS PrintDebug("[passthrough_swint_handler] INT vector=%d (guest=0x%p)\n", vector, (void*)core); -#endif return 0; } @@ -180,9 +170,7 @@ int v3_hook_passthrough_swintr (struct guest_info * core, uint8_t vector) { PrintError("guest_swintr_injection: failed to hook swint 0x%x (guest=0x%p)\n", vector, (void*)core); return -1; } else { -#ifdef V3_CONFIG_DEBUG_EXT_SW_INTERRUPTS PrintDebug("guest_swintr_injection: hooked swint 0x%x (guest=0x%p)\n", vector, (void*)core); -#endif return 0; } @@ -191,10 +179,3 @@ int v3_hook_passthrough_swintr (struct guest_info * core, uint8_t vector) { } - - - - - - -