From: Jack Lange Date: Thu, 4 Feb 2010 01:10:15 +0000 (-0600) Subject: symswap updates for multicore X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3c4d65e4b928a889bb352bf210612ba2aa9a03f;p=palacios.git symswap updates for multicore --- diff --git a/palacios/src/devices/sym_swap.c b/palacios/src/devices/sym_swap.c index ab1a589..ac0f0c9 100644 --- a/palacios/src/devices/sym_swap.c +++ b/palacios/src/devices/sym_swap.c @@ -70,7 +70,7 @@ struct swap_state { uint8_t * swap_space; addr_t swap_base_addr; - struct guest_info * vm; + struct v3_vm_info * vm; uint8_t usage_map[0]; // This must be the last structure member }; @@ -269,7 +269,7 @@ static void telemetry_cb(struct guest_info * info, void * private_data, char * h -static int swap_init(struct guest_info * vm, v3_cfg_tree_t * cfg) { +static int swap_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { struct swap_state * swap = NULL; v3_cfg_tree_t * frontend_cfg = v3_cfg_subtree(cfg, "frontend"); uint32_t capacity = atoi(v3_cfg_val(cfg, "size")) * 1024 * 1024; diff --git a/palacios/src/devices/sym_swap2.c b/palacios/src/devices/sym_swap2.c index f67ca85..bb2fd3d 100644 --- a/palacios/src/devices/sym_swap2.c +++ b/palacios/src/devices/sym_swap2.c @@ -65,7 +65,7 @@ struct swap_state { int active; int disabled; - struct guest_info * vm; + struct v3_vm_info * vm; struct swap_state * swap_info; int symbiotic; @@ -519,7 +519,7 @@ static void telemetry_cb(struct guest_info * info, void * private_data, char * h #endif -static int connect_fn(struct guest_info * info, +static int connect_fn(struct v3_vm_info * vm, void * frontend_data, struct v3_dev_blk_ops * ops, v3_cfg_tree_t * cfg, @@ -540,7 +540,7 @@ static int connect_fn(struct guest_info * info, swap = (struct swap_state *)V3_Malloc(sizeof(struct swap_state)); - swap->vm = info; + swap->vm = vm; swap->cache_size = cache_size; swap->io_flag = 0; swap->seek_usecs = seek_us; @@ -575,7 +575,7 @@ static int connect_fn(struct guest_info * info, memset(swap->cache, 0, swap->cache_size); } - if (v3_dev_connect_blk(info, v3_cfg_val(frontend_cfg, "tag"), + if (v3_dev_connect_blk(vm, v3_cfg_val(frontend_cfg, "tag"), &blk_ops, frontend_cfg, swap) == -1) { PrintError("Could not connect to frontend %s\n", v3_cfg_val(frontend_cfg, "tag")); @@ -585,8 +585,8 @@ static int connect_fn(struct guest_info * info, #ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY - if (info->enable_telemetry == 1) { - v3_add_telemetry_cb(info, telemetry_cb, swap); + if (vm->enable_telemetry == 1) { + v3_add_telemetry_cb(vm, telemetry_cb, swap); } #endif @@ -597,7 +597,7 @@ static int connect_fn(struct guest_info * info, -static int swap_init(struct guest_info * vm, v3_cfg_tree_t * cfg) { +static int swap_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { char * name = v3_cfg_val(cfg, "name"); diff --git a/palacios/src/palacios/vmm_sym_swap.c b/palacios/src/palacios/vmm_sym_swap.c index 80f6162..3cbc5c3 100644 --- a/palacios/src/palacios/vmm_sym_swap.c +++ b/palacios/src/palacios/vmm_sym_swap.c @@ -239,7 +239,9 @@ addr_t v3_map_swp_page(struct v3_vm_info * vm, pte32_t * shadow_pte, pte32_t * g if (shdw_ptr_list == NULL) { shdw_ptr_list = (struct list_head *)V3_Malloc(sizeof(struct list_head *)); +#ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY swap_state->list_size++; +#endif INIT_LIST_HEAD(shdw_ptr_list); v3_htable_insert(swap_state->shdw_ptr_ht, (addr_t)*(uint32_t *)guest_pte, (addr_t)shdw_ptr_list); } @@ -248,7 +250,9 @@ addr_t v3_map_swp_page(struct v3_vm_info * vm, pte32_t * shadow_pte, pte32_t * g if (shdw_ptr == NULL) { PrintError("MEMORY LEAK\n"); +#ifdef CONFIG_SYMBIOTIC_SWAP_TELEMETRY telemetry_cb(info, NULL, ""); +#endif return 0; }