X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_mem.c;h=1b9f16d4a448c09cfc6892d0a4a0cad29b1f8fd7;hb=ddd9b6c1a6d0051ba8eae32d25492145c8ca5995;hp=752ae2b9e9d484685bae128f73ab5fc6ae9e5e4a;hpb=bf0d677f3d92f5949c3a73dad30aaf330201da44;p=palacios.git diff --git a/palacios/src/palacios/vmm_mem.c b/palacios/src/palacios/vmm_mem.c index 752ae2b..1b9f16d 100644 --- a/palacios/src/palacios/vmm_mem.c +++ b/palacios/src/palacios/vmm_mem.c @@ -1,3 +1,22 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2008, Jack Lange + * Copyright (c) 2008, The V3VEE Project + * All rights reserved. + * + * Author: Jack Lange + * + * This is free software. You are permitted to use, + * redistribute, and modify it as specified in the file "V3VEE_LICENSE". + */ + #include #include #include @@ -62,7 +81,7 @@ struct vmm_mem_hook * get_mem_hook(struct guest_info * info, addr_t guest_addr) struct shadow_region * region = get_shadow_region_by_addr(&(info->mem_map), guest_addr); if (region == NULL) { - PrintDebug("Could not find shadow region for addr: %x\n", guest_addr); + PrintDebug("Could not find shadow region for addr: %p\n", (void *)guest_addr); return NULL; } @@ -103,6 +122,8 @@ int handle_special_page_fault(struct guest_info * info, { struct shadow_region * reg = get_shadow_region_by_addr(&(info->mem_map), fault_gpa); + PrintDebug("Handling Special Page Fault\n"); + switch (reg->host_type) { case HOST_REGION_HOOK: return mem_hook_dispatch(info, fault_gva, fault_gpa, access_info, (struct vmm_mem_hook *)(reg->host_addr)); @@ -146,7 +167,8 @@ int add_shadow_region(struct shadow_map * map, { struct shadow_region * cursor = map->head; - PrintDebug("Adding Shadow Region: (0x%x-0x%x)\n", region->guest_start, region->guest_end); + PrintDebug("Adding Shadow Region: (0x%p-0x%p)\n", + (void *)region->guest_start, (void *)region->guest_end); if ((!cursor) || (cursor->guest_start >= region->guest_end)) { region->prev = NULL; @@ -287,7 +309,8 @@ void print_shadow_map(struct shadow_map * map) { PrintDebug("Memory Layout (regions: %d) \n", map->num_regions); while (cur) { - PrintDebug("%d: 0x%x - 0x%x (%s) -> ", i, cur->guest_start, cur->guest_end - 1, + PrintDebug("%d: 0x%p - 0x%p (%s) -> ", i, + (void *)cur->guest_start, (void *)(cur->guest_end - 1), cur->guest_type == GUEST_REGION_PHYSICAL_MEMORY ? "GUEST_REGION_PHYSICAL_MEMORY" : cur->guest_type == GUEST_REGION_NOTHING ? "GUEST_REGION_NOTHING" : cur->guest_type == GUEST_REGION_MEMORY_MAPPED_DEVICE ? "GUEST_REGION_MEMORY_MAPPED_DEVICE" : @@ -295,7 +318,7 @@ void print_shadow_map(struct shadow_map * map) { if (cur->host_type == HOST_REGION_PHYSICAL_MEMORY || cur->host_type == HOST_REGION_UNALLOCATED || cur->host_type == HOST_REGION_MEMORY_MAPPED_DEVICE) { - PrintDebug("0x%x", cur->host_addr); + PrintDebug("0x%p", (void *)(cur->host_addr)); } PrintDebug("(%s)\n", cur->host_type == HOST_REGION_PHYSICAL_MEMORY ? "HOST_REGION_PHYSICAL_MEMORY" :