Skip to contentSkip to conversation

fix virtio-blk failure after reboot

PATCH Applied Gleb Natapov 3 participants 6 messages Sep 15, 2010 – Nov 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix virtio-blk failure after reboot

vring_virtqueue should be zeroed otherwise old values will be reused after reboot.

src/virtio-blk.c +1 -0
index 34d7863..7a25826 100644
@@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
         goto fail;
     }
     memset(vdrive_g, 0, sizeof(*vdrive_g));
+    memset(vq, 0, sizeof(*vq));
     vdrive_g->drive.type = DTYPE_VIRTIO;
     vdrive_g->drive.cntl_id = bdf;
     vdrive_g->vq = vq;

--
Gleb.

Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Gleb Natapov

vring_virtqueue should be zeroed otherwise old values will be reused after reboot.

Nice one.

Quoted 14 lines
src/virtio-blk.c +1 -1
index 34d7863..7a25826 100644
@@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
         goto fail;
     }
     memset(vdrive_g, 0, sizeof(*vdrive_g));
+    memset(vq, 0, sizeof(*vq));
     vdrive_g->drive.type = DTYPE_VIRTIO;
     vdrive_g->drive.cntl_id = bdf;
     vdrive_g->vq = vq;
--

Gleb.

#3 lore raw
In reply to Gleb Natapov
Quoted 9 lines · Gleb Natapov

vring_virtqueue should be zeroed otherwise old values will be reused after reboot.

src/virtio-blk.c +0 -0
index 34d7863..7a25826 100644

src/virtio-blk.c init_virtio_blk(u16 bdf) · line 115

Quoted 7 lines
src/virtio-blk.c +1 -0
@@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
         goto fail;
     }
     memset(vdrive_g, 0, sizeof(*vdrive_g));
+    memset(vq, 0, sizeof(*vq));
     vdrive_g->drive.type = DTYPE_VIRTIO;
     vdrive_g->drive.cntl_id = bdf;
     vdrive_g->vq = vq;

This didn't make it into SeaBIOS v0.6.1. Should we add this to the stable branch as v0.6.1.2? Any other bugfixes that need to go in to the stable branch (maybe Isaku's pci overflow patches)?

-Kevin

#4 lore raw
Quoted 13 lines · Kevin O'Connor
Quoted 12 lines · Gleb Natapov

vring_virtqueue should be zeroed otherwise old values will be reused after reboot.

src/virtio-blk.c +0 -0
index 34d7863..7a25826 100644
@@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
         goto fail;
     }
     memset(vdrive_g, 0, sizeof(*vdrive_g));
Quoted 9 lines

src/virtio-blk.c init_virtio_blk(u16 bdf) · line 115

Quoted 4 lines
src/virtio-blk.c +1 -0
+    memset(vq, 0, sizeof(*vq));
     vdrive_g->drive.type = DTYPE_VIRTIO;
     vdrive_g->drive.cntl_id = bdf;
     vdrive_g->vq = vq;

This didn't make it into SeaBIOS v0.6.1. Should we add this to the stable branch as v0.6.1.2? Any other bugfixes that need to go in to the stable branch (maybe Isaku's pci overflow patches)?

Yes. Please add it to stable branch.

--
Gleb.

#5 lore raw
Quoted 23 lines · Gleb Natapov
Quoted 13 lines · Kevin O'Connor
Quoted 12 lines · Gleb Natapov

vring_virtqueue should be zeroed otherwise old values will be reused after reboot.

src/virtio-blk.c +0 -0
index 34d7863..7a25826 100644
@@ -109,6 +109,7 @@ init_virtio_blk(u16 bdf)
         goto fail;
     }
     memset(vdrive_g, 0, sizeof(*vdrive_g));
Quoted 9 lines

src/virtio-blk.c init_virtio_blk(u16 bdf) · line 115

Quoted 4 lines
src/virtio-blk.c +1 -0
+    memset(vq, 0, sizeof(*vq));
     vdrive_g->drive.type = DTYPE_VIRTIO;
     vdrive_g->drive.cntl_id = bdf;
     vdrive_g->vq = vq;

This didn't make it into SeaBIOS v0.6.1. Should we add this to the stable branch as v0.6.1.2? Any other bugfixes that need to go in to the stable branch (maybe Isaku's pci overflow patches)?

Quoted 1 line

Yes. Please add it to stable branch.

I added it and tagged it as v0.6.1.2.

-Kevin