From: Eugenio Pérez Date: Mon, 19 Jan 2026 14:32:59 +0000 (+0100) Subject: vhost: forbid change vq groups ASID if DRIVER_OK is set X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3543b04a4ea3de78bdc420350d21c538efd6116c;p=thirdparty%2Flinux.git vhost: forbid change vq groups ASID if DRIVER_OK is set 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> --- 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);