From 3543b04a4ea3de78bdc420350d21c538efd6116c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Eugenio=20P=C3=A9rez?= Date: Mon, 19 Jan 2026 15:32:59 +0100 Subject: [PATCH] vhost: forbid change vq groups ASID if DRIVER_OK is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Only vdpa_sim support it. Forbid this behaviour as there is no use for it right now, we can always enable it in the future with a feature flag. Acked-by: Jason Wang Signed-off-by: Eugenio Pérez Signed-off-by: Michael S. Tsirkin Message-Id: <20260119143306.1818855-7-eperezma@redhat.com> --- drivers/vhost/vdpa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 9d25b735b43dd..3f0184d42075c 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -682,6 +682,8 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd, return -EFAULT; if (idx >= vdpa->ngroups || s.num >= vdpa->nas) return -EINVAL; + if (ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK) + return -EBUSY; if (!ops->set_group_asid) return -EOPNOTSUPP; return ops->set_group_asid(vdpa, idx, s.num); -- 2.47.3