From: Kevin Pedretti Date: Fri, 15 Jan 2010 00:16:12 +0000 (-0700) Subject: Philip's changes along with some minor changes from Kevin. X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=1f7a670397e97ea1028294d7b7b45d6ef1797d65 Philip's changes along with some minor changes from Kevin. --- diff --git a/palacios/include/palacios/vmm.h b/palacios/include/palacios/vmm.h index b05871f..7ed54f6 100644 --- a/palacios/include/palacios/vmm.h +++ b/palacios/include/palacios/vmm.h @@ -158,6 +158,24 @@ struct guest_info; }) \ +#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; \ diff --git a/palacios/src/devices/apic.c b/palacios/src/devices/apic.c index ccb89e3..6a65d37 100644 --- a/palacios/src/devices/apic.c +++ b/palacios/src/devices/apic.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #ifndef CONFIG_DEBUG_APIC @@ -183,6 +184,7 @@ struct apic_state { }; +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); @@ -283,7 +285,7 @@ static int activate_apic_irq(struct apic_state * apic, uint32_t irq_num) { 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) { @@ -368,7 +370,7 @@ static int apic_do_eoi(struct apic_state * apic) { } #endif } else { - PrintError("Spurious EOI...\n"); + //PrintError("Spurious EOI...\n"); } return 0; @@ -844,7 +846,13 @@ static int apic_write(addr_t guest_addr, void * src, uint_t length, void * priv_ 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: @@ -1036,6 +1044,49 @@ static void apic_update_time(ullong_t cpu_cycles, ullong_t cpu_freq, void * priv } +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 = { diff --git a/palacios/src/devices/keyboard.c b/palacios/src/devices/keyboard.c index eb76cc9..dfa2e6d 100644 --- a/palacios/src/devices/keyboard.c +++ b/palacios/src/devices/keyboard.c @@ -354,7 +354,7 @@ static int key_event_handler(struct guest_info * info, 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); } diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index acb5353..945aa70 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -466,13 +466,15 @@ int v3_svm_enter(struct guest_info * 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); diff --git a/palacios/src/palacios/vmm_xml.c b/palacios/src/palacios/vmm_xml.c index e632a4f..f3641be 100644 --- a/palacios/src/palacios/vmm_xml.c +++ b/palacios/src/palacios/vmm_xml.c @@ -363,6 +363,7 @@ static int v3_xml_close_tag(struct v3_xml_root * root, char * name, char * s) { 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) { @@ -390,6 +391,7 @@ static int v3_xml_ent_ok(char * name, char * s, char ** ent) { } } } +#endif diff --git a/utils/guest_creator/default.xml b/utils/guest_creator/default.xml index d8576e7..5635dbd 100644 --- a/utils/guest_creator/default.xml +++ b/utils/guest_creator/default.xml @@ -3,7 +3,7 @@ - 1024 + 256 enable @@ -27,7 +27,7 @@ - + @@ -64,21 +64,22 @@ pci0 - + pci0 + southbridge - + @@ -109,10 +111,12 @@ +