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://palacios@newskysaw.cs.northwestern.edu//home/palacios...
Peter Dinda [Tue, 5 Oct 2010 22:14:04 +0000 (17:14 -0500)]
Conflicts:

palacios/include/palacios/vm_guest.h
palacios/src/devices/apic.c
palacios/src/devices/io_apic.c
palacios/src/palacios/vmm_config.c
palacios/src/palacios/vmm_direct_paging_64.h
palacios/src/palacios/vmm_mem.c
utils/guest_creator/default.xml

1  2 
palacios/include/palacios/vm_guest.h
palacios/src/devices/apic.c
palacios/src/devices/icc_bus.c
palacios/src/devices/io_apic.c
palacios/src/palacios/vmm_config.c
palacios/src/palacios/vmm_mem.c

@@@ -116,11 -126,10 +126,12 @@@ struct guest_info 
  struct v3_vm_info {
      v3_vm_class_t vm_class;
  
-     addr_t mem_size; // In bytes for now
+     addr_t mem_size; /* In bytes for now */
+     uint32_t mem_align;
      struct v3_mem_map mem_map;
  
 +    v3_paging_size_t paging_size; // for nested paging
 +
      struct v3_mem_hooks mem_hooks;
  
      struct v3_shdw_impl_state shdw_impl;
@@@ -889,13 -895,15 +899,16 @@@ static int apic_write(struct guest_inf
  
        case INT_CMD_LO_OFFSET:
            apic->int_cmd.lo = op_val;
            // ICC???
-           PrintDebug("apic %u: core %u: sending cmd 0x%llx to apic %u\n",apic->lapic_id.val,core->cpu_id,
+           PrintDebug("apic %u: core %u: sending cmd 0x%llx to apic %u\n", 
+                      apic->clapic_id.val, core->cpu_id,
                       apic->int_cmd.val, apic->int_cmd.dst);
 -
 -          v3_icc_send_ipi(apic->icc_bus, apic->lapic_id.val, apic->int_cmd.val, 0);
 +          if (v3_icc_send_ipi(apic->icc_bus, apic->lapic_id.val, apic->int_cmd.val,apic->dst_fmt.val,0)==-1) { 
 +              return -1;
 +          }
            break;
        case INT_CMD_HI_OFFSET:
            apic->int_cmd.hi = op_val;
            break;
Simple merge
@@@ -290,10 -291,9 +291,12 @@@ static int ioapic_raise_irq(struct v3_v
        icr.rem_rd_status=0;
        icr.dst_shorthand=0; // no shorthand
        icr.rsvd2=0;
 +
 +      // Note: 0 yhere is "cluster model", but it should be irrelevant
 +      // since we are sending this as a physical destination
-       v3_icc_send_ipi(ioapic->icc_bus, ioapic->ioapic_id.val,icr.val, 0, irq);
+       PrintDebug("io apic %u: raising irq %u on ICC bus.\n",
+                  ioapic->ioapic_id.id, irq);
 -      v3_icc_send_ipi(ioapic->icc_bus, ioapic->ioapic_id.id,icr.val, irq);
++      v3_icc_send_ipi(ioapic->icc_bus, ioapic->ioapic_id.id,icr.val, 0, irq);
      }
  
      return 0;
@@@ -270,17 -301,9 +301,18 @@@ static int determine_paging_mode(struc
        info->shdw_pg_mode = SHADOW_PAGING;
      }
  
      if (info->shdw_pg_mode == NESTED_PAGING) {
        PrintDebug("Guest Paging Mode: NESTED_PAGING\n");
 +      if (strcasecmp(page_size, "4kb") == 0) { /* TODO: this may not be an ideal place for this */
 +          info->vm_info->paging_size = PAGING_4KB;
 +      } else if (strcasecmp(page_size, "2mb") == 0) {
 +          info->vm_info->paging_size = PAGING_2MB;
 +      } else {
 +          PrintError("Invalid VM paging size: '%s'\n", page_size);
 +          return -1;
 +      }
 +      PrintDebug("VM page size=%s\n", page_size);
      } else if (info->shdw_pg_mode == SHADOW_PAGING) {
          PrintDebug("Guest Paging Mode: SHADOW_PAGING\n");
      } else {
@@@ -63,11 -61,14 +61,15 @@@ int v3_init_mem_map(struct v3_vm_info 
      // There is an underlying region that contains all of the guest memory
      // PrintDebug("Mapping %d pages of memory (%u bytes)\n", (int)mem_pages, (uint_t)info->mem_size);
  
 +    // 2MB page alignment needed for 2MB hardware nested paging
      map->base_region.guest_start = 0;
      map->base_region.guest_end = mem_pages * PAGE_SIZE_4KB;
-     map->base_region.host_addr = (addr_t)V3_AllocAlignedPages(mem_pages, PAGE_SIZE_2MB);
+ #ifdef CONFIG_ALIGNED_PG_ALLOC
+     map->base_region.host_addr = (addr_t)V3_AllocAlignedPages(mem_pages, vm->mem_align);
+ #else
+     map->base_region.host_addr = (addr_t)V3_AllocPages(mem_pages);
+ #endif
  
      map->base_region.flags.read = 1;
      map->base_region.flags.write = 1;