From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CBC7CE7B00 for ; Thu, 28 Sep 2023 06:28:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230298AbjI1G2Y (ORCPT ); Thu, 28 Sep 2023 02:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbjI1G2X (ORCPT ); Thu, 28 Sep 2023 02:28:23 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22CE59C for ; Wed, 27 Sep 2023 23:28:21 -0700 (PDT) Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20230928062818epoutp03e2531aba5529db0e7868bcb7c89db809~I-CWx9d211516015160epoutp03M for ; Thu, 28 Sep 2023 06:28:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20230928062818epoutp03e2531aba5529db0e7868bcb7c89db809~I-CWx9d211516015160epoutp03M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1695882498; bh=np1wCyyTF5m5+8Zyeo7ik3GwizYUYFnqjB6m0xeAUEM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZXkkvTIfdZcMqm4jDpwndmwXbzyT1Ux+/7YkAcdXFqB7DbjlNSYaaOxBEaBb33Ihc mULP990slGl+R/oDZQmbztFORJnAvTP/kDzRucxJH/pFt4lu6ioIHOPX3tb4AE2vxs qTMEtk5N9zQp1WRJ76bZ517SuyAcVOLQZmaTipFA= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20230928062818epcas5p48c9e782c3fec36d361d952bece68fd60~I-CWhkY6g1625216252epcas5p4D; Thu, 28 Sep 2023 06:28:18 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.176]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Rx3Sw2x2Pz4x9Pr; Thu, 28 Sep 2023 06:28:16 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 2E.B0.09638.00D15156; Thu, 28 Sep 2023 15:28:16 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20230928061733epcas5p1837b43637213341fb9674e99efa62a94~I_4_F9kju1720117201epcas5p1u; Thu, 28 Sep 2023 06:17:33 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230928061733epsmtrp26779921415ce6637ee9ce1aef8af9dc4~I_4_FX2QK0908609086epsmtrp2K; Thu, 28 Sep 2023 06:17:33 +0000 (GMT) X-AuditID: b6c32a4a-92df9700000025a6-64-65151d00ad88 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 4E.C1.08788.D7A15156; Thu, 28 Sep 2023 15:17:33 +0900 (KST) Received: from green245 (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230928061732epsmtip26264bd26e97aba7d1dddecc5fc551468~I_49PwP5p0377403774epsmtip2y; Thu, 28 Sep 2023 06:17:32 +0000 (GMT) Date: Thu, 28 Sep 2023 11:41:25 +0530 From: Anuj Gupta To: Ming Lei Cc: Jens Axboe , io-uring@vger.kernel.org, linux-block@vger.kernel.org, Gabriel Krisman Bertazi Subject: Re: [PATCH V4 1/2] io_uring: retain top 8bits of uring_cmd flags for kernel internal use Message-ID: <20230928061125.hm2dxmms7db2xk5x@green245> MIME-Version: 1.0 In-Reply-To: <20230923025006.2830689-2-ming.lei@redhat.com> User-Agent: NeoMutt/20171215 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupik+LIzCtJLcpLzFFi42LZdlhTXZdBVjTV4NIPQYvVd/vZLN61nmOx 2H5mKbPF3lvaFocmNzM5sHpcPlvq8X7fVTaPzaerPT5vkgtgicq2yUhNTEktUkjNS85PycxL t1XyDo53jjc1MzDUNbS0MFdSyEvMTbVVcvEJ0HXLzAFaqqRQlphTChQKSCwuVtK3synKLy1J VcjILy6xVUotSMkpMCnQK07MLS7NS9fLSy2xMjQwMDIFKkzIzli47BhzwSexinMH7zM3MK4U 7mLk5JAQMJH4vPcZSxcjF4eQwG5GiYVX1rFDOJ8YJQ7828cIUiUk8I1RovOWGEzHiktHoDr2 AsUPPGaGKHrGKPFxCVgDi4CqxNZFC9hBbDYBdYkjz1vB4iICShJ3764G28As0MIocWHtKbCE sECyxO/9EM28AmYS//+cYYewBSVOznzCAmJzClhLHNh8EiwuKiAjMWPpV2aQQRICt9gljn78 xwpxnovEm0MnmSBsYYlXx7ewQ9hSEp/f7WWDsNMlflx+ClVTINF8DOJNCQF7idZT/WDfMAtk SBz51ApVLysx9dQ6Jog4n0Tv7ydQvbwSO+bB2EoS7SvnQNkSEnvPNUDZHhKth2czQYJrP6PE 7OdbWCYwys9C8twsJPsgbCuJzg9NrLMYOYBsaYnl/zggTE2J9bv0FzCyrmKUTC0ozk1PLTYt MMpLLYfHeHJ+7iZGcKLU8trB+PDBB71DjEwcjIcYJTiYlUR4H94WShXiTUmsrEotyo8vKs1J LT7EaAqMrYnMUqLJ+cBUnVcSb2hiaWBiZmZmYmlsZqgkzvu6dW6KkEB6YklqdmpqQWoRTB8T B6dUA9OsLd3TdjX36ZoLphz7yV5QPv/ZI489515s7Cz359D6cfbN68BfFVO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fX7s7 7/RCP0nxqs+aiRfdKt1sjvypXLXc/VmNWuss1ySBE7vu6/HbnHsgLXl6U1C6wGX9kF5Pk7cC F/387a7GbdqTGLrscZjXxgPqEd/al/85LnV4k2psfcfdsMUzv/8IWzM7SFhzYnehisnlBxr+ Dyz7upWOvNzyQp79dYGggY1s6wur+QcvbfqvxFKckWioxVxUnAgAgVtaUNwCAAA= X-CMS-MailID: 20230928061733epcas5p1837b43637213341fb9674e99efa62a94 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----IKYw8rt4xsi0beZH_Imxy96mvZbFJ64oQ.XZqp2ZTk-1zWLz=_2a65e_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230928061733epcas5p1837b43637213341fb9674e99efa62a94 References: <20230923025006.2830689-1-ming.lei@redhat.com> <20230923025006.2830689-2-ming.lei@redhat.com> Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org ------IKYw8rt4xsi0beZH_Imxy96mvZbFJ64oQ.XZqp2ZTk-1zWLz=_2a65e_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline On 23/09/23 10:50AM, Ming Lei wrote: >Retain top 8bits of uring_cmd flags for kernel internal use, so that we >can move IORING_URING_CMD_POLLED out of uapi header. > Looks good. Reviewed-by: Anuj Gupta >Signed-off-by: Ming Lei >--- > include/linux/io_uring.h | 3 +++ > include/uapi/linux/io_uring.h | 5 ++--- > io_uring/io_uring.c | 3 +++ > io_uring/uring_cmd.c | 2 +- > 4 files changed, 9 insertions(+), 4 deletions(-) > >diff --git a/include/linux/io_uring.h b/include/linux/io_uring.h >index 106cdc55ff3b..ae08d6f66e62 100644 >--- a/include/linux/io_uring.h >+++ b/include/linux/io_uring.h >@@ -22,6 +22,9 @@ enum io_uring_cmd_flags { > IO_URING_F_IOPOLL = (1 << 10), > }; > >+/* only top 8 bits of sqe->uring_cmd_flags for kernel internal use */ >+#define IORING_URING_CMD_POLLED (1U << 31) >+ > struct io_uring_cmd { > struct file *file; > const struct io_uring_sqe *sqe; >diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h >index 8e61f8b7c2ce..de77ad08b123 100644 >--- a/include/uapi/linux/io_uring.h >+++ b/include/uapi/linux/io_uring.h >@@ -246,13 +246,12 @@ enum io_uring_op { > }; > > /* >- * sqe->uring_cmd_flags >+ * sqe->uring_cmd_flags top 8bits aren't available for userspace > * IORING_URING_CMD_FIXED use registered buffer; pass this flag > * along with setting sqe->buf_index. >- * IORING_URING_CMD_POLLED driver use only > */ > #define IORING_URING_CMD_FIXED (1U << 0) >-#define IORING_URING_CMD_POLLED (1U << 31) >+#define IORING_URING_CMD_MASK IORING_URING_CMD_FIXED > > > /* >diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c >index 783ed0fff71b..9aedb7202403 100644 >--- a/io_uring/io_uring.c >+++ b/io_uring/io_uring.c >@@ -4666,6 +4666,9 @@ static int __init io_uring_init(void) > > BUILD_BUG_ON(sizeof(atomic_t) != sizeof(u32)); > >+ /* top 8bits are for internal use */ >+ BUILD_BUG_ON((IORING_URING_CMD_MASK & 0xff000000) != 0); >+ > io_uring_optable_init(); > > /* >diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c >index 537795fddc87..a0b0ec5473bf 100644 >--- a/io_uring/uring_cmd.c >+++ b/io_uring/uring_cmd.c >@@ -91,7 +91,7 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) > return -EINVAL; > > ioucmd->flags = READ_ONCE(sqe->uring_cmd_flags); >- if (ioucmd->flags & ~IORING_URING_CMD_FIXED) >+ if (ioucmd->flags & ~IORING_URING_CMD_MASK) > return -EINVAL; > > if (ioucmd->flags & IORING_URING_CMD_FIXED) { >-- >2.41.0 > ------IKYw8rt4xsi0beZH_Imxy96mvZbFJ64oQ.XZqp2ZTk-1zWLz=_2a65e_ Content-Type: text/plain; charset="utf-8" ------IKYw8rt4xsi0beZH_Imxy96mvZbFJ64oQ.XZqp2ZTk-1zWLz=_2a65e_--