Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2821400rwn; Fri, 9 Sep 2022 22:46:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR4yy91087UJ50lJaL2eXeWV2DQkMO44P6YcWc9BZ35A7njXHiaqSJ1Kqnq8+0Qe88QzBq5X X-Received: by 2002:a17:902:6bca:b0:173:cfae:a7e5 with SMTP id m10-20020a1709026bca00b00173cfaea7e5mr16708720plt.39.1662788808829; Fri, 09 Sep 2022 22:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662788808; cv=none; d=google.com; s=arc-20160816; b=j4afFJeeKfcONtr4B8EBLf60MwkEi+aqj7uNb8MyYLkYVsn6ziuNbKxOPFMTyamf2L hlsOHSivWs+8brb/Fz+NC46noIletDKu1tpKK3itwRJxD6XGTlnIhF/V3hlmj7K2tApc UBZQgLXrrebB2ooG9OPRG6FQ8r4DkdSPy6loZLIPkMIjniPRYdSuCswBxq2ErLOz2Ye8 fj4bNZzNgp8McSvx1QZhNiIQFCXIpfX4OB30phgUpMWN1AzFzL9lX7eQ734rPOLpg0pT exJ+smYAWX4h8GuSld6D7n48/tuSFNc7qpSOKZcZKQCkCCgyJCJFi10wngJDzUQ1cDR7 xL7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ptW4C9eeXYWPChJiSCFp689+NEWgas5KQn85lcrnMYo=; b=qnFYrHV0cATyiau+AjlXqJykZbvh7N9X9j/8Z+NmfrVOJroKzG/LxbrS+zxQef3YOm a3yd4ThG7qg0Ib86m3wkzicAQIO8KKOtKBHrX10dEHkpPuSPYbhFue91TVqUURNBqWSS OgXTvBiiafnzlveZqrE/uH2OvXkh9RLHB6RKJCIIPnkJyU9hzCCKMlWi9UHXlw3dzZq+ mXop78w4QTQ2B/7f9LVZMux9JoOhktGU2I9PCN7DovXij8cIHLM6yG7wKa0EWdZIN+5s pmYh2Lv6Upm0x/KsTnmP/vHHQruFLzSEJBEmCG0CQDdRdZ4TRB52fT6RBL+h8dzAnKdN 4zOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a170903214400b0016d2dcb9b91si972412ple.599.2022.09.09.22.46.36; Fri, 09 Sep 2022 22:46:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbiIJFcI (ORCPT + 99 others); Sat, 10 Sep 2022 01:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiIJFcG (ORCPT ); Sat, 10 Sep 2022 01:32:06 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7A7080496; Fri, 9 Sep 2022 22:32:05 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 3939F68B05; Sat, 10 Sep 2022 07:32:03 +0200 (CEST) Date: Sat, 10 Sep 2022 07:32:03 +0200 From: Christoph Hellwig To: Serge Semin Cc: Jonathan Derrick , Revanth Rajashekar , Jens Axboe , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Rafael Antognolli , Scott Bauer , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Thomas Bogendoerfer , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] block: sed-opal: Cache-line-align the cmd/resp buffers Message-ID: <20220910053203.GB23052@lst.de> References: <20220909191916.16013-1-Sergey.Semin@baikalelectronics.ru> <20220909191916.16013-3-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909191916.16013-3-Sergey.Semin@baikalelectronics.ru> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2022 at 10:19:16PM +0300, Serge Semin wrote: > In accordance with [1] the DMA-able memory buffers must be > cacheline-aligned otherwise the cache writing-back and invalidation > performed during the mapping may cause the adjacent data being lost. It's > specifically required for the DMA-noncoherent platforms. Seeing the > opal_dev.{cmd,resp} buffers are used for DMAs in the NVME and SCSI/SD > drivers in framework of the nvme_sec_submit() and sd_sec_submit() methods > respectively we must make sure the passed buffers are cacheline-aligned to > prevent the denoted problem. Same comment as for the previous one, this should work, but I think separate allocations for the DMAable buffers would document the intent much better. Given that the opal initialization isn't a fast path I don't think that the overhead should matter either.