Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp667386lqe; Sat, 6 Apr 2024 20:13:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjh3+HU7XnnYNxL4wD2fbSlXHoo9wvaoGtzTo5fFtt3hKn20mX5qbwJD76zfSp/ej5IZM1d6uKp81WaNo22D5FdkUjAsHNkwGd2y0jDw== X-Google-Smtp-Source: AGHT+IGk83/xrRft81DpiRtUck4cihCEz+XcEA3LuUKX08Un3Ha/vTmTe50AwL4DJLfw9iXA2tC0 X-Received: by 2002:a05:6a21:3e14:b0:1a3:8793:8840 with SMTP id bk20-20020a056a213e1400b001a387938840mr4483791pzc.33.1712459617975; Sat, 06 Apr 2024 20:13:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712459617; cv=pass; d=google.com; s=arc-20160816; b=O/UkgisGC0RMKdJmO9R5d8RlaGFQ4q6yWxE6EIAQGWxpFc1yBawA8UeSg0xUa7G1mL XYcL6prVNoJvZcEbcKrA/4+uQhtZkLWa8t+LHQ3JH3QaW4ZRx53EMKyphha4xvSR04ap vnY3cWexLrev3CJQMit2Bt7yLy8Oj82BMHoa32GhkarHz+rbGBGJDJXPHIeHGWRXaoB1 d6mNU60XHZnyxayOG1E/mmC67Kc2QsWwHcgHtV3+B+7sKDwN+F0DXflmmHpvTPo6YgKV i4PsOGlxZrOjFy8hlaEA5N/V+dKIi6mzBZngm2lHMqFYI7o86qDr97Ov6HdsW4yQyORZ 3hpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=MJmu/t6Sirl2odpSd1zSsNcSzxnsR4Ufnqv6dslmQe4=; fh=alzCs/KsOkZM/YXW/W5nxNRFIyeUXaae5XxCPbJOFBI=; b=FD8LeWYyNie8sjA5kvjva7mx3ftFGKa2iKhaaAYhyWDNlBzPtkwWnPAlMoZjZLy2El /ky6fbDykMdLDSFN+NNZl5DO+4+jFACEGQ91HF6M9B4LLyoYOwWbhiomAm3v+j9mR4wq OJ+vcpwgYjeyWImFklzRdhfNGZAeKSkcIOm1OgfpJQJSocXkB01X5gS0vi8ag/AXSuA9 5j+d8/vLlMHvvOw5gmSn32dP6glV2NYUfbdFM/Q7pZ8tHxQ7haa4dzJcBUHAL52f9MLE X6G/sLrXKMDGeWLbIRzGZf7l3VRQYifZT6Y4zE423j9op0aGBci5a6G5tRy9ocIY/lBI Z57g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lq1lBg3j; 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-134143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134143-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i5-20020a170902cf0500b001e3fadca9eesi593631plg.551.2024.04.06.20.13.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 20:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lq1lBg3j; 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-134143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134143-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E3761B22CC9 for ; Sun, 7 Apr 2024 03:13:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FB29AD2C; Sun, 7 Apr 2024 03:13:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lq1lBg3j" 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 A01CB8494 for ; Sun, 7 Apr 2024 03:12:58 +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=1712459580; cv=none; b=I3iy4Ei+9XVjJQZnee4htolG73/i9AP7BP/niQblmBqR+sOzneWgnkaSNxplaRcreGykHN1PDvJcLh+lW5/V4LL8OZsVYtehy6h2bUjWR/xLF34n9rjjCl8B3hN+i/oHAEzeLYMgbVCfwIo5+IL60yklLNu1RPlE2Np0byA//QQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712459580; c=relaxed/simple; bh=TiIS2U0Z+wfIv7YPyJrbBALHfW6m6U5jca6+YzZuA6Y=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YDaBd5SP/tr459NMrk+cUyW/aDAsJvI9uHAp93VT//sfcijO3u7X6IetgwnIuP30U2CQIkGi3MdczTJcbDqAcJIZ48P/lfrk6qB7+Ma2But2psUa/S4PQ0pc8EBWTMadt+WTfMh43Z67TQoV9GujBAfUGsqrOWUbm4iPSRr9ikU= 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=Lq1lBg3j; 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=1712459577; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MJmu/t6Sirl2odpSd1zSsNcSzxnsR4Ufnqv6dslmQe4=; b=Lq1lBg3jJm4jSUZ/GIybfSzzCE26MTKnCVqw0hSGyOdu24+V6lWeAYxS/TkDmBJ77QmJLZ kpHGTc1SAkhKphabBVWH/1aLJ+lY9Ahi/x13TStguXFh4teN8N2U21QE5+BuDJeSd6f/O+ MRsp/dwwQXaBBH1pqoe3/XaPqWl5ih8= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-295-XxLg2od_O12BCC3KCtp72A-1; Sat, 06 Apr 2024 23:12:55 -0400 X-MC-Unique: XxLg2od_O12BCC3KCtp72A-1 Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-3c5d97b2950so3432583b6e.1 for ; Sat, 06 Apr 2024 20:12:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712459575; x=1713064375; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MJmu/t6Sirl2odpSd1zSsNcSzxnsR4Ufnqv6dslmQe4=; b=bNeRuaCdpHKH0Sh2ICp0HP27Dyp0D2VGj9gEA8RIhIjVySiWXSKY769f9B0xPXcNiz ASgAFIgvDOA4pzThBKmEqaH1BC03S9t2qGo9R2mskShfQZJPw9e8bBau+UE2cVgT9H/+ HbTCmDgqnTlNLvLr3J+hFg/VwkSD+7lyUYGtllALFRe7kyLB6i+6eppYZ037pdm8soPq aXpusiXvqHPfJJ1FbYeewSJJ1P1mVbcuGDAGK9GR/UjAcBxLo2+NBclsLWfzEf/SCTNP gZIRprgo6/t0HdPZmfrzmMziwAAUF1oES7gM0OevW6WGBcSQFFMnbkXE49TQNHhvyitO b9Uw== X-Gm-Message-State: AOJu0YwzF1BMsiSGhCn75MDJQEndEluYmz7zrOoCGXg1bf2kSaJnAkgI Ndt6OI0Tef+u1O7719VahhznU1G+guZDt1Uo4CmI2qmLbrm4KpgGgV88gcc1wS8++C8O6dBspdL XB52ztEio7OD37aJYrVB+BSXz6+YQipxxJmZXosyfDEXtWxL8ANfvdZU4sdj57+ktWmJEG1CzdZ KA7lubi2tFoLhHwg5I8n0P0lCJ8dmsk++wtKvo X-Received: by 2002:a05:6871:6a5:b0:22e:ae01:db2f with SMTP id l37-20020a05687106a500b0022eae01db2fmr5926305oao.36.1712459575181; Sat, 06 Apr 2024 20:12:55 -0700 (PDT) X-Received: by 2002:a05:6871:6a5:b0:22e:ae01:db2f with SMTP id l37-20020a05687106a500b0022eae01db2fmr5926294oao.36.1712459574910; Sat, 06 Apr 2024 20:12:54 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <41c1c5489688abe5bfef9f7cf15584e3fb872ac5.1712092759.git.mst@redhat.com> In-Reply-To: <41c1c5489688abe5bfef9f7cf15584e3fb872ac5.1712092759.git.mst@redhat.com> From: Jason Wang Date: Sun, 7 Apr 2024 11:12:43 +0800 Message-ID: Subject: Re: [PATCH] vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Namhyung Kim , Zhu Lingshan , =?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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 3, 2024 at 5:21=E2=80=AFAM 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: x ("vhost-vdpa: uapi to support reporting per vq size") > Cc: "Zhu Lingshan" > Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Thanks > --- > > 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 > -- > MST >