Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1539040imw; Tue, 5 Jul 2022 11:09:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tZSrbrua3krzEiUBjMmjCltujjlC89S4tWO2r0UF4rxhmYmp18j9LYefNrOkWDvMlVMvJ5 X-Received: by 2002:a63:db41:0:b0:40d:e79f:8334 with SMTP id x1-20020a63db41000000b0040de79f8334mr13493180pgi.565.1657044573061; Tue, 05 Jul 2022 11:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657044573; cv=none; d=google.com; s=arc-20160816; b=Wk1ldIcQud/35TyNZxak+TRQsaJh1X3DfvTnjOkz24oMxsQltxYZGCpVo7E3YgTXeJ glAl3FwiDBtfoyHEVPFBi+VhqOWjGLGAs8jvrlNFL93z285L5ID/Ui0oGUIIOwAkJyGP zLQ7j8RijQyIzOiV07JtYfA+XgiiFhkxhAlplPs+hfp1O7oQTzntvMkxhSp9IofqQU/w vty6EukBeT4nAn/SW6XE6+ZWzajM5mR3gCfdO/yJRIcRE8KOE65VvHIcYfE2wTsK6/aX LSCP/KBku1ovshR7055NGYF1SUJMgvSR7+QGeQOT5NgnJX90Ctbg9JV4Uk0twLLXLEp7 6m/g== 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=Etw2MLtYymuxFt9QIKklbL6GJGzU3xFP0VubZcAtZGY=; b=l/sODDO/FX5Xvfgz1wBeRVLy/KoHfhnF//ifOhAjVcoITGrcT1tRgk/q/dCSaTYCZs ioI1pat5kjZxxjiEeFzPnJR7wYb71jcJkTyO/284iBxR4HADNgnr3zoB7Cx9b/r8pgsz W8jziD/Ohf35rano9/CQWkLgaTnSIpBfp45e95Cg6quuaWd19b1f/FInflIg4tbLKpM/ 7/1RdC3hO2QvEBXC6g/QckQPaB+vTpJ2XnGZ8Gu/7YnIpoDBaR6A8ce/nN7Rdru3EpmM 7phyWMEOF3QzKiTieosD0jOZCJaDlNofY5rzvPVW5td0DHcP/pGJINIPcqhkPSAvqGHK pkZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 b1-20020aa78ec1000000b005289dd6fdd1si1558823pfr.71.2022.07.05.11.09.20; Tue, 05 Jul 2022 11:09:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiGER6l (ORCPT + 99 others); Tue, 5 Jul 2022 13:58:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231337AbiGER6k (ORCPT ); Tue, 5 Jul 2022 13:58:40 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EC5616589; Tue, 5 Jul 2022 10:58:38 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 7FD8E67373; Tue, 5 Jul 2022 19:58:34 +0200 (CEST) Date: Tue, 5 Jul 2022 19:58:34 +0200 From: Christoph Hellwig To: LABBE Corentin Cc: Christoph Hellwig , Ben Dooks , herbert@gondor.apana.org.au, heiko@sntech.de, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [RFC PATCH] crypto: flush poison data Message-ID: <20220705175834.GA15815@lst.de> References: <20220701132735.1594822-1-clabbe@baylibre.com> <4570f6d8-251f-2cdb-1ea6-c3a8d6bb9fcf@codethink.co.uk> <20220705164213.GA14484@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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-crypto@vger.kernel.org On Tue, Jul 05, 2022 at 07:56:11PM +0200, LABBE Corentin wrote: > My problem is that a dma_sync on the data buffer corrupt the poison buffer as collateral dommage. > Probably because the sync operate on a larger region than the requested dma_sync length. > So I try to flush poison data in the cryptoAPI. Data structures that are DMAed to must be aligned to the value returned by dma_get_cache_alignment(), as non-coherent DMA by definition can disturb the data inside that boundary. That is not a bug but fundamentally part of how DMA works when the device attachment is not cache coherent.