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.


added back in 32 bit support
Jack Lange [Tue, 26 Jan 2010 06:50:35 +0000 (00:50 -0600)]
palacios/include/palacios/vmm_lowlevel.h
palacios/src/devices/lnx_virtio_balloon.c
palacios/src/devices/lnx_virtio_sym.c
palacios/src/devices/sym_swap2.c
palacios/src/palacios/vm_guest.c
palacios/src/palacios/vmm_sym_iface.c

index 331a307..af1f820 100644 (file)
@@ -69,11 +69,24 @@ struct sys_segment64 {
 static void __inline__ v3_cpuid(uint32_t target, 
                                uint32_t * eax, uint32_t * ebx, 
                                uint32_t * ecx, uint32_t * edx) {
+#ifdef __V3_64BIT__
     __asm__ __volatile__ (
                          "cpuid\n\t"
                          : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
                          : "0" (target), "2" (*ecx)
                          );
+#elif __V3_32BIT__
+    // 32 bit code compiled with -fPIC, cannot use ebx as an ouput reg. Fantastic.
+    __asm__ __volatile__ (
+                         "pushl %%ebx\n\t"
+                         "movl %%edi, %%ebx\n\t"
+                         "cpuid\n\t"
+                         "movl %%ebx, %%edi\n\t"
+                         "popl %%ebx\n\t"
+                         : "=a" (*eax), "=D" (*ebx), "=c" (*ecx), "=d" (*edx)
+                         : "0" (target), "2" (*ecx)
+                         );
+#endif
     return;
 }
 
index 088cea4..3350e26 100644 (file)
@@ -142,8 +142,9 @@ static int handle_kick(struct vm_device * dev) {
            addr_t page_addr;
            tmp_desc = &(q->desc[desc_idx]);
            
-           PrintDebug("Header Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n", tmp_desc, 
-                      (void *)(tmp_desc->addr_gpa), tmp_desc->length, 
+           PrintDebug("Header Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n", 
+                      tmp_desc, 
+                      (void *)(addr_t)(tmp_desc->addr_gpa), tmp_desc->length, 
                       tmp_desc->flags, tmp_desc->next);
        
 
index 852709e..2cd3745 100644 (file)
@@ -115,8 +115,9 @@ static int handle_kick(struct vm_device * dev) {
            addr_t page_addr;
            tmp_desc = &(q->desc[desc_idx]);
            
-           PrintDebug("Header Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n", tmp_desc, 
-                      (void *)(tmp_desc->addr_gpa), tmp_desc->length, 
+           PrintDebug("Header Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n", 
+                      tmp_desc, 
+                      (void *)(addr_t)(tmp_desc->addr_gpa), tmp_desc->length, 
                       tmp_desc->flags, tmp_desc->next);
        
 
index 3946636..f67ca85 100644 (file)
@@ -571,7 +571,7 @@ static int connect_fn(struct guest_info * info,
        swap->active = 0;
 
        swap->cache_base_addr = (addr_t)V3_AllocPages(swap->cache_size / 4096);
-       swap->cache = (uint8_t *)V3_VAddr((void *)(swap->cache_base_addr));
+       swap->cache = (uint8_t *)V3_VAddr((void *)(addr_t)(swap->cache_base_addr));
        memset(swap->cache, 0, swap->cache_size);
     }
 
index de0cb21..c2bb07d 100644 (file)
@@ -310,7 +310,7 @@ void v3_print_stack(struct guest_info * info) {
     // We start i at one because the current stack pointer points to an unused stack element
     for (i = 0; i <= 24; i++) {
        if (cpu_mode == LONG) {
-           V3_Print("\t%p\n", (void *)*(uint64_t *)(host_addr + (i * 8)));
+           V3_Print("\t%p\n", (void *)*(addr_t *)(host_addr + (i * 8)));
        } else if (cpu_mode == REAL) {
            V3_Print("Don't currently handle 16 bit stacks... \n");
        } else {
index 8395955..fea864d 100644 (file)
@@ -84,14 +84,14 @@ static int msr_write(uint_t msr, struct v3_msr src, void * priv_data) {
     struct v3_sym_state * state = &(info->sym_state);
 
     if (msr == SYM_PAGE_MSR) {
-       PrintDebug("Symbiotic MSR write for page %p\n", (void *)src.value);
+       PrintDebug("Symbiotic MSR write for page %p\n", (void *)(addr_t)src.value);
 
        if (state->active == 1) {
            // unmap page
            struct v3_shadow_region * old_reg = v3_get_shadow_region(info, (addr_t)state->guest_pg_addr);
 
            if (old_reg == NULL) {
-               PrintError("Could not find previously active symbiotic page (%p)\n", (void *)state->guest_pg_addr);
+               PrintError("Could not find previously active symbiotic page (%p)\n", (void *)(addr_t)state->guest_pg_addr);
                return -1;
            }