Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added initial global shutdown functionality
Jack Lange [Thu, 20 Jan 2011 21:50:59 +0000 (15:50 -0600)]
palacios/include/palacios/vmm_dev_mgr.h
palacios/include/palacios/vmm_shadow_paging.h
palacios/src/palacios/vmm.c
palacios/src/palacios/vmm_config.c
palacios/src/palacios/vmm_dev_mgr.c
palacios/src/palacios/vmm_shadow_paging.c

index ea45784..f7f511b 100644 (file)
@@ -99,7 +99,7 @@ int v3_free_vm_devices(struct v3_vm_info * vm);
 
 
 int V3_init_devices();
-
+int V3_deinit_devices();
 
 
 struct v3_device_ops {
index 4c191df..b619a04 100644 (file)
@@ -99,6 +99,7 @@ int v3_is_guest_pf(pt_access_status_t guest_access, pt_access_status_t shadow_ac
 
 
 int V3_init_shdw_paging();
+int V3_deinit_shdw_paging();
 
 #define register_shdw_pg_impl(impl)                                    \
     static struct v3_shdw_pg_impl * _v3_shdw_pg_impl                   \
index 0e1b905..9fc99fd 100644 (file)
@@ -67,6 +67,29 @@ static void init_cpu(void * arg) {
     }
 }
 
+#if 0
+static void deinit_cpu(void * arg) {
+//    uint32_t cpu_id = (uint32_t)(addr_t)arg;
+
+ #ifdef CONFIG_SVM
+    if (v3_is_svm_capable()) {
+        PrintDebug("Machine is SVM Capable\n");
+        //v3_deinit_svm_cpu(cpu_id);
+
+    } else 
+#endif
+#ifdef CONFIG_VMX
+    if (v3_is_vmx_capable()) {
+       PrintDebug("Machine is VMX Capable\n");
+       //v3_deinit_vmx_cpu(cpu_id);
+
+    } else 
+#endif
+    {
+       PrintError("CPU has no virtualization Extensions\n");
+    }
+}
+#endif
 
 
 void Init_V3(struct v3_os_hooks * hooks, int num_cpus) {
@@ -118,8 +141,39 @@ void Init_V3(struct v3_os_hooks * hooks, int num_cpus) {
 }
 
 
-void Deinit_V3() {
-    
+void Shutdown_V3() {
+    //  int i;
+
+    V3_deinit_devices();
+    V3_deinit_shdw_paging();
+
+#if 0
+
+#ifdef CONFIG_SYMMOD
+    V3_deinit_symmod();
+#endif
+
+#ifdef CONFIG_INSTRUMENT_VMM
+    v3_deinit_instrumentation();
+#endif
+
+#ifdef CONFIG_VNET
+    v3_deinit_vnet();
+#endif
+
+#ifdef CONFIG_MULTITHREAD_OS
+    if ((hooks) && (hooks->call_on_cpu)) {
+       for (i = 0; i < CONFIG_MAX_CPUS; i++) {
+           if (v3_cpu_types[i] != V3_INVALID_CPU) {
+               deinit_cpu(i);
+           }
+       }
+    }
+#else 
+    deinit_cpu(0);
+#endif
+
+#endif
 
 }
 
index 572f01a..50e3b1c 100644 (file)
@@ -166,7 +166,6 @@ static struct v3_config * parse_config(void * cfg_blob) {
            return NULL;
        }
 
-
        V3_Print("File index=%d id=%s\n", idx, id);
 
        strncpy(file->tag, id, 256);
@@ -212,9 +211,9 @@ static inline uint32_t get_alignment(char * align_str) {
 
     return alignment;
 }
-static int pre_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * vm_cfg) {
 
 
+static int pre_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * vm_cfg) {
     char * memory_str = v3_cfg_val(vm_cfg, "memory");
     char * schedule_hz_str = v3_cfg_val(vm_cfg, "schedule_hz");
     char * vm_class = v3_cfg_val(vm_cfg, "class");
@@ -279,8 +278,8 @@ static int pre_config_vm(struct v3_vm_info * vm, v3_cfg_tree_t * vm_cfg) {
     return 0;
 }
 
-static int determine_paging_mode(struct guest_info *info, v3_cfg_tree_t * core_cfg)
-{
+
+static int determine_paging_mode(struct guest_info * info, v3_cfg_tree_t * core_cfg) {
     extern v3_cpu_arch_t v3_cpu_types[];
 
     v3_cfg_tree_t * vm_tree = info->vm_info->cfg_data->cfg;
index f578f02..f0554ea 100644 (file)
@@ -86,6 +86,12 @@ int V3_init_devices() {
 }
 
 
+int V3_deinit_devices() {    
+    v3_free_htable(master_dev_table, 0, 0);
+    return 0;
+}
+
+
 int v3_init_dev_mgr(struct v3_vm_info * vm) {
     struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
 
index 4f8804e..b46469c 100644 (file)
@@ -95,6 +95,11 @@ int V3_init_shdw_paging() {
     return 0;
 }
 
+int V3_deinit_shdw_paging() {
+    v3_free_htable(master_shdw_pg_table, 0, 0);
+    return 0;
+}
+
 
 
 /***