Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


*** empty log message ***
[palacios.git] / palacios / src / geekos / vmx.c
index 8aa8b2f..2278da9 100644 (file)
@@ -1,8 +1,5 @@
 /* Eventually  we want to get rid of these */
-#include <geekos/mem.h>
-#include <geekos/segment.h>
-#include <geekos/gdt.h>
-#include <geekos/idt.h>
+
 #include <geekos/cpu.h>
 #include <geekos/io_devs.h>
 /* ** */
@@ -30,6 +27,8 @@ extern int Launch_VM(ullong_t vmcsPtr, uint_t eip);
 #define ROMBIOS_DEBUG_PORT    0x403
 
 
+extern struct vmm_os_hooks * os_hooks;
+
 
 static struct VM theVM;
 
@@ -884,7 +883,7 @@ int VMLaunch(struct VMDescriptor *vm)
 
 VmxOnRegion * CreateVmxOnRegion() {
   union VMX_MSR basicMSR;
-  VmxOnRegion * region = (VmxOnRegion *)Alloc_Page();
+  VmxOnRegion * region = (VmxOnRegion *)(os_hooks)->allocate_pages(1);
 
   Get_MSR(IA32_VMX_BASIC_MSR, &basicMSR.regs.high, &basicMSR.regs.low);
   //  memcpy(region, &basicMSR.vmxBasic.revision, sizeof(uint_t));
@@ -898,7 +897,7 @@ VmxOnRegion * CreateVmxOnRegion() {
 
 VMCS * CreateVMCS() {
   union VMX_MSR basicMSR;
-  VMCS * vmcs = (VMCS *)Alloc_Page();
+  VMCS * vmcs = (VMCS *)(os_hooks)->allocate_pages(1);
 
   Get_MSR(IA32_VMX_BASIC_MSR, &basicMSR.regs.high, &basicMSR.regs.low);
   *(ulong_t *)vmcs = basicMSR.vmxBasic.revision;