X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fsvm.c;h=4ba49b2176bc1b44e0a399f26edf2204744f0f96;hb=190b2ef9470c23c275754b74745933d973f8c439;hp=9f30c4934d6b20729a4d1a4fc1111eb8f9f072bc;hpb=701de97007c8b6776998eeab78469a4304f6b871;p=palacios.git diff --git a/palacios/src/geekos/svm.c b/palacios/src/geekos/svm.c index 9f30c49..4ba49b2 100644 --- a/palacios/src/geekos/svm.c +++ b/palacios/src/geekos/svm.c @@ -2,6 +2,9 @@ #include #include +#include +#include + extern struct vmm_os_hooks * os_hooks; @@ -57,7 +60,7 @@ void Init_SVM(struct vmm_ctrl_ops * vmm_ops) { // 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; @@ -78,12 +81,25 @@ void Init_SVM(struct vmm_ctrl_ops * vmm_ops) { 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; } @@ -124,7 +140,7 @@ int handle_svm_exit(struct VMM_GPRs guest_gprs) { 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); @@ -181,3 +197,5 @@ void Init_VMCB(vmcb_t *vmcb, guest_info_t vm_info) { /* ** */ } + +