aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrew Scull <ascull@google.com>2022-05-16 10:41:32 +0000
committerTom Rini <trini@konsulko.com>2022-06-08 09:24:03 -0400
commitfbef3f53d4a1ccdcbec46c923c9d208d6cbb50aa (patch)
treea1dc19e6ec49ade2bc1b5a8b592448d037e0b71a /include
parent10a14536366350fdd2d14af1981d9e3d8cb3c524 (diff)
downloadu-boot-fbef3f53d4a1ccdcbec46c923c9d208d6cbb50aa.tar.gz
virtio_ring: Check used descriptors are chain heads
When the device returns used buffers, it should refer to the descriptor that is the head of the descriptor chain for that buffer. Confirm this to be the case by tracking the head of descriptor chains that have been made available to the device. Signed-off-by: Andrew Scull <ascull@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/virtio_ring.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/virtio_ring.h b/include/virtio_ring.h
index 52cbe77c0a2..c77c212cffd 100644
--- a/include/virtio_ring.h
+++ b/include/virtio_ring.h
@@ -61,6 +61,8 @@ struct vring_desc_shadow {
u32 len;
u16 flags;
u16 next;
+ /* Metadata about the descriptor. */
+ bool chain_head;
};
struct vring_avail {