}
+// 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;
+ }
+
+ v3_delete_shadow_region(info, reg);
+
+ return 0;
+}
+
static inline
// flush virtual page tables
// 3 cases shadow, shadow passthrough, and nested
if (info->shdw_pg_mode == SHADOW_PAGING) {
- v3_vm_mem_mode_t mem_mode = v3_get_mem_mode(info);
+ v3_mem_mode_t mem_mode = v3_get_mem_mode(info);
if (mem_mode == PHYSICAL_MEM) {
addr_t cur_addr;
// flush virtual page tables
// 3 cases shadow, shadow passthrough, and nested
if (info->shdw_pg_mode == SHADOW_PAGING) {
- v3_vm_mem_mode_t mem_mode = v3_get_mem_mode(info);
+ v3_mem_mode_t mem_mode = v3_get_mem_mode(info);
if (mem_mode == PHYSICAL_MEM) {
addr_t cur_addr;