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.


Merge branch 'devel' of palacios@newskysaw.cs.northwestern.edu:/home/palacios/palacio...
Peter Dinda [Fri, 20 Jan 2012 19:08:36 +0000 (13:08 -0600)]
1  2 
linux_module/iface-host-dev.c
palacios/src/palacios/vmm_msr.c

@@@ -342,7 -342,6 +342,6 @@@ static int host_dev_release(struct inod
      return 0;
  }
  
  static int host_dev_ioctl(struct inode *ip, struct file *fp, unsigned int val, unsigned long arg)
  {
      void __user *argp = (void __user *)arg;
                        return -EFAULT;
                    }
                    
 -                  if (v3_host_dev_read_guest_mem(dev->guestdev,
 -                                                 dev,
 +                  if (v3_host_dev_read_guest_mem(dev,
 +                                                 dev->guestdev,
                                                   op.gpa,
                                                   temp,
                                                   op.len) != op.len) {
                        return -EFAULT;
                    }
                    
 -                  if (v3_host_dev_write_guest_mem(dev->guestdev,
 -                                                  dev,
 +                  if (v3_host_dev_write_guest_mem(dev,
 +                                                  dev->guestdev,
                                                    op.gpa,
                                                    temp,
                                                    op.len) != op.len) {
  
                    DEEP_DEBUG_PRINT("palacios: hostdev: irq guest\n");
  
 -                  return  v3_host_dev_raise_irq(dev->guestdev, dev, op.irq);
 +                  return  v3_host_dev_raise_irq(dev, dev->guestdev, op.irq);
                }
                    break;
  
      
  }
  
+ static long host_dev_compat_ioctl(struct file * filp, unsigned int ioctl, unsigned long arg)
+ {
+       return host_dev_ioctl(NULL, filp, ioctl, arg);
+ }
  
  static struct file_operations host_dev_fops = {
      .poll     = host_dev_poll,
      .release  = host_dev_release,
-     .ioctl    = host_dev_ioctl,
+ #ifdef HAVE_COMPAT_IOCTL
+     .compat_ioctl = host_dev_compat_ioctl,
+ #else
+     .ioctl = host_dev_ioctl,
+ #endif
  };
  
  
@@@ -64,13 -64,9 +64,13 @@@ int v3_handle_msr_write(struct guest_in
        msr_val.lo = info->vm_regs.rax;
        msr_val.hi = info->vm_regs.rdx;
        
 -      if (hook->write(info, msr_num, msr_val, hook->priv_data) == -1) {
 -          PrintError("Error in MSR hook Write\n");
 -          return -1;
 +      if (hook->write) {
 +          if (hook->write(info, msr_num, msr_val, hook->priv_data) == -1) {
 +              PrintError("Error in MSR hook Write\n");
 +              return -1;
 +          }
 +      } else {
 +          PrintError("No write hook exists for msr 0x%x\n",msr_num);
        }
      }
  
@@@ -108,12 -104,15 +108,15 @@@ int v3_handle_msr_read(struct guest_inf
  
  
  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)\n", msr);
+     V3_Print("Palacios: Unhandled MSR Read (MSR=0x%x) - returning zero\n", msr);
+     dst->lo=dst->hi=0;
+     // should produce GPF for unsupported msr
      return 0;
  }
  
  int v3_msr_unhandled_write(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data) {
-     V3_Print("Palacios: Unhandled MSR Write (MSR=0x%x)\n", msr);
+     V3_Print("Palacios: Unhandled MSR Write (MSR=0x%x) - ignored\n", msr);
+     // should produce GPF for unsupported msr
      return 0;
  }