From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91804210D for ; Wed, 6 Jul 2022 07:25:57 +0000 (UTC) Received: by mail-wr1-f54.google.com with SMTP id s1so20664067wra.9 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=W9Ri/jRwg4HNfCe+3vY/dZ3h+CADLVlOvBgyFchukCs0GHRRIFnIauR37AI5zGXS26 Auhpxrg2NyeAPBPeqBNPDHWx+25kid1Sf6JDEd0jf1tVL9F/az3SPj+0IW+cuFG6z9/k jMySxfxdc52nGeyEzRXR32a5nw7PRDtqkRyk8e6N+M4R6m4xltMiWWJoXcnMj6z7rR99 0WmIkJB1OB/nqsZ/hCSmCRGudyYvXMIhC/m4CDI7BLMt/mjAufjKHpSce0A6Xqi7R8Sm rZTVxu7xgbIL2ptiSeXlHaLIzrdD1TfujWmWuS54x/ivXq7yuaZSkoWA4cLdaogV/v9H PYCQ== X-Gm-Message-State: AJIora8BbsyCWV752h8EUFRlFIW9avhqig2sP3zapiMjE1GcTilPj7Fw dGLvk85xOifYdgu8NrW+egevnw== X-Google-Smtp-Source: AGRyM1sjjoD72QqN/kPda1ll5BXRtL8M7g0zel6AU2vN3d7fDNT6a5wzNwnXMciWvstWpJaNyTIO/g== 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> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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> 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.