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.


first cut at nested paging
[palacios.git] / palacios / src / palacios / svm_handler.c
index aaed6c6..931bb99 100644 (file)
@@ -32,7 +32,7 @@
 #include <palacios/svm_msr.h>
 #include <palacios/vmm_profiler.h>
 #include <palacios/vmm_hypercall.h>
-
+#include <palacios/vmm_direct_paging.h>
 
 
 
@@ -247,12 +247,20 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }
            break;
        } 
-       case VMEXIT_NPF: 
+       case VMEXIT_NPF: {
+           addr_t fault_addr = guest_ctrl->exit_info2;
+           pf_error_t * error_code = (pf_error_t *)&(guest_ctrl->exit_info1);
 
-           PrintError("Currently unhandled Nested Page Fault\n");
-           return -1;
-               
+           if (info->shdw_pg_mode == NESTED_PAGING) {
+               if (v3_handle_nested_pagefault(info, fault_addr, *error_code) == -1) {
+                   return -1;
+               }
+           } else {
+               PrintError("Currently unhandled Nested Page Fault\n");
+               return -1;
+                   }
            break;
+           }
        case VMEXIT_INVLPG: 
            if (info->shdw_pg_mode == SHADOW_PAGING) {
 #ifdef DEBUG_SHADOW_PAGING