X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm.c;h=9337cdd6b1d41296d797abcb45d1badaeca72cf9;hb=e94507c7055f81abcf6a95132cb7ad90f1b5e6ca;hp=b49b75e9c48d8aa67abafd0aaaac11991c2a0364;hpb=c17cafcb6db943bd5bbb31d86f0392c113b2d668;p=palacios.git diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index b49b75e..9337cdd 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -107,9 +107,14 @@ void Init_V3(struct v3_os_hooks * hooks, char * cpu_mask, int num_cpus, char *op V3_Print(VM_NONE, VCORE_NONE, "V3 Print statement to fix a Kitten page fault bug\n"); + // Set global variables. os_hooks = hooks; + if (num_cpus>V3_CONFIG_MAX_CPUS) { + PrintError(VM_NONE,VCORE_NONE, "Requesting as many as %d cpus, but Palacios is compiled for a maximum of %d. Only the first %d cpus will be considered\n", num_cpus, V3_CONFIG_MAX_CPUS, V3_CONFIG_MAX_CPUS); + } + // Determine the global machine type v3_mach_type = V3_INVALID_CPU; @@ -155,7 +160,7 @@ void Init_V3(struct v3_os_hooks * hooks, char * cpu_mask, int num_cpus, char *op if ((hooks) && (hooks->call_on_cpu)) { - for (i = 0; i < num_cpus; i++) { + for (i = 0; i < num_cpus && i < V3_CONFIG_MAX_CPUS; i++) { major = i / 8; minor = i % 8; @@ -176,19 +181,9 @@ void Init_V3(struct v3_os_hooks * hooks, char * cpu_mask, int num_cpus, char *op void Shutdown_V3() { int i; - V3_deinit_devices(); - V3_deinit_shdw_paging(); - - V3_deinit_extensions(); - -#ifdef V3_CONFIG_SYMMOD - V3_deinit_symmod(); -#endif - -#ifdef V3_CONFIG_CHECKPOINT - V3_deinit_checkpoint(); -#endif + // Reverse order of Init_V3 + // bring down CPUs if ((os_hooks) && (os_hooks->call_on_cpu)) { for (i = 0; i < V3_CONFIG_MAX_CPUS; i++) { @@ -199,7 +194,32 @@ void Shutdown_V3() { } } +#ifdef V3_CONFIG_CHECKPOINT + V3_deinit_checkpoint(); +#endif + +#ifdef V3_CONFIG_SYMMOD + V3_deinit_symmod(); +#endif + + V3_disable_scheduler(); + + V3_disable_cpu_mapper(); + + V3_deinit_extensions(); + + V3_deinit_scheduling(); + + V3_deinit_cpu_mapper(); + + V3_deinit_shdw_paging(); + + V3_deinit_devices(); + v3_deinit_mem(); + + v3_deinit_options(); + }