2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
28 #include <palacios/vmm_types.h>
30 #include <palacios/vmm_paging.h>
31 #include <palacios/vmm_rbtree.h>
32 #include <palacios/vmm_list.h>
39 #define V3_MEM_CORE_ANY ((uint16_t)-1)
47 // These reflect the VMM's intent for the shadow or nested pts
48 // that will implement the region. The guest's intent is in
49 // its own page tables.
55 } __attribute__((packed));
56 } __attribute__((packed));
57 } __attribute__((packed)) v3_mem_flags_t;
61 struct v3_mem_region {
67 addr_t host_addr; // This either points to a host address mapping
69 int (*unhandled)(struct guest_info * info, addr_t guest_va, addr_t guest_pa,
70 struct v3_mem_region * reg, pf_error_t access_info);
76 struct rb_node tree_node; // This for memory regions mapped to the global map
81 struct v3_mem_region base_region;
83 struct rb_root mem_regions;
87 int v3_init_mem_map(struct v3_vm_info * vm);
88 void v3_delete_mem_map(struct v3_vm_info * vm);
94 struct v3_mem_region * v3_create_mem_region(struct v3_vm_info * vm, uint16_t core_id,
95 addr_t guest_addr_start, addr_t guest_addr_end);
97 int v3_insert_mem_region(struct v3_vm_info * vm, struct v3_mem_region * reg);
99 void v3_delete_mem_region(struct v3_vm_info * vm, struct v3_mem_region * reg);
102 /* This is a shortcut function for creating + inserting a memory region which redirects to host memory */
103 int v3_add_shadow_mem(struct v3_vm_info * vm, uint16_t core_id,
104 addr_t guest_addr_start, addr_t guest_addr_end, addr_t host_addr);
108 struct v3_mem_region * v3_get_mem_region(struct v3_vm_info * vm, uint16_t core_id, addr_t guest_addr);
111 uint32_t v3_get_max_page_size(struct guest_info * core, addr_t fault_addr, v3_cpu_mode_t mode);
114 void v3_print_mem_map(struct v3_vm_info * vm);
118 #endif /* ! __V3VEE__ */