Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel' of ssh://ktpedre@newskysaw.cs.northwestern.edu/home/palacios...
Kevin Pedretti [Fri, 15 Jan 2010 16:51:03 +0000 (09:51 -0700)]
bios/rombios/BIOS-bochs-latest
bios/rombios/Makefile
bios/rombios/rombios.c
palacios/include/palacios/vmm.h
palacios/src/devices/apic.c
palacios/src/palacios/svm.c
palacios/src/palacios/vmm_xml.c
utils/guest_creator/default.xml

index ea9a1ec..4bbf52a 100644 (file)
Binary files a/bios/rombios/BIOS-bochs-latest and b/bios/rombios/BIOS-bochs-latest differ
index c42eaaf..12154a7 100644 (file)
@@ -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
index f754bad..717a1b2 100644 (file)
@@ -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.
index f24b8e3..bbc4eba 100644 (file)
@@ -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;                   \
index 3ea76cb..c8ec4c7 100644 (file)
@@ -22,6 +22,7 @@
 #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
@@ -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 = {
index c92da0c..1a1cf35 100644 (file)
@@ -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);
 
index e632a4f..f3641be 100644 (file)
@@ -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
 
 
 
index d8576e7..5635dbd 100644 (file)
@@ -3,7 +3,7 @@
 <vm class="PC"> 
 
        <!-- Memory in MB -->
-       <memory>1024</memory> 
+       <memory>256</memory> 
 
        <!-- Basic VMM system flags -->
        <telemetry>enable</telemetry>
@@ -27,7 +27,7 @@
        <!-- 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">
@@ -94,6 +95,7 @@
                        <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>
+-->
 
 
 <!--