X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fmm.c;h=c23cb2fc5e701b5be44f021e7fbed43a221b1692;hb=7e99758f3884f8f3d3f8895d9e4461f456331483;hp=a62b55a6df151897828d5b49faadf8e228a237a7;hpb=276cfa264720edddc1677e35c6a300596965de7d;p=palacios.git diff --git a/linux_module/mm.c b/linux_module/mm.c index a62b55a..c23cb2f 100644 --- a/linux_module/mm.c +++ b/linux_module/mm.c @@ -65,7 +65,7 @@ static uintptr_t alloc_contig_pgs(u64 num_pages, u32 alignment) { start = ((alignment - (pool.base_addr % alignment)) >> 12); } - printk("\t Start idx %d (base_addr=%llu)\n", start, (u64)pool.base_addr); + printk("\t Start idx %d (base_addr=%p)\n", start, (void *)(u64)pool.base_addr); for (i = start; i < (pool.num_pages - num_pages); i += step) { if (get_page_bit(i) == 0) { @@ -91,6 +91,8 @@ static uintptr_t alloc_contig_pgs(u64 num_pages, u32 alignment) { } } + /* printk("PALACIOS BAD: LARGE PAGE ALLOCATION FAILED\n"); */ + return 0; } @@ -103,29 +105,31 @@ uintptr_t alloc_palacios_pgs(u64 num_pages, u32 alignment) { struct page * pgs = NULL; int order = get_order(num_pages * PAGE_SIZE); - pgs = alloc_pages(GFP_DMA, order); + pgs = alloc_pages(GFP_DMA32, order); WARN(!pgs, "Could not allocate pages\n"); + + /* if (!pgs) { printk("PALACIOS BAD: SMALL PAGE ALLOCATION FAILED\n"); A */} - printk("%llu pages (order=%d) aquired from alloc_pages\n", - num_pages, order); + /* printk("%llu pages (order=%d) aquired from alloc_pages\n", + num_pages, order); */ addr = page_to_pfn(pgs) << PAGE_SHIFT; } else { - printk("Allocating %llu pages from bitmap allocator\n", num_pages); + //printk("Allocating %llu pages from bitmap allocator\n", num_pages); //addr = pool.base_addr; addr = alloc_contig_pgs(num_pages, alignment); } - printk("Returning from alloc addr=%p, vaddr=%p\n", (void *)addr, __va(addr)); + //printk("Returning from alloc addr=%p, vaddr=%p\n", (void *)addr, __va(addr)); return addr; } void free_palacios_pgs(uintptr_t pg_addr, int num_pages) { - printk("Freeing Memory page %p\n", (void *)pg_addr); + //printk("Freeing Memory page %p\n", (void *)pg_addr); if ((pg_addr >= pool.base_addr) && (pg_addr < pool.base_addr + (4096 * pool.num_pages))) {