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.


data type fixes
Jack Lange [Wed, 21 Dec 2011 21:28:58 +0000 (16:28 -0500)]
palacios/src/palacios/svm_msr.c
palacios/src/palacios/vmm_msr.c

index 2ffcfac..b90f4a0 100644 (file)
@@ -57,15 +57,20 @@ static int update_map(struct v3_vm_info * vm, uint_t msr, int hook_reads, int ho
     int index = get_bitmap_index(msr);
     uint_t major = index / 4;
     uint_t minor = (index % 4) * 2;
-    uchar_t val = 0;
-    uchar_t mask = 0x3;
+    uint8_t val = 0;
+    uint8_t mask = 0x3;
     uint8_t * bitmap = (uint8_t *)(vm->msr_map.arch_data);
 
-    if (hook_reads) {
+    if (index == -1) {
+       PrintError("MSR (0x%x) out of bitmap range\n", msr);
+       return 0;
+    }
+
+    if (hook_reads != 0) {
        val |= 0x1;
     } 
     
-    if (hook_writes) {
+    if (hook_writes != 0) {
        val |= 0x2;
     }
 
index bd682a6..b960187 100644 (file)
@@ -109,7 +109,9 @@ int v3_handle_msr_read(struct guest_info * info) {
 
 int v3_msr_unhandled_read(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data) {
     V3_Print("Palacios: Unhandled MSR Read (MSR=0x%x) - returning zero\n", msr);
-    dst->lo=dst->hi=0;
+
+    dst->value = 0;
+
     // should produce GPF for unsupported msr
     return 0;
 }