Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2151492imw; Wed, 6 Jul 2022 00:34:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sVJtHTnDrQEFNi+Kc3IvyzzT9cyqVytnskESTmM5HpxsFc9BoY7bRYsVB8CkHNZRPVrwN9 X-Received: by 2002:a17:90b:1e0f:b0:1ef:bb89:4920 with SMTP id pg15-20020a17090b1e0f00b001efbb894920mr174834pjb.58.1657092885844; Wed, 06 Jul 2022 00:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657092885; cv=none; d=google.com; s=arc-20160816; b=JpA5gTRRmQ7a/BHDoysEP6OZS9GAH1CxpGhoYsnDX3yQ2BwjpYut28dOQarjggMj7E 5+SwSUhlmDfBVJ+PoIOJt2sV56SEmlAkYDzL9I+0OtAWi8Vgp6QLWgh5KQ5LSqzHzhFi 2FRFtedE6fCU9DJREACWzxbDfu7bwlcczWHFURcbJUORVCELr103lJ4CoeJ9FTdoIRJx MdGztwjiNZDtMM6tkdFt7oIq/6jzp72yKekedTQDoudpWnafaZn7MtJztiuakDZAyIGV FnhQZYZ8GFO+NFqKGN52QPNfyUnGztEObj9Su4NNvwLr1eVeCniLHDEzfI3SnVgbqrH2 Ku2Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RNGv+/8XLL3pLmqx9QBeEgEnepJuAQVAPCFO8Yi+Cro=; b=E+VgmBcC+1K+fx4qo/7iJsxzHW856oZN0SF3YCvZDT8PIMfotnH0NUAj6xQvsQh5p3 80zHK+4bpzc4Unk+fth30EUYmbtVSt+YbGEVLH7v9E+rcjSksF+LIlOBfxOvH+rbQoNE MJQ0yxeklM9TAOBkDBObVDVv1NVbwZP598HsaQE0K1JzgQpgBax2rNlkb6ei3VJHytYx jjlCbger1W6+Yqwi5bCu4ixJYnyqtMpI7ilNh/wnpyffLusK/+oiS6iVf3N5H/Zzyj1d V+oJBN2J5cvZKAeQZo1LhcpY4XYnwo1lnIWjWeTI8Mc1CCk4MvZ01ek59d8trIU8SkyN 6J2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=3mUI2v7S; 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 e4-20020a170902784400b0015ea5cf069esi43154328pln.489.2022.07.06.00.34.21; Wed, 06 Jul 2022 00:34:45 -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; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=3mUI2v7S; 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 S231591AbiGFHZ6 (ORCPT + 99 others); Wed, 6 Jul 2022 03:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbiGFHZ6 (ORCPT ); Wed, 6 Jul 2022 03:25:58 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1659422522 for ; Wed, 6 Jul 2022 00:25:57 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id b26so20694364wrc.2 for ; Wed, 06 Jul 2022 00:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=RNGv+/8XLL3pLmqx9QBeEgEnepJuAQVAPCFO8Yi+Cro=; b=3mUI2v7SV28d9VmjYj0Fyg+1wNOzEcpQ4VMVHukiS0/GQw88kM3nJjZIj9oUc5CyOn HWcWTODnZgR+0wizfsFWughub1yC23i2CW45v0j3SfQ6zbxNdXA8w2tH0HZO1N5WWZah 9l6I3qFan41NyCXQCm14R222BXC4hhrZWPm5nFJfGfc6eKig5tAO1KCC1MsEvu1oJO56 ArveHYEYcNb5z55A57UdWFcrxHRuCxGREVvxJZ2XM2ZrBPzy2YGruospChNnGUgoleU1 b1QGJDfEz9UYeOIri0rx7Nqk+wtupPIUNQYC3rxhUem/IABM7T9tuf5TB0uUF0jZB69F o/Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=RNGv+/8XLL3pLmqx9QBeEgEnepJuAQVAPCFO8Yi+Cro=; b=fl+T43pS3hKXjan/3Qvf9z+v0byasE2bRiQkH3FiUGlUZXr55mk1WSs7GxjavItCL6 uLzJH13T889OdiVCo7K7Ynbl1n+azMck458QCeRlt1euc83O1rbPlZBapsAac+wpCiX/ 5xzTMI72JoAB2qNpGZoRNB89AiDKu6vbAbjy6FOCYTggcrUvXG0tWEA4LXbcgETyEI04 jZ6g+L6YVRBEzrZ44nWdWt7PmrScbv+Hvvd1CP/OwsMyUzL1AcOTlNGrxMuIOajevaEB PL6AwEkKjWf9BXt24S47+2E9npBl9ROcBtf7k01Syn0RQKlnNnUKogvXyocsXb8DpeAs 8TnA== X-Gm-Message-State: AJIora+6/GqkOziSa3f9xAzJLLERO2voOmwCxmN6oO9CLQ8mOAkWkGzd OTDF3A6WcFhyC9djxac6bYaeOg== X-Received: by 2002:a5d:468a:0:b0:21d:6dc8:9e60 with SMTP id u10-20020a5d468a000000b0021d6dc89e60mr11671635wrq.595.1657092355613; Wed, 06 Jul 2022 00:25:55 -0700 (PDT) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id a1-20020a05600c348100b003a03be22f9fsm20272887wmq.18.2022.07.06.00.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 00:25:55 -0700 (PDT) Date: Wed, 6 Jul 2022 09:25:50 +0200 From: LABBE Corentin To: Christoph Hellwig Cc: 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: References: <20220701132735.1594822-1-clabbe@baylibre.com> <4570f6d8-251f-2cdb-1ea6-c3a8d6bb9fcf@codethink.co.uk> <20220705164213.GA14484@lst.de> <20220705175834.GA15815@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220705175834.GA15815@lst.de> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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-crypto@vger.kernel.org Le Tue, Jul 05, 2022 at 07:58:34PM +0200, Christoph Hellwig a ?crit : > 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. I am sorry but I dont see how this can help my problem.