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 a virtio ring buffer free run index overflow bug
[palacios.git] / palacios / include / devices / lnx_virtio_pci.h
index 9e6e69f..5ecf694 100644 (file)
 #define VIRTIO_BLOCK_DEV_ID       0x1001
 #define VIRTIO_BALLOON_DEV_ID     0x1002
 #define VIRTIO_CONSOLE_DEV_ID     0x1003
+#define VIRTIO_SYMBIOTIC_DEV_ID   0x100a
 
+#define VIRTIO_NET_SUBDEVICE_ID 1
 #define VIRTIO_BLOCK_SUBDEVICE_ID 2
 #define VIRTIO_BALLOON_SUBDEVICE_ID 5
+#define VIRTIO_SYMBIOTIC_SUBDEVICE_ID 10
 
 
 #define HOST_FEATURES_PORT 0
 /* This means don't interrupt guest when buffer consumed. */
 #define VIRTIO_NO_IRQ_FLAG      0x1
 
+
+/* ISR Flags */
+#define VIRTIO_ISR_ACTIVE 0x1
+#define VIRTIO_ISR_CFG_CHANGED 0x2
+
+
+
 /* The virtio configuration space is a hybrid io/memory mapped model 
  * All IO is done via IO port accesses
  * The IO ports access fields in a virtio data structure, and the base io port 
@@ -118,6 +128,8 @@ struct virtio_queue {
     uint16_t queue_size;
   
     uint16_t cur_avail_idx;
+    uint16_t last_avail_idx;
+    bool idx_overflow;
 
     addr_t ring_desc_addr;
     addr_t ring_avail_addr;