#include <palacios/vmm_ctrl_regs.h>
#include <palacios/svm_io.h>
#include <palacios/svm_halt.h>
+#include <palacios/svm_pause.h>
#include <palacios/vmm_intr.h>
PrintDebug("SVM Returned: Exit Code: 0x%x \t\t(tsc=%ul)\n",exit_code, (uint_t)info->time_state.guest_tsc);
- if (exit_code < 0x40) {
+ if (exit_code < 0x4f) {
char instr[32];
int ret;
// Dump out the instr stream
if (ret != 32) {
// I think we should inject a GPF into the guest
PrintDebug("Could not read instruction (ret=%d)\n", ret);
- return -1;
- }
+ } else {
- PrintDebug("Instr Stream:\n");
- PrintTraceMemDump(instr, 32);
+ PrintDebug("Instr Stream:\n");
+ PrintTraceMemDump(instr, 32);
+ }
}
if (handle_svm_halt(info) == -1) {
return -1;
}
+ } else if (exit_code == VMEXIT_PAUSE) {
+ PrintDebug("Guest paused\n");
+ if (handle_svm_pause(info) == -1) {
+ return -1;
+ }
} else {
addr_t rip_addr;
char buf[15];
PrintTraceMemDump(buf, 15);
- while(1);
+ return -1;
}
case EXTERNAL_IRQ:
{
uint_t irq = get_intr_number(info);
+
+ // check to see if ==-1 (non exists)
+
/*
guest_ctrl->EVENTINJ.vector = irq;
guest_ctrl->EVENTINJ.valid = 1;
guest_ctrl->EVENTINJ.type = SVM_INJECTION_EXCEPTION;
- if (info->intr_state.excp_error_code) {
+ if (info->intr_state.excp_error_code_valid) { //PAD
guest_ctrl->EVENTINJ.error_code = info->intr_state.excp_error_code;
guest_ctrl->EVENTINJ.ev = 1;
PrintDebug("Injecting error code %x\n", guest_ctrl->EVENTINJ.error_code);