Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp67053rwb; Sun, 25 Sep 2022 15:34:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4L0KeNs+T60n3vCLXUAT3s+vwySnxai8MMTnTdY8AEL4WHIGAaCTx1l/QeQqDQLFkUN/1h X-Received: by 2002:a63:8bc2:0:b0:43c:ac7d:7502 with SMTP id j185-20020a638bc2000000b0043cac7d7502mr3166023pge.595.1664145278437; Sun, 25 Sep 2022 15:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664145278; cv=none; d=google.com; s=arc-20160816; b=fS+nbCGn9zSDZwikE5tyr5ELpGaDaQ5iRbHJIT3gjIJEFjvd1EnCs4YHqJa2AnfOqA 1AjSaHGF2rBwQ33uwcCpcakdSQG6Ps6t2km3Bvsr4JQE4cHe7ZUDqWlXfQfR0AbnsVpw wlwhixIvb7bTq6O7+HsZDkT0mWjmCukCQBHPf8JVay71DD/j0qr5+99c2YgejfapH9Ts 11CFI+mB+CNj0PqSsN3O/t7b5Zbh2ROrJLcVEWhy8OIBugFAZuXdqLA9W+ZOE+a6XeRH TBTBDZnpr4MdGvTvIbCdLpNDpiI6d6c8dJqN1/x3cCqXCSP29YoxA/sQk4gLm3CMX3z7 /OXA== 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=a0hPbzQaBpMZbWVLyY6Ndr2md1EPl8heRcl2lfx1uao=; b=eUDtX983BxP9CIw1sLN4JBj+ikBhi+ZAq5tgzw2moPJTy3AqUHyg1NpcSlpXevkY45 iwtwbMWclcsQWQFUli7/8yaDGZUvNp+hrlSNvcaGw2bbl4TQ9AUr6bYdUKCz5m0+OiN/ NFASZ8ikR0BMd7AKgLq/fWrgalxMpGzBryq1LaNB9cuCFL9yHlYUmqdw6UHQsYCsgviJ c7LHWb9yoB76SFxZnLCBVS2pRA+pcxrkyCe6cZA66+eWBD9FNOX15u+Cy1L0FFVCH2i9 Z13LgsAYEakDUmjpyuh41oSZrnxqSIMtExdpRyEoEy4WvpBI3eOjZaNXweuj0djMEz/g 3raw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=prIsjwSV; 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 g64-20020a636b43000000b0043c147152c1si10974178pgc.817.2022.09.25.15.34.26; Sun, 25 Sep 2022 15:34:38 -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=prIsjwSV; 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 S232142AbiIYWbA (ORCPT + 99 others); Sun, 25 Sep 2022 18:31:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiIYWa5 (ORCPT ); Sun, 25 Sep 2022 18:30:57 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 975CE28E16; Sun, 25 Sep 2022 15:30:55 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id g20so5601617ljg.7; Sun, 25 Sep 2022 15:30:55 -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=a0hPbzQaBpMZbWVLyY6Ndr2md1EPl8heRcl2lfx1uao=; b=prIsjwSViz1wXo7G4+dw2QMAUYRqb+JaN8xLaFU0Mpm720vsQlKbiP86kSyjK6/J2f UGL1JMA+tZbm+36axWkxsWe76LZ50jIgn88og12tFEhHuVazHWUXqmuxCGQQTATOLLmZ spdrcaq4Lzuq2ssEmvib39fmILwUzpX8VRsbe7Lq+Qajv529JR0stTj6IQi6cEHLkmKh OafABWRhWwcww6JDyoK0lU7XrAFw9x3u/15eQrfGPJIta/7hVKMeZBDesROTh0WhRfJi Nfd032HRBElAfY2jFOTPhNqIK1eLWkfEokcM8b151gDnjM4vSzgW3h4PbTqXJUyDvznl W5NQ== 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=a0hPbzQaBpMZbWVLyY6Ndr2md1EPl8heRcl2lfx1uao=; b=gAlFmgyZTnyggUK+6w5HNuc2f3JCjR9nQm+JveIwHSL/ygAkn8xKRad6N0ThML26ll ZHI4Tz+bxHR/7Qt5z1URJybe6U+f9mVHIeoNt88/WIpMJKIr45BcIfc4vHeYfOUxcKnf L2rZb1W2W93lwiI5oL37oYSTItVo697/7O64nEsfRw7zovKFyYBHwmyZEddIGDzw5ioj gG/rzbXubFyHGzEdqqiBak22IwOOdE5v7DtcphAoxdLDGF9Z4sZviUuczWxGCX8O/1MY MpGnV9Z6pvlotfXPX/R76pCiK5dUqBz59z/9B3onmlT7cm/Y2KePbn9RIlXkVGWRSQa+ 1wzg== X-Gm-Message-State: ACrzQf37CXm6GdfKPC9+iJ9JNN4/h0TYFku6nK3oC8lOP/SgQrBnM8xm QJSnycm1tXvYcgilVGTV1xY= X-Received: by 2002:a2e:7d13:0:b0:26c:4062:acfe with SMTP id y19-20020a2e7d13000000b0026c4062acfemr6763157ljc.201.1664145053791; Sun, 25 Sep 2022 15:30:53 -0700 (PDT) Received: from mobilestation ([95.79.140.178]) by smtp.gmail.com with ESMTPSA id l10-20020a056512110a00b0049f9c732858sm2322995lfg.254.2022.09.25.15.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 15:30:53 -0700 (PDT) Date: Mon, 26 Sep 2022 01:30:51 +0300 From: Serge Semin To: Christoph Hellwig , Jonathan Derrick , Revanth Rajashekar , Jens Axboe 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: <20220925223051.5vem3ab4267jlxeg@mobilestation> References: <20220909191916.16013-1-Sergey.Semin@baikalelectronics.ru> <20220909191916.16013-3-Sergey.Semin@baikalelectronics.ru> <20220910053203.GB23052@lst.de> <20220911162854.ivoeyzilpboplldw@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220911162854.ivoeyzilpboplldw@mobilestation> 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 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 @Jens, @Revanth, @Jonathan do you have anything to say regarding the patch and what @Christoph suggested? On Sun, Sep 11, 2022 at 07:28:57PM +0300, Serge Semin wrote: > 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