}) \
+#define V3_Get_CPU() ({ \
+ int ret = 0; \
+ extern struct v3_os_hooks * os_hooks; \
+ if ((os_hooks) && (os_hooks)->get_cpu) { \
+ ret = (os_hooks)->get_cpu(); \
+ } \
+ ret; \
+ })
+
+#define V3_Call_On_CPU(cpu, fn, arg) \
+ do { \
+ extern struct v3_os_hooks * os_hooks; \
+ if ((os_hooks) && (os_hooks)->call_on_cpu) { \
+ (os_hooks)->call_on_cpu(cpu, fn, arg); \
+ } \
+ } while (0)
+
+
#define V3_ACK_IRQ(irq) \
do { \
extern struct v3_os_hooks * os_hooks; \
#include <devices/apic_regs.h>
#include <palacios/vmm.h>
#include <palacios/vmm_msr.h>
+#include <palacios/vmm_sprintf.h>
#include <palacios/vm_guest.h>
#ifndef CONFIG_DEBUG_APIC
};
+static void apic_incoming_ipi(void *val);
static int apic_read(addr_t guest_addr, void * dst, uint_t length, void * priv_data);
static int apic_write(addr_t guest_addr, void * src, uint_t length, void * priv_data);
PrintDebug("Raising APIC IRQ %d\n", irq_num);
if (*req_location & flag) {
- V3_Print("Interrupts coallescing\n");
+ //V3_Print("Interrupts coallescing\n");
}
if (*en_location & flag) {
}
#endif
} else {
- PrintError("Spurious EOI...\n");
+ //PrintError("Spurious EOI...\n");
}
return 0;
break;
case INT_CMD_LO_OFFSET:
+ apic->int_cmd.lo = op_val;
+ V3_Call_On_CPU(apic->int_cmd.dst, apic_incoming_ipi, (void *)apic->int_cmd.val);
+
+ break;
case INT_CMD_HI_OFFSET:
+ apic->int_cmd.hi = op_val;
+ break;
// Unhandled Registers
case EXT_APIC_CMD_OFFSET:
}
+static void apic_incoming_ipi(void *val)
+{
+PrintError("In apic_incoming_ipi, val=%p\n", val);
+ struct int_cmd_reg int_cmd;
+ char *type = NULL, *dest;
+ char foo[8];
+ int_cmd.val = (uint64_t)val;
+ switch (int_cmd.dst_shorthand)
+ {
+ case 0x0:
+ sprintf(foo, "%d", int_cmd.dst);
+ dest = foo;
+ break;
+ case 0x1:
+ dest = "(self)";
+ break;
+ case 0x2:
+ dest = "(broadcast inclusive)";
+ break;
+ case 0x3:
+ dest = "(broadcast)";
+ break;
+ }
+ switch (int_cmd.msg_type)
+ {
+ case 0x0:
+ type = "";
+ break;
+ case 0x4:
+ type = "(NMI)";
+ break;
+ case 0x5:
+ type = "(INIT)";
+ break;
+ case 0x6:
+ type = "(Startup)";
+ break;
+ }
+ PrintError("Receieved IPI on CPU %d type=%s dest=%s\n",
+ V3_Get_CPU(), type, dest);
+//%p %s to CPU %d on CPU %d.\n", val, foo, type, dest, (int)V3_Get_CPU());
+ return;
+}
static struct intr_ctrl_ops intr_ops = {
PrintDebug("Toggling Debugging\n");
v3_dbg_enable ^= 1;
} else if (evt->scan_code == 0x41) { // F7 telemetry dump
- v3_print_telemetry(info);
+ //v3_print_telemetry(info);
}
rdtscll(info->time_state.cached_host_tsc);
guest_ctrl->TSC_OFFSET = info->time_state.guest_tsc - info->time_state.cached_host_tsc;
+
+ //V3_Print("Calling v3_svm_launch\n");
v3_svm_launch((vmcb_t *)V3_PAddr(info->vmm_data), &(info->vm_regs), (vmcb_t *)host_vmcbs[info->cpu_id]);
+ //V3_Print("SVM Returned: Exit Code: %x, guest_rip=%lx\n", (uint32_t)(guest_ctrl->exit_code), (unsigned long)guest_state->rip);
- v3_last_exit = (uint32_t)(guest_ctrl->exit_code);
- // v3_print_cond("SVM Returned: Exit Code: %x\n", (uint32_t)(guest_ctrl->exit_code));
+ v3_last_exit = (uint32_t)(guest_ctrl->exit_code);
rdtscll(tmp_tsc);
return 0;
}
+#if 0
// checks for circular entity references, returns non-zero if no circular
// references are found, zero otherwise
static int v3_xml_ent_ok(char * name, char * s, char ** ent) {
}
}
}
+#endif
<vm class="PC">
<!-- Memory in MB -->
- <memory>1024</memory>
+ <memory>256</memory>
<!-- Basic VMM system flags -->
<telemetry>enable</telemetry>
<!-- This is where you add disk images -->
<files>
<!-- The file 'id' is used as a reference for other configuration components -->
- <file id="boot-cd" filename="/home/jarusl/image.iso" />
+ <file id="boot-cd" filename="/home/ktpedre/google_code/smp_guest/kitten_guest/arch/x86_64/boot/image.iso" />
<!--<file id="harddisk" filename="firefox.img" />-->
</files>
<bus>pci0</bus>
</device>
- <device id="LNX_VIRTIO_SYM" name="sym_pci">
+ <device id="IDE" name="ide">
<bus>pci0</bus>
+ <controller>southbridge</controller>
</device>
- <device id="LNX_VIRTIO_BLK" name="blk_virtio">
+<!--
+ <device id="LNX_VIRTIO_SYM" name="sym_pci">
<bus>pci0</bus>
</device>
- <device id="LNX_VIRTIO_BALLOON" name="balloon">
+ <device id="LNX_VIRTIO_BLK" name="blk_virtio">
<bus>pci0</bus>
</device>
- <device id="IDE" name="ide">
+ <device id="LNX_VIRTIO_BALLOON" name="balloon">
<bus>pci0</bus>
- <controller>southbridge</controller>
</device>
<device id="PCI_PASSTHROUGH" name="e1000">
<device_id>0x107c</device_id>
<irq>64</irq>
</device>
+-->
<!-- This is a Storage Backend that connects to a frontend -->
</frontend>
</device>
+<!---
<device id="SYM_SWAP" name="sym swap">
<frontend tag="blk_virtio" />
<size>150</size>
</device>
+-->
<!--