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.


added support for memory remapping
[palacios.git] / palacios / src / palacios / vmm_direct_paging.c
index 2e86dbe..1f2c6e6 100644 (file)
@@ -137,6 +137,46 @@ int v3_handle_nested_pagefault(struct guest_info * info, addr_t fault_addr, pf_e
 }
 
 int v3_invalidate_passthrough_addr(struct guest_info * info, addr_t inv_addr) {
+    v3_vm_cpu_mode_t mode = v3_get_cpu_mode(info);
+
+    switch(mode) {
+       case REAL:
+       case PROTECTED:
+           return invalidate_addr_32(info, inv_addr);
+
+       case PROTECTED_PAE:
+       case LONG:
+       case LONG_32_COMPAT:
+           // Long mode will only use 32PAE page tables...
+           return invalidate_addr_32pae(info, inv_addr);
+
+       default:
+           PrintError("Unknown CPU Mode\n");
+           break;
+    }
+    return -1;
+}
+
+
+int v3_invalidate_nested_addr(struct guest_info * info, addr_t inv_addr) {
+    v3_vm_cpu_mode_t mode = LONG;
+
+    switch(mode) {
+       case REAL:
+       case PROTECTED:
+           return invalidate_addr_32(info, inv_addr);
+
+       case PROTECTED_PAE:
+           return invalidate_addr_32pae(info, inv_addr);
+
+       case LONG:
+       case LONG_32_COMPAT:
+           return invalidate_addr_64(info, inv_addr);      
+       
+       default:
+           PrintError("Unknown CPU Mode\n");
+           break;
+    }
 
     return -1;
 }