Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4337687rwn; Sun, 11 Sep 2022 09:47:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Xt2hD6wh7/GsJBEvAd5mHrrbyQwe2NKDRIRPU1l/SHnlGkQYyf7EJ194/aJTWy+KiPSlX X-Received: by 2002:a17:902:e891:b0:178:7b6:92db with SMTP id w17-20020a170902e89100b0017807b692dbmr12570326plg.160.1662914866888; Sun, 11 Sep 2022 09:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662914866; cv=none; d=google.com; s=arc-20160816; b=gz5gWyL8e0Rba3Av9IhZC06lnm3oLn2STbNagHR+HHAI+73jJl5eCSbH9tqWxh1L3h dvccNzxOh7aV1NSbcpOXTMZjhFW5oV7ILoBa3DKhkjXST3wONO3pwyH5dhTboFRaifzU u4DIYQEUopw8LqPt67oTmcpZJHsaX75WJwRJIhEM0NmLgLKNV4rHSP/rkDCBNg7yNNry LYYQ2dM5lkWdIk9CGeH8rb701KcHZbvSxfEnwJmbtXlUPi8JafoqprLwm2rQmnpLgoD0 kVaTswdpVje1UOpd3JjRFFOQoMz3wEyaloNQmC7BuDvcrGf8Ex0dA8QuoNt+rYct68fo uFdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7SSYiogdPwy5AgzgPl2zf3eDXRMfkA0ZYbT+p4MLVEs=; b=TRsdFCEBFszLZxAonmVpE3hvr9lxHdkStkq1qE7dKro77TKcb6hU1U6MY1bI190wi3 tr+l8iQCpUmIdFLBuVoaOvIVza7fnh1i2bsYI8WRBXb082quIQ31t75ErC7oB7BUzu/r A4Ghn/DqGSchu4QyB9dda2laeZ2ijbI/EhiQB00EfOm27MbRP2HlDxAgucPR90ZuBvR8 PjPzMiUg7hdAS9YI+dGAIJP7vTQmILZe4OGs2m3Jp1Z1OmWJAe/umvCH2i3+En9vabDo wG7+lMGZ1qvnaKhJ5zWlFoHOLNl0Wf0DSdBDeg9mwsoJFH743+EA2VzFMTCLCcj1YpNx f/RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YfbaiPM2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a654204000000b004388595b99asi6542809pgq.483.2022.09.11.09.47.31; Sun, 11 Sep 2022 09:47:46 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YfbaiPM2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbiIKQ3C (ORCPT + 99 others); Sun, 11 Sep 2022 12:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiIKQ3B (ORCPT ); Sun, 11 Sep 2022 12:29:01 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9462E686; Sun, 11 Sep 2022 09:28:58 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 9so7013348ljr.2; Sun, 11 Sep 2022 09:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=7SSYiogdPwy5AgzgPl2zf3eDXRMfkA0ZYbT+p4MLVEs=; b=YfbaiPM2c0SQ88+hOjCzIUtdHE9Ib6zAL1KQnXLN/8bjSuRNK9YpRj6KcNxGljUbwj mWrbVhBr1Evz8nwZxWcOFR/bEpT2ZS+WnX5olxlxfvBq3iGI01zYlrg2/+XSJd+J79EB 3TdsWh5qY3c7RkJF82zYUuatGsnc4Aczj523odKFdkpGBElAalXWuWVxk670UpBOSMpo A7BtpbXAVhgjCu/pDicsPhmcn5J+k66yykPXWcz8ciEM2D1sBzopAfwoFKpcRVkIbT4r MVpyYm0bQ2A4b6sh5d2tBcnlyuXBSHmIxSWg0iFdgs6UIJaYYHRPzT/Zzo9oKhQ2796Y m+vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=7SSYiogdPwy5AgzgPl2zf3eDXRMfkA0ZYbT+p4MLVEs=; b=M8DOoSs8wrdr22n4p0BW2zi/99U+8pZH5xHBubpKOe6HJkeaJdHVmvGg4NY83dJZTb B0coWa3zB8ssI2LCcs8U2cAxtfEdchLxoL+LszE0yGc+Xr9oJkPya9YF6j64YJjtg4Dz XMFZaLBOtI/bdWbm4zfS4SGpB9QPBRzfcwON8iNVRwc5dzV10LkQyEWCWUF0XDBtD4tx 2jVj2Sg2GckjLHY9h1bp43PychWYoQrY7PlDIXhKdCw9WsEXEPUNRBWf0SGVEBu5us/B ey/3s0Kgsn966BY2JsMpixYWfmel+EcsdWlb1wVU+6rMyl760N3PnWhEEF6Ij/u3RJ7H DjXA== X-Gm-Message-State: ACgBeo2z4I4oxvfGXrACD+T4ShnDhWqDT81FQOCjALr5QBd+s51wlnQI 9QNmTwni4ECU7Vhv7X3gdy/H5+Uxu7AcwQ== X-Received: by 2002:a2e:890f:0:b0:26b:ddca:863e with SMTP id d15-20020a2e890f000000b0026bddca863emr4819481lji.30.1662913737349; Sun, 11 Sep 2022 09:28:57 -0700 (PDT) Received: from mobilestation ([95.79.140.178]) by smtp.gmail.com with ESMTPSA id n26-20020a05651203fa00b0049876c2befasm453542lfq.289.2022.09.11.09.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 09:28:56 -0700 (PDT) Date: Sun, 11 Sep 2022 19:28:54 +0300 From: Serge Semin To: Christoph Hellwig Cc: Serge Semin , Jonathan Derrick , Revanth Rajashekar , Jens Axboe , Keith Busch , Jens Axboe , Sagi Grimberg , Rafael Antognolli , Scott Bauer , 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: <20220911162854.ivoeyzilpboplldw@mobilestation> References: <20220909191916.16013-1-Sergey.Semin@baikalelectronics.ru> <20220909191916.16013-3-Sergey.Semin@baikalelectronics.ru> <20220910053203.GB23052@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220910053203.GB23052@lst.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Hello Christoph On Sat, Sep 10, 2022 at 07:32:03AM +0200, Christoph Hellwig wrote: > 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. Thanks for the comment. I see your point. Let's hear the subsystem maintainers out for their opinion regarding the most suitable solution in this case. If they get to agree with you I'll resend the series with altered fixes. -Sergey