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.


Cleanup and sanity-checking of switch issues, negative array indexes, operand indepen...
Peter Dinda [Tue, 1 Sep 2015 20:21:34 +0000 (15:21 -0500)]
linux_module/iface-pwrstat.c
linux_module/iface-pwrstat.h
palacios/src/devices/generic.c
palacios/src/palacios/svm.c
palacios/src/palacios/vmm_paging.c
palacios/src/palacios/vmm_perftune.c

index a823946..98ea8c0 100644 (file)
@@ -109,7 +109,7 @@ static int rapl_check_unit (void)
        power_unit_divisor = 1 << value;
 
        /* time unit: 1/time_unit_divisor Seconds */
-       value =(output & TIME_UNIT_MASK) >> TIME_UNIT_OFFSET;
+       value = (output & TIME_UNIT_MASK) >> TIME_UNIT_OFFSET;
        time_unit_divisor = 1 << value;
 
        return 0;
index 6d64cc1..eb22df3 100644 (file)
@@ -41,6 +41,6 @@
 #define ENERGY_UNIT_MASK       0x1F00
 
 #define TIME_UNIT_OFFSET       0x10
-#define TIME_UNIT_MASK         0xF000
+#define TIME_UNIT_MASK         0xF0000
 
 #endif
index 23f00ce..1e06a80 100644 (file)
@@ -194,14 +194,19 @@ static int generic_read_port_print_and_passthrough(struct guest_info * core, uin
 
     rc=generic_read_port_passthrough(core,port,src,length,priv_data);
 
-    PrintDebug(core->vm_info, core, " done ... read 0x");
-
-    for (i = 0; i < rc; i++) { 
-       PrintDebug(core->vm_info, core, "%x", ((uint8_t *)src)[i]);
+    if (rc<0) { 
+       PrintError(core->vm_info, core, "FAILED\n");
+       return rc;
+    } else {
+       PrintDebug(core->vm_info, core, " done ... read 0x");
+       
+       for (i = 0; i < rc; i++) { 
+           PrintDebug(core->vm_info, core, "%x", ((uint8_t *)src)[i]);
+       }
+       
+       PrintDebug(core->vm_info, core, "\n");
     }
-
-    PrintDebug(core->vm_info, core, "\n");
-
+    
     return rc;
 }
 
index 6ecdb12..d78a1dc 100644 (file)
@@ -1239,7 +1239,7 @@ int v3_is_svm_capable() {
        
        PrintDebug(VM_NONE, VCORE_NONE, "SVM_VM_CR_MSR = 0x%x 0x%x\n", vm_cr_high, vm_cr_low);
        
-       if ((vm_cr_low & SVM_VM_CR_MSR_svmdis) == 1) {
+       if (vm_cr_low & SVM_VM_CR_MSR_svmdis) {
            V3_Print(VM_NONE, VCORE_NONE, "SVM is available but is disabled.\n");
            
            v3_cpuid(CPUID_SVM_REV_AND_FEATURE_IDS, &eax, &ebx, &ecx, &edx);
index 03a158a..6fc880f 100644 (file)
@@ -1043,6 +1043,7 @@ int v3_drill_guest_pt_32pae(struct guest_info * info, v3_reg_t guest_cr3, addr_t
        {
            case PT_ENTRY_NOT_PRESENT:
                return -1;
+               break; 
            case PT_ENTRY_PAGE:
                {
                    pde32pae_t * guest_pde = NULL;
@@ -1062,6 +1063,7 @@ int v3_drill_guest_pt_32pae(struct guest_info * info, v3_reg_t guest_cr3, addr_t
                        {
                            case PT_ENTRY_NOT_PRESENT:
                                return -1;
+                               break;
                            case PT_ENTRY_LARGE_PAGE:
                                {
                                    addr_t large_page_pa = (addr_t)guest_pte_pa;
@@ -1076,6 +1078,7 @@ int v3_drill_guest_pt_32pae(struct guest_info * info, v3_reg_t guest_cr3, addr_t
                                    }
                                    return 0;
                                }
+                               break;
                            case PT_ENTRY_PAGE:
                                {
                                    pte32pae_t * guest_pte = NULL;
@@ -1106,8 +1109,10 @@ int v3_drill_guest_pt_32pae(struct guest_info * info, v3_reg_t guest_cr3, addr_t
                                        return 0;
                                    }
                                }
+                               break;
                        }
                }
+               break;
            default:
                PrintError(info->vm_info, info, "Invalid page type for PD32PAE\n");
                return -1;
index cef9831..0519ce1 100644 (file)
@@ -37,6 +37,7 @@ void     v3_strategy_driven_yield(struct guest_info *core, uint64_t time_since_l
            } else {
                v3_yield(core,-1);
            }
+           break;
        default:
            PrintError(core->vm_info, core, "Unknown yield strategy (%d) using GREEDY\n",core->vm_info->perf_options.yield_strategy.strategy);
            v3_yield(core,-1);