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 5E26EC433EF for ; Thu, 14 Jul 2022 04:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231208AbiGNE2R (ORCPT ); Thu, 14 Jul 2022 00:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234645AbiGNE1I (ORCPT ); Thu, 14 Jul 2022 00:27:08 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85E15286C5; Wed, 13 Jul 2022 21:24:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 60F25CE2358; Thu, 14 Jul 2022 04:24:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBB01C34114; Thu, 14 Jul 2022 04:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772639; bh=CH3O+8rE7gc07cwtk2Pd8nsB1wVExVHVq8mfQlHMR5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j6M4EdKKExuf7iUl//Eg88iTfzk5q+8XQE8Ip0eMiX6lsFwFwtrCYIN3q8K9i9FUx MqzjJkUNGPjKg6yvwNiPT5Jb+PyvU9nX0CfFMWc272jHB/qm+JdHpEo0b2J6xQXjuP 0ocyEksL10sxSujsZFexlNc0n0wnvNyPruG6DzbNwAap0hDJi6wmPGdK+vh68/5ES6 KJzC/87JmDuQjvQUjUlb503CD/WhDR7JuUFkMAAtNNeoBjdSrhyKs62sJb7w/6vs/I F7lLP2Dh6EZedPDmhUpA0KFdJIqTSJtHWhfXyr30pMD/25k2w3fdRPhahGI8Wo7A1v 2vOT/66ng/TKg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Keith Busch , John Garry , Christoph Hellwig , Sasha Levin , axboe@fb.com, sagi@grimberg.me, linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.18 37/41] nvme: use struct group for generic command dwords Date: Thu, 14 Jul 2022 00:22:17 -0400 Message-Id: <20220714042221.281187-37-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042221.281187-1-sashal@kernel.org> References: <20220714042221.281187-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keith Busch [ Upstream commit 5c629dc9609dc43492a7bc8060cc6120875bf096 ] This will allow the trace event to know the full size of the data intended to be copied and silence read overflow checks. Reported-by: John Garry Suggested-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/trace.h | 2 +- include/linux/nvme.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h index b5f85259461a..37c7f4c89f92 100644 --- a/drivers/nvme/host/trace.h +++ b/drivers/nvme/host/trace.h @@ -69,7 +69,7 @@ TRACE_EVENT(nvme_setup_cmd, __entry->metadata = !!blk_integrity_rq(req); __entry->fctype = cmd->fabrics.fctype; __assign_disk_name(__entry->disk, req->q->disk); - memcpy(__entry->cdw10, &cmd->common.cdw10, + memcpy(__entry->cdw10, &cmd->common.cdws, sizeof(__entry->cdw10)); ), TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)", diff --git a/include/linux/nvme.h b/include/linux/nvme.h index f626a445d1a8..99b1b56f0cd3 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -867,12 +867,14 @@ struct nvme_common_command { __le32 cdw2[2]; __le64 metadata; union nvme_data_ptr dptr; + struct_group(cdws, __le32 cdw10; __le32 cdw11; __le32 cdw12; __le32 cdw13; __le32 cdw14; __le32 cdw15; + ); }; struct nvme_rw_command { -- 2.35.1