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.


Lots of pedantic error checking in Palacios proper, especially for memory
[palacios.git] / palacios / src / palacios / mmu / vmm_shdw_pg_tlb.c
index 60b2d21..06e416a 100644 (file)
@@ -82,8 +82,19 @@ static struct shadow_page_data * create_new_shadow_pt(struct guest_info * core)
     // else  
 
     page_tail = (struct shadow_page_data *)V3_Malloc(sizeof(struct shadow_page_data));
+
+    if (!page_tail) {
+       PrintError("Cannot allocate\n");
+       return NULL;
+    }
+
     page_tail->page_pa = (addr_t)V3_AllocPages(1);
 
+    if (!page_tail->page_pa) {
+       PrintError("Cannot allocate page\n");
+       return NULL;
+    }
+
     PrintDebug("Allocating new shadow Page: %p (cur_cr3=%p)\n", 
               (void *)(addr_t)page_tail->page_pa, 
               (void *)(addr_t)cur_cr3);
@@ -117,6 +128,11 @@ static int vtlb_local_init(struct guest_info * core) {
 
     vtlb_state = (struct vtlb_local_state *)V3_Malloc(sizeof(struct vtlb_local_state));
 
+    if (!vtlb_state) {
+       PrintError("Cannot allocate\n");
+       return -1;
+    }
+
     INIT_LIST_HEAD(&(vtlb_state->page_list));
 
     state->local_impl_data = vtlb_state;