diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 492a44d7b77e..24b44a271096 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1642,6 +1642,14 @@ static long vhost_vring_set_num_addr(struct vhost_dev *d, BUG(); } + /* + * The metadata cache holds the IOTLB mapping that backed the previous + * desc/avail/used addresses and vring size, both of which are being + * replaced here. iotlb_access_ok() takes a cache hit as proof that the + * region was validated, so the stale entries have to go. + */ + __vhost_vq_meta_reset(vq); + mutex_unlock(&vq->mutex); return r;