VMX sort of worked.
[akaros.git] / kern / arch / x86 / vmx_mmu.c
index a85082e..e131b86 100644 (file)
@@ -762,11 +762,15 @@ static int alloc_mmu_pages(struct litevm_vcpu *vcpu)
                struct page *page;
                struct litevm_mmu_page *page_header = &vcpu->page_header_buf[i];
 
-               if ((page = kpage_alloc_addr()) == NULL)
+               if (kpage_alloc(&page) != ESUCCESS)
                        goto error_1;
+               printk("page_header %p, page %p\n", page_header, page);
                page->pg_private = page_header;
-               page_header->page_hpa = (hpa_t) page2ppn(page) << PAGE_SHIFT;
+               printk("page2ppn(page) is %lx\n", page2ppn(page));
+               page_header->page_hpa = (hpa_t) page2pa(page);
+               printk("page_hpa is %lx\n", page_header->page_hpa);
                memset(KADDR(page_header->page_hpa), 0, PAGE_SIZE);
+               printk("INSERT\n");
                LIST_INSERT_HEAD(&vcpu->link, page_header, link);
        }
        print_func_exit();