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 09E41C4332F for ; Tue, 29 Nov 2022 08:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230159AbiK2Im0 (ORCPT ); Tue, 29 Nov 2022 03:42:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbiK2Il6 (ORCPT ); Tue, 29 Nov 2022 03:41:58 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09DC27677 for ; Tue, 29 Nov 2022 00:41:57 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 4412468AFE; Tue, 29 Nov 2022 09:41:52 +0100 (CET) Date: Tue, 29 Nov 2022 09:41:51 +0100 From: Christoph Hellwig To: Lei Rao Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme: clear the prp2 field of the nvme command. Message-ID: <20221129084151.GA25609@lst.de> References: <20221129014711.91305-1-lei.rao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221129014711.91305-1-lei.rao@intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 29, 2022 at 09:47:11AM +0800, Lei Rao wrote: > If the prp2 field is not filled in nvme_setup_prp_simple(), the prp2 > field is garbage data. According to nvme spec, the prp2 is reserved if > the data transfer does not cross a memory page boundary. Writing a > reserved coded value into a controller property field produces undefined > results, so it needs to be cleared in nvme_setup_rw(). But this is not the right place to clear it, that needs to be done in the place that sets up the PRPs, і.e. nvme_setup_prp_simple.