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 memory unhooking function
Jack Lange [Thu, 23 Apr 2009 00:59:17 +0000 (19:59 -0500)]
palacios/include/palacios/vmm_mem.h
palacios/src/devices/pci.c
palacios/src/palacios/vmm_mem.c

index f87c8d0..927577e 100644 (file)
@@ -99,12 +99,14 @@ int v3_hook_write_mem(struct guest_info * info, addr_t guest_addr_start, addr_t
 
 
 
-
+int v3_unhook_mem(struct guest_info * info, addr_t guest_addr_start);
 
 
 void v3_delete_shadow_region(struct guest_info * info, struct v3_shadow_region * reg);
 
 
+
+
 struct v3_shadow_region * v3_get_shadow_region(struct guest_info * info, addr_t guest_addr);
 addr_t v3_get_shadow_addr(struct v3_shadow_region * reg, addr_t guest_addr);
 
index 6b5472d..602f47c 100644 (file)
@@ -566,7 +566,7 @@ static void init_pci_busses(struct pci_internal * pci_state) {
 
 
 static int pci_init_device(struct vm_device * dev) {
-    struct pci_internal * pci_state = (struct pci_internal *)dev->private_data;;
+    struct pci_internal * pci_state = (struct pci_internal *)dev->private_data;
     int i = 0;
     
     PrintDebug("pci: init_device\n");
index 659fd27..dc3f1ae 100644 (file)
@@ -150,6 +150,20 @@ int v3_hook_full_mem(struct guest_info * info, addr_t guest_addr_start, addr_t g
 }
 
 
+// This will unhook the memory hook registered at start address
+// We do not support unhooking subregions
+int v3_unhook_mem(struct guest_info * info, addr_t guest_addr_start) {
+    struct v3_shadow_region * reg = v3_get_shadow_region(info, guest_addr_start);
+
+    if ((reg->host_type != SHDW_REGION_FULL_HOOK) || 
+       (reg->host_type != SHDW_REGION_WRITE_HOOK)) {
+       PrintError("Trying to unhook a non hooked memory region (addr=%p)\n", (void *)guest_addr_start);
+       return -1;
+    }
+
+    return v3_delete_shadow_region(info, reg);
+}
+
 
 
 static inline