PrintError(vm, VCORE_NONE, "Trying to map a partial overlapped core specific page...\n");
return tmp_region; // This is ugly...
} else if (region->core_id == tmp_region->core_id) {
+ PrintError(vm, VCORE_NONE, "Trying to map a core-overlapping page\n");
return tmp_region;
} else if (region->core_id < tmp_region->core_id) {
p = &(*p)->rb_left;
int i = 0;
if ((ret = __insert_mem_region(vm, region))) {
+ PrintError(vm, VCORE_NONE, "Internal insert failed returned region is from 0x%p to 0x%p on vcore %d\n", (void*)(ret->guest_start), (void*)(ret->guest_end), ret->core_id);
return -1;
}
entry = v3_create_mem_region(vm, core_id, guest_addr_start, guest_addr_end);
+ if (!entry) {
+ PrintError(vm, VCORE_NONE, "Cannot allocate a memory region\n");
+ V3_Free(hook);
+ return -1;
+ }
+
hook->region = entry;
entry->host_addr = host_addr;
entry->flags.alloced = 1;
if (v3_insert_mem_region(vm, entry) == -1) {
+ PrintError(vm, VCORE_NONE, "Cannot insert memory region\n");
V3_Free(entry);
V3_Free(hook);
return -1;