From: Kevin Pedretti Date: Fri, 15 Jan 2010 16:51:03 +0000 (-0700) Subject: Merge branch 'devel' of ssh://ktpedre@newskysaw.cs.northwestern.edu/home/palacios... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=6b117f85ced19739c5dd0f0057a906b9cb765a16;hp=36c1666cf64c49302d906a79d8cafbf760452d86;p=palacios.git Merge branch 'devel' of ssh://ktpedre@newskysaw.cs.northwestern.edu/home/palacios/palacios into devel --- diff --git a/bios/rombios/BIOS-bochs-latest b/bios/rombios/BIOS-bochs-latest index ea9a1ec..4bbf52a 100644 Binary files a/bios/rombios/BIOS-bochs-latest and b/bios/rombios/BIOS-bochs-latest differ diff --git a/bios/rombios/Makefile b/bios/rombios/Makefile index c42eaaf..12154a7 100644 --- a/bios/rombios/Makefile +++ b/bios/rombios/Makefile @@ -13,7 +13,7 @@ clean: rm -f BIOS-bochs-* BIOS-bochs-latest: rombios.c biossums - gcc -DBX_SMP_PROCESSORS=1 -E -P $< > _rombios_.c + gcc -DBX_SMP_PROCESSORS=4 -E -P $< > _rombios_.c bcc -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c sed -e 's/^\.text//' -e 's/^\.data//' rombios.s > _rombios_.s as86 _rombios_.s -b tmp.bin -u- -w- -g -0 -j -O -l rombios.txt @@ -23,7 +23,7 @@ BIOS-bochs-latest: rombios.c biossums rm -f _rombios_.s BIOS-bochs-latest.elf: rombios.c biossums - gcc -DBX_SMP_PROCESSORS=1 -E -P $< > _rombios_elf.c + gcc -DBX_SMP_PROCESSORS=4 -E -P $< > _rombios_elf.c bcc -o rombios_elf.s -C-c -D__i86__ -0 -S _rombios_elf.c sed -e 's/^\.text//' -e 's/^\.data//' rombios_elf.s > _rombios_elf.s as86 _rombios_elf.s -u- -w- -g -0 -j -O -l rombios_elf.txt diff --git a/bios/rombios/rombios.c b/bios/rombios/rombios.c index f754bad..717a1b2 100644 --- a/bios/rombios/rombios.c +++ b/bios/rombios/rombios.c @@ -27,7 +27,7 @@ // ROM BIOS for use with Bochs/Plex x86 emulation environment -#define HVMASSIST +//#define HVMASSIST #undef HVMTEST // Xen full virtualization does not handle unaligned IO with page crossing. diff --git a/palacios/include/palacios/vmm.h b/palacios/include/palacios/vmm.h index f24b8e3..bbc4eba 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 3ea76cb..c8ec4c7 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 @@ -184,6 +185,7 @@ struct apic_state { struct guest_info * core; }; +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); @@ -284,7 +286,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) { @@ -369,7 +371,7 @@ static int apic_do_eoi(struct apic_state * apic) { } #endif } else { - PrintError("Spurious EOI...\n"); + //PrintError("Spurious EOI...\n"); } return 0; @@ -845,7 +847,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: @@ -1037,6 +1045,49 @@ static void apic_update_time(struct guest_info * info, ullong_t cpu_cycles, ullo } +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/palacios/svm.c b/palacios/src/palacios/svm.c index c92da0c..1a1cf35 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -463,13 +463,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 @@ +