#include <geekos/vmm.h>
#include <geekos/vmcb.h>
+#include <geekos/vmm_mem.h>
+#include <geekos/vmm_paging.h>
+
extern struct vmm_os_hooks * os_hooks;
// Setup the host state save area
- host_state = os_hooks->Allocate_Pages(1);
+ host_state = os_hooks->allocate_pages(1);
msr.e_reg.high = 0;
msr.e_reg.low = (uint_t)host_state;
int init_svm_guest(struct guest_info *info) {
+ pde_t * pde;
+
PrintDebug("Allocating VMCB\n");
info->vmm_data = (void*)Allocate_VMCB();
+
+ PrintDebug("Generating Guest nested page tables\n");
+ print_mem_list(&(info->mem_list));
+ print_mem_layout(&(info->mem_layout));
+ pde = generate_guest_page_tables(&(info->mem_layout), &(info->mem_list));
+ PrintDebugPageTables(pde);
+
+
PrintDebug("Initializing VMCB (addr=%x)\n", info->vmm_data);
Init_VMCB((vmcb_t*)(info->vmm_data), *info);
+
+
+
return 0;
}
vmcb_t * Allocate_VMCB() {
- vmcb_t * vmcb_page = (vmcb_t*)os_hooks->Allocate_Pages(1);
+ vmcb_t * vmcb_page = (vmcb_t*)os_hooks->allocate_pages(1);
memset(vmcb_page, 0, 4096);
/* ** */
}
+
+