Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2516451lqz; Tue, 2 Apr 2024 23:20:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpA0ZBJd5WUnRhRz+VW8SjMAEP7b9C9IHNI0TQVKdi5EekkrR8ppE3OpzWS6BU8mtRM9075uUeOHicPNcyof+WVlUAOEwZ6MLEX/DxIw== X-Google-Smtp-Source: AGHT+IFvCxaYAWCeGECmjoxgh2q2LiQxkodbAcaUa+m2C9ykq1H/bnxHg4qWTEwotlgKyWIKrwhq X-Received: by 2002:a05:620a:450e:b0:78b:de2c:1f9d with SMTP id t14-20020a05620a450e00b0078bde2c1f9dmr11844717qkp.23.1712125258447; Tue, 02 Apr 2024 23:20:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712125258; cv=pass; d=google.com; s=arc-20160816; b=pJsrDz+KCh1+66nJIIkWJ9u5c7YTa/mJJN8kp8dP21cLBxz0uRWjQTgVqTsu1Gmzed pHHYl5/kAMy5+y+GQTPD34hvAjRw7hz+nfhzqXU73ut9zHsS1iR+3ccBYJLRDkmkK9IL NYm6I2PLBdb9PIjJVZufidOA7i+kbMkFtnPMF6zLQlgEVpCxcqburaBveKfDlILY2B5G pquDR5K/FUqQqqZ0+oL+B7Y6u/Ns79CmYyify52C7FEjJQz8qfl0Z7N5CsrEjTX+qCRN oY7cTcyfdhv8woPlQnpJcg6j4wa6zrQJtU/6hPnNh/hx9UEHwKrMIkw0OZHEm/f4jouT 06ZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tpAohYTndDy7KhM3eW0Lc3sflyWJkIFhzc6hmb93Vos=; fh=kXZ9QiP6jGwnsLqzL9aXlAQJVCzskcDnmFVLTcXeaW4=; b=eRkjesGpKBoWjdf4enhvy5tWmyEvGf0c/ppjQD/H4gxfHK0bPFERcLGfFK8xj8vTsn rH2XvxDDQXPP/vm/K/r8FlBjaj4RNbiMFbBfIbKuz9Y52fC6yj4fMLK6lH/OUTMEsq1t LLoWeCPpPwkBQ5eOWwe8YxQSeMaS8jYEuSXT1fYorkAf1EcP8cPm4JFKSxB4n96/CXMv 7glMCTVsUdqINvpcjv074EWTbSB6abfLzy6jWlY2S879Hv4JlP+BNZz6+TOCExZBzVRh RVw+Df6LRDoc/1x/2CGQrPKdkWKxNInnGp+aMyRRT95zkHIirSyCE8szo9QXuNel1xNX Pz8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MRUt4V79; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-129078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m9-20020a05620a220900b0078d39d93edasi279588qkh.190.2024.04.02.23.20.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 23:20:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MRUt4V79; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-129078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 31EC21C21140 for ; Wed, 3 Apr 2024 06:20:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B785852F99; Wed, 3 Apr 2024 06:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MRUt4V79" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 C7F37645; Wed, 3 Apr 2024 06:20:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712125245; cv=none; b=CZFmVEOQt5XbhYzm3OsldCgwyyHuvOUhedFBf+FRjSxNgQEiVh6ZuayV3CB2WdJrQz1PDRVDOY8Xxk7dw7XPnpUIvWrtkyrRwVG1wcYw68gVFJSs124iwP46l/Gl+GDRtITU85F3QdlwkyQlxfudUlrG6tnYq2WFHY5IoNbAX2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712125245; c=relaxed/simple; bh=JpP/EDsMSxDuAaZti2qzwzDnAIQsAXrHMUrBgeEJ/Qk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Mgj9PrJMh9yCa6iEXsf8u7RscUlMTqPbiszG9OAXaEJn5rwYKZth1fiFlaib9/iyGYekFBWSjU0PuSkC9b8JxCckpZVCQWt08j9PUFAbWVGd80n3LjHYl0OPAaoUdYInzLCtSF6j02QXqYXhGBM1h2OWJVVmd4e/0geLHfYGya8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MRUt4V79; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712125243; x=1743661243; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=JpP/EDsMSxDuAaZti2qzwzDnAIQsAXrHMUrBgeEJ/Qk=; b=MRUt4V79NBZ+BeHW+YxWuepAWZe9sZ1q9oc3AcphXNijuE44Al0B4LbO 27F85VsRS7J0fal203h+lQ3AqWRLxvnVTHciAfkAFqLpHVeJMzx4O3Lha 8zgDpqgnjB5ujSQhhkcmY+D/n70/byUBKsoW2G7KD+RB79X3InjMuQSl3 sN2SNH7olqajdgVbIQAszjMszpRHfUroebh87fJP5OO6pcs4ql3B2Mulo 3E5XBz80k41rK1I+r17mtSfOCozvLhKthRtqMFmWWzmMzqH3ZNP10Mfqt bcZ7pHVMorLzijgMAJ8wTYedQXU3eecoWbZMor2aa2Xo40ei/IHNMlEti w==; X-CSE-ConnectionGUID: RON7XNj6TDuF+Iei/Ti7vA== X-CSE-MsgGUID: McJnjiTdTs2c0XZvQvbxug== X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="7492471" X-IronPort-AV: E=Sophos;i="6.07,176,1708416000"; d="scan'208";a="7492471" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 23:20:43 -0700 X-CSE-ConnectionGUID: TsR1QIiURJmbYigYH81a0Q== X-CSE-MsgGUID: jxr6We+rSRi5gdycU53sEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,176,1708416000"; d="scan'208";a="23023367" Received: from lingshan-mobl.ccr.corp.intel.com (HELO [10.124.249.198]) ([10.124.249.198]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 23:20:40 -0700 Message-ID: <81ba4f68-21b7-48bf-94ae-8cd72880fed6@intel.com> Date: Wed, 3 Apr 2024 14:20:36 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Jason Wang , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, Adrian Hunter , Ian Rogers , Jiri Olsa , Kan Liang References: <41c1c5489688abe5bfef9f7cf15584e3fb872ac5.1712092759.git.mst@redhat.com> Content-Language: en-US From: "Zhu, Lingshan" In-Reply-To: <41c1c5489688abe5bfef9f7cf15584e3fb872ac5.1712092759.git.mst@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/3/2024 5:21 AM, 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 Reviewed-by: Zhu Lingshan Thanks for the fix and sorry for the mess, I should read the whole header file to check whether the number is available. > --- > > 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. > > 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