X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_mem.c;fp=palacios%2Fsrc%2Fpalacios%2Fvmm_mem.c;h=dc3f1ae87b864f95aa735f3979d851300ab316eb;hp=659fd279b8471d60ef3c5750c64d47b2bc7ccf9a;hb=70d3ac1e7be22e42fbf8f778367e9bf6d32e5b7f;hpb=e3a2ad0c26462c45cf0a7f1ccc8f0042abbbd776 diff --git a/palacios/src/palacios/vmm_mem.c b/palacios/src/palacios/vmm_mem.c index 659fd27..dc3f1ae 100644 --- a/palacios/src/palacios/vmm_mem.c +++ b/palacios/src/palacios/vmm_mem.c @@ -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