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.


This patch adds a few compiler conditionals so that multi-thread-specific code is...
Erik van der Kouwe [Sat, 22 Jan 2011 00:56:28 +0000 (18:56 -0600)]
palacios/include/palacios/vmm.h
palacios/src/devices/8259a.c
palacios/src/devices/apic.c
palacios/src/palacios/vmm.c

index 9ee2bf8..c39d7a1 100644 (file)
@@ -250,7 +250,9 @@ void v3_yield_cond(struct guest_info * info);
 void v3_print_cond(const char * fmt, ...);
 
 
+#ifdef CONFIG_MULTITHREAD_OS
 void v3_interrupt_cpu(struct v3_vm_info * vm, int logical_cpu, int vector);
+#endif
 
 
 v3_cpu_arch_t v3_get_cpu_type(int cpu_id);
index 66b3768..0d5e5ff 100644 (file)
@@ -216,7 +216,9 @@ static int pic_raise_intr(struct v3_vm_info * vm, void * private_data, int irq)
        return -1;
     }
 
+#ifdef CONFIG_MULTITHREAD_OS
     v3_interrupt_cpu(vm, 0, 0);
+#endif
 
     return 0;
 }
index e7d0177..7f70d9c 100644 (file)
@@ -599,7 +599,11 @@ static int deliver_ipi(struct apic_state * src_apic,
                //     host maitains logical proc->phsysical proc
                PrintDebug(" non-local core, forcing it to exit\n"); 
 
+#ifdef CONFIG_MULTITHREAD_OS
                v3_interrupt_cpu(dst_core->vm_info, dst_core->cpu_id, 0);
+#else
+               V3_ASSERT(0);
+#endif
            }
 
            break;
@@ -1321,7 +1325,11 @@ int v3_apic_raise_intr(struct v3_vm_info * vm, uint32_t irq, uint32_t dst, void
     activate_apic_irq(apic, irq);
 
     if (V3_Get_CPU() != dst) {
+#ifdef CONFIG_MULTITHREAD_OS
        v3_interrupt_cpu(vm, dst, 0);
+#else
+       V3_ASSERT(0);
+#endif
     }
 
     return 0;
index 9fc99fd..a7e83cc 100644 (file)
@@ -240,12 +240,18 @@ static int start_core(void * p)
 
 
 // For the moment very ugly. Eventually we will shift the cpu_mask to an arbitrary sized type...
+#ifdef CONFIG_MULTITHREAD_OS
 #define MAX_CORES 32
+#else
+#define MAX_CORES 1
+#endif
 
 
 int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
     uint32_t i;
+#ifdef CONFIG_MULTITHREAD_OS
     int vcore_id = 0;
+#endif
     uint8_t * core_mask = (uint8_t *)&cpu_mask; // This is to make future expansion easier
     uint32_t avail_cores = 0;
 
@@ -273,6 +279,7 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
     }
 
 
+#ifdef CONFIG_MULTITHREAD_OS
     // spawn off new threads, for other cores
     for (i = 0, vcore_id = 1; (i < MAX_CORES) && (vcore_id < vm->num_cores); i++) {
        int major = i / 8;
@@ -309,6 +316,7 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
 
        vcore_id++;
     }
+#endif
 
     sprintf(vm->cores[0].exec_name, "%s", vm->name);