Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2601882lqz; Wed, 3 Apr 2024 03:08:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAVavtBu45SMUfNchBqrMkCbzMbOC+38oi2k7KJdulHNomIkR9WFNe7+OENoiBRpJ+PP9Wu8/8oZDVMNx5pJgcOiqVPI7OqwGRjKnkOg== X-Google-Smtp-Source: AGHT+IHvMUo4xpU5YlOolpW589ULnnwhXOouDlFGlcuXroBCjlO0NVfkOiBBF33AwGRviNilcB6c X-Received: by 2002:a17:906:c12:b0:a4a:3441:2e2a with SMTP id s18-20020a1709060c1200b00a4a34412e2amr11370715ejf.55.1712138895138; Wed, 03 Apr 2024 03:08:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712138895; cv=pass; d=google.com; s=arc-20160816; b=PLWqfHSnLY+LdClKVdC9j60siJ9PQChsOUrNAKxdn0To9Pkq9FBsYt8bywQJpRDAMM aycFxmMoThPodwZAAM9VkIqkLYit3jqWFrDse2GqrmQqfDvQSLVPWFBW0o440hbgIgRQ gkssJT0s/+ew7K8UKZY/9g7F5MDkebCSFwJoLSwxy5SxUa/hEiB/zFmJUDgTD0oOdRrg HRGRYgbhtDxpSs54Jky/FjvsPilAY2FJDtGD7LE/uozECNiN0I1JiZxdkYSZ4SF4j9UO QlXaGs3sC/9FTvIPcrBI0gtC3J3mtgV1Vxi2hJJ1ZHJFZEIdvb0HZe7N06uY4mbSOW9O oEkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0NkjBL5bDYnfw/9r7z0I5K4fWXu8LGwC+T3Asv+pwcA=; fh=2hgvC4+kepBZjDjMzgPviv+t7iCcSP4mmYyJdJDaWGo=; b=Wb4y8P6sQDQVuu3kuCrRbFoXp08sJ/OEglrJAomGmF9TdXQxsoaW+QZVN1w1W9bkjs abjLfzb2hkvFgWGJ2dh0gKA8IoZ/ueCaMKnopzV+weRQcmJwnN9ZEiEHDqmOHBGRF417 aRJdCbgnBJyYz4YYjLI8mxab4vgL5b2EvH+M0lx2NZesXiYr/M+ZlC09mdq8Uy3U/D97 kV4u5QXk8O2VDb5KQ3CkF+AX2Da5adnd6/1ISiwymjLiZCHxFzPXkk0q5mIcIKJ1i0g4 q+e5U+IL1/XjBMho2lPaC4gx72Q/t6goGtcCPtHGtWvZAjiF8MMWQ3n2gVpSgryCiZBG uaJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cTd6vcUi; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-129467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id wn3-20020a170907068300b00a4707f01ab8si6387974ejb.507.2024.04.03.03.08.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 03:08:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cTd6vcUi; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-129467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6405D1F28E4D for ; Wed, 3 Apr 2024 09:58:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 323FA135A54; Wed, 3 Apr 2024 09:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cTd6vcUi" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99CE0135405 for ; Wed, 3 Apr 2024 09:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138282; cv=none; b=sydXhhoYe8XIHs/8q99Sq0kRyedxIPJOHc/pwJAKILJYBmqIo9IFonXJhrjOwRwYlWkgGkHpKGSsz0t8646RoV8qL+LznZ8CsLd70ZHKX+4nIlRq9jgL9HWv+oi/8ngRsNsSEmlYm0gpYna0lesax8Nm4UzMofMAkgt41f7b8j4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138282; c=relaxed/simple; bh=8RRynYXEEsr910DpOhWgmhyIrE00u1hABv+0y3HxPJQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r9IcE1+0zUhEG+611xtsCUo922Vyz5sF7/XjBxYYKqCoG990JN0xY0EQL9XLsGY5ugNTsF/F0qzNXTeJ62vQoRh97NLlGto8x6BagnAJtYBQWmgCQtiUQKinWwEzE+N1nRYhiIAhvz4cV+qHTkuJPHioHE6WisbCsZ0HI6juHgA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cTd6vcUi; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712138278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0NkjBL5bDYnfw/9r7z0I5K4fWXu8LGwC+T3Asv+pwcA=; b=cTd6vcUip3O1uXuISY8o2DL1x9xfi09U/s7cAsgjY1aGYj4/R8NpEsowmv6dpEvwYf70Wh CzMZOUSq3OE/uNFytQ03QcP8mDBeC164w6ydC5ETlFRTsqyCZO63EXoNt4PKG14d/frfMD BISWoYINYT/mMdLBF2Wy5/Geo6Butm8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-345-Y2EqodugOAuehtKWPQl_tA-1; Wed, 03 Apr 2024 05:57:57 -0400 X-MC-Unique: Y2EqodugOAuehtKWPQl_tA-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4147faf154cso27923115e9.2 for ; Wed, 03 Apr 2024 02:57:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712138276; x=1712743076; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0NkjBL5bDYnfw/9r7z0I5K4fWXu8LGwC+T3Asv+pwcA=; b=MxcKJmYSFIjz7WluGyYB8Kg4uyM4pERU8KK9ykcI1lib6L22tZm0vaUUBcaKz7fmVm 3Ljfyg5bFJz89xKaZoIl2nF5yZiJp6cxUMvDgFjFN5gnIs48Mt/KUyy4TnDZpqXUFfQz wxFSRmKxV9v3XbBtlCRTKyjIU179ksX5xMhwiCcSXSaQy0lBM/7B9Fx00zwyDWsu7Gsl 2qVyAGh4oQPWjlEAJn7ybwNB4aWd7DlcVd6v/VsM+oyXE1OylZ3kJDCx9GPGNBzp5XlS b+zayqUNO4FsHTaRzY2SJcuDl4RRy3l4K4u2KPHt9uIVQz93axuB+rrbiZcZZ5veaS9A R3ww== X-Gm-Message-State: AOJu0YxmBhTkmmq2j13xFFquxrQfSEhW/OB1Z3U2zF/KLbOAglpf5aNG 1DY4lHYQvC3nz9agC9dhpAMYCn6Rwn+1D5zxrjQz2nh2apnUCdBSTJosEc5W9UbVxsq0S56BSd4 RcUMq/7Le2UtPem8bdGGpbIpymMCcpwRYadR/90V0+/VPDEqRGsV5xgp0JLpt3g== X-Received: by 2002:a05:600c:1c99:b0:414:8a28:6c89 with SMTP id k25-20020a05600c1c9900b004148a286c89mr12523543wms.31.1712138276248; Wed, 03 Apr 2024 02:57:56 -0700 (PDT) X-Received: by 2002:a05:600c:1c99:b0:414:8a28:6c89 with SMTP id k25-20020a05600c1c9900b004148a286c89mr12523530wms.31.1712138275940; Wed, 03 Apr 2024 02:57:55 -0700 (PDT) Received: from sgarzare-redhat ([185.95.145.60]) by smtp.gmail.com with ESMTPSA id m4-20020a05600c3b0400b004161b8a0310sm4955377wms.1.2024.04.03.02.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 02:57:55 -0700 (PDT) Date: Wed, 3 Apr 2024 11:57:50 +0200 From: Stefano Garzarella To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Namhyung Kim , Zhu Lingshan , Jason Wang , Eugenio =?utf-8?B?UMOpcmV6?= , kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, Adrian Hunter , Ian Rogers , Jiri Olsa , Kan Liang Subject: Re: [PATCH] vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE Message-ID: References: <41c1c5489688abe5bfef9f7cf15584e3fb872ac5.1712092759.git.mst@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <41c1c5489688abe5bfef9f7cf15584e3fb872ac5.1712092759.git.mst@redhat.com> On Tue, Apr 02, 2024 at 05:21:39PM -0400, Michael S. Tsirkin wrote: >VDPA_GET_VRING_SIZE by mistake uses the already occupied >ioctl # 0x80 and we never noticed - it happens to work >because the direction and size are different, but confuses >tools such as perf which like to look at just the number, >and breaks the extra robustness of the ioctl numbering macros. > >To fix, sort the entries and renumber the ioctl - not too late >since it wasn't in any released kernels yet. > >Cc: Arnaldo Carvalho de Melo >Reported-by: Namhyung Kim >Fixes: 1496c47065f9 ("vhost-vdpa: uapi to support reporting per vq size") >Cc: "Zhu Lingshan" >Signed-off-by: Michael S. Tsirkin >--- > >Build tested only - userspace patches using this will have to adjust. >I will merge this in a week or so unless I hear otherwise, >and afterwards perf can update there header. Fortunately, we haven't released any kernels with this yet, right? (other than v6.9-rc*) LGTM: Reviewed-by: Stefano Garzarella > > include/uapi/linux/vhost.h | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h >index bea697390613..b95dd84eef2d 100644 >--- a/include/uapi/linux/vhost.h >+++ b/include/uapi/linux/vhost.h >@@ -179,12 +179,6 @@ > /* Get the config size */ > #define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32) > >-/* Get the count of all virtqueues */ >-#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32) >- >-/* Get the number of virtqueue groups. */ >-#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32) >- > /* Get the number of address spaces. */ > #define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int) > >@@ -228,10 +222,17 @@ > #define VHOST_VDPA_GET_VRING_DESC_GROUP _IOWR(VHOST_VIRTIO, 0x7F, \ > struct vhost_vring_state) > >+ >+/* Get the count of all virtqueues */ >+#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32) >+ >+/* Get the number of virtqueue groups. */ >+#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32) >+ > /* Get the queue size of a specific virtqueue. > * userspace set the vring index in vhost_vring_state.index > * kernel set the queue size in vhost_vring_state.num > */ >-#define VHOST_VDPA_GET_VRING_SIZE _IOWR(VHOST_VIRTIO, 0x80, \ >+#define VHOST_VDPA_GET_VRING_SIZE _IOWR(VHOST_VIRTIO, 0x82, \ > struct vhost_vring_state) > #endif >-- >MST > >