From 93d389f82078cf7197152fb10d21977da0883420 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Thu, 27 Nov 2014 13:45:58 +0200 Subject: virtio: assert 32 bit features in transports At this point, no transports set any of the high 32 feature bits. Since transports generally can't (yet) cope with such bits, add BUG_ON checks to make sure they are not set by mistake. Based on rproc patch by Rusty. Signed-off-by: Rusty Russell Signed-off-by: Michael S. Tsirkin Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck --- drivers/lguest/lguest_device.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/lguest') diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c index d81170a78a8d..9b77b6623ff8 100644 --- a/drivers/lguest/lguest_device.c +++ b/drivers/lguest/lguest_device.c @@ -136,6 +136,9 @@ static void lg_finalize_features(struct virtio_device *vdev) /* Give virtio_ring a chance to accept features. */ vring_transport_features(vdev); + /* Make sure we don't have any features > 32 bits! */ + BUG_ON((u32)vdev->features != vdev->features); + /* * Since lguest is currently x86-only, we're little-endian. That * means we could just memcpy. But it's not time critical, and in -- cgit v1.2.3