--- x/drivers/vhost/vhost.c +++ y/drivers/vhost/vhost.c @@ -2207,6 +2207,7 @@ int vhost_get_vq_desc(struct vhost_virtq __virtio16 avail_idx; __virtio16 ring_head; int ret, access; + bool was_set = !!(vq->used_flags & VRING_USED_F_NO_NOTIFY); /* Check it isn't doing very strange things with descriptor numbers. */ last_avail_idx = vq->last_avail_idx; @@ -2332,7 +2333,7 @@ int vhost_get_vq_desc(struct vhost_virtq /* Assume notifications from guest are disabled at this point, * if they aren't we would need to update avail_event index. */ - BUG_ON(!(vq->used_flags & VRING_USED_F_NO_NOTIFY)); + BUG_ON(!!(vq->used_flags & VRING_USED_F_NO_NOTIFY) != was_set); return head; } EXPORT_SYMBOL_GPL(vhost_get_vq_desc);