From: Peter Dinda Date: Fri, 4 Oct 2013 18:22:49 +0000 (-0500) Subject: Clean up hashtable frees to fix rmmod crash on redhat X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=c10469f54e93ee7a21692f7a19b680610dc57e28 Clean up hashtable frees to fix rmmod crash on redhat --- diff --git a/linux_module/buddy.c b/linux_module/buddy.c index 37f3fec..a68d786 100644 --- a/linux_module/buddy.c +++ b/linux_module/buddy.c @@ -422,8 +422,8 @@ buddy_free( pool = find_mempool(zone, addr); if ((pool == NULL) || (order > pool->pool_order)) { - WARNING("Attempted to free an invalid page address (%p)\n", (void *)addr); - palacios_spinlock_unlock_irqrestore(&(zone->lock), flags); + WARNING("Attempted to free an invalid page address (%p) - pool=%p order=%lu\n", (void *)addr,pool,order); + palacios_spinlock_unlock_irqrestore(&(zone->lock), flags); return; } diff --git a/palacios/src/palacios/vmm_cpu_mapper.c b/palacios/src/palacios/vmm_cpu_mapper.c index e2e34bc..626f50f 100644 --- a/palacios/src/palacios/vmm_cpu_mapper.c +++ b/palacios/src/palacios/vmm_cpu_mapper.c @@ -60,7 +60,10 @@ int V3_init_cpu_mapper() { int V3_deinit_cpu_mapper() { destroy_default_cpu_mapper(); - v3_free_htable(master_cpu_mapper_table, 1, 1); + // we must leave the keys and values unfreed + // since we have no idea whether they are heap or otherwise + // the user must have done appropriate unregisters before this + v3_free_htable(master_cpu_mapper_table, 0, 0); return 0; } @@ -250,5 +253,6 @@ static int create_default_cpu_mapper() static int destroy_default_cpu_mapper() { v3_unregister_cpu_mapper(default_mapper_impl.name); + // note - is not deleted since it's a global... return 0; } diff --git a/palacios/src/palacios/vmm_scheduler.c b/palacios/src/palacios/vmm_scheduler.c index c214d63..07600bf 100644 --- a/palacios/src/palacios/vmm_scheduler.c +++ b/palacios/src/palacios/vmm_scheduler.c @@ -59,7 +59,9 @@ int V3_init_scheduling() { int V3_deinit_scheduling() { destroy_host_scheduler(); - v3_free_htable(master_scheduler_table,1,1); + // important not to remove any keys or values since we don't know + // if they are malloced or other + v3_free_htable(master_scheduler_table,0,0); return 0; } @@ -331,5 +333,6 @@ static int create_host_scheduler() static int destroy_host_scheduler() { v3_unregister_scheduler(host_sched_impl.name); + // no deletion of this since it's a pointer to a global var return 0; } diff --git a/v3_config_guest.pl b/v3_config_guest.pl index a925cc7..dd781e2 100755 --- a/v3_config_guest.pl +++ b/v3_config_guest.pl @@ -11,10 +11,10 @@ there may be hidden Linux assumptions. The tool assumes you have already built Palacios, the Linux embedding, and the Linux user-sapce tools. If you haven't done this, hit CTRL-C now, configure and build Palacios, the user-space tools, and run -v3_config.pl. +v3_config_v3vee.pl. This tool also assumes that you have the environment produced by -v3_config.pl sourced: +v3_config_v3vee.pl sourced: source ./ENV