* a single call while palacios_free_page() only frees a single page.
*/
-void palacios_free_pages(void * page_paddr, int num_pages) {
+void palacios_free_pages(void * page_paddr, int num_pages)
+{
+ //INFO("freepages: %p (%llu pages) alignment=%u\n", page_paddr, num_pages);
+
if (!page_paddr) {
ERROR("Ignoring free pages: 0x%p (0x%lx)for %d pages\n", page_paddr, (uintptr_t)page_paddr, num_pages);
return;
}
+
free(page_paddr);
- INFO("freepages: %p (%llu pages) alignment=%u\n", page_paddr, num_pages);
}
{
void * addr = NULL;
+
if (size==0) {
ERROR("ALERT ALERT attempt to vmalloc zero bytes rejected\n");
return NULL;
void palacios_vfree(void *p)
{
+ //INFO("vfree: 0x%p\n",p);
+
if (!p) {
ERROR("Ignoring vfree: 0x%p\n",p);
return;
}
- // no vfree currently
+
free(p);
- //INFO("vfree: 0x%p\n",p);
}
/**
void
palacios_free(void *addr)
{
- return;
+ //INFO("free: %p\n",addr-ALLOC_PAD);
+
if (!addr) {
ERROR("Ignoring free : 0x%p\n", addr);
return;
}
- // no kfree
+
free(addr-ALLOC_PAD);
- //INFO("free: %p\n",addr-ALLOC_PAD);
}
/**
void * vaddr
)
{
- return vaddr; // our memory mapping is identity
-
+ // our memory mapping is identity
+ // this currently does not include Nautilus PA offsetting
+ // as in Multiverse, but we don't envision running a VM
+ // within an HRT either, so we should be fine
+ return vaddr;
}
/**
void * paddr
)
{
- return paddr; // our memory mapping is identity
+ return paddr; // our memory mapping is identity, see v->p comment
}
/**
*(cpu_mask + major) |= (0x1 << minor);
}
+ } else {
+ ERROR("Must initialize at least one CPU\n");
+ return -1;
}
nautilus_console_init();
#endif
+ palacios_free(cpu_mask);
+
return 0;
for (i=0;i<NR_VMS;i++) {
if (!vms[i].name[0]) {
strncpy(vms[i].name,name,MAX_VM_NAME);
+ vms[i].name[MAX_VM_NAME-1]=0;
selected_vm = &vms[i];
return;
}