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.


fix potential overflow condition in VMX assist
[palacios.git] / linux_usr / v3_user_host_dev.c
index 709db76..a0c1a99 100644 (file)
@@ -55,7 +55,11 @@ int v3_user_host_dev_pull_request(int devfd, struct palacios_host_dev_host_reque
        return -1;
     } else {
        struct palacios_host_dev_host_request_response *r = malloc(len);
-       
+
+       if (!r) { 
+           return -1;
+       }
+
        rc=ioctl(devfd, V3_HOST_DEV_HOST_REQUEST_PULL_IOCTL,r);
        
        if (rc<=0) { 
@@ -115,11 +119,24 @@ uint64_t v3_user_host_dev_write_guest_mem(int devfd, void *gpa, void *src, uint6
     return do_user(devfd,&op);
 }
 
-int      v3_user_host_dev_inject_irq(int devfd, uint8_t irq)
+int      v3_user_host_dev_raise_irq(int devfd, uint8_t irq)
+{
+    struct palacios_host_dev_user_op op;
+
+    op.type= PALACIOS_HOST_DEV_USER_REQUEST_IRQ_RAISE_GUEST;
+    op.gpa=0;
+    op.data=0;
+    op.len=0;
+    op.irq=irq;
+    
+    return do_user(devfd,&op);
+}
+
+int      v3_user_host_dev_lower_irq(int devfd, uint8_t irq)
 {
     struct palacios_host_dev_user_op op;
 
-    op.type= PALACIOS_HOST_DEV_USER_REQUEST_IRQ_GUEST;
+    op.type= PALACIOS_HOST_DEV_USER_REQUEST_IRQ_LOWER_GUEST;
     op.gpa=0;
     op.data=0;
     op.len=0;