From: Christoph Hellwig <hch@lst.de>
To: LABBE Corentin <clabbe@baylibre.com>
Cc: Christoph Hellwig <hch@lst.de>,
Ben Dooks <ben.dooks@codethink.co.uk>,
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
Date: Tue, 5 Jul 2022 19:58:34 +0200 [thread overview]
Message-ID: <20220705175834.GA15815@lst.de> (raw)
In-Reply-To: <YsR7O4q4IRI14Wkc@Red>
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.
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: LABBE Corentin <clabbe@baylibre.com>
Cc: Christoph Hellwig <hch@lst.de>,
Ben Dooks <ben.dooks@codethink.co.uk>,
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
Date: Tue, 5 Jul 2022 19:58:34 +0200 [thread overview]
Message-ID: <20220705175834.GA15815@lst.de> (raw)
In-Reply-To: <YsR7O4q4IRI14Wkc@Red>
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.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-07-05 17:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 13:27 [RFC PATCH] crypto: flush poison data Corentin Labbe
2022-07-01 13:27 ` Corentin Labbe
2022-07-01 13:35 ` Ben Dooks
2022-07-01 13:35 ` Ben Dooks
2022-07-05 8:21 ` LABBE Corentin
2022-07-05 8:21 ` LABBE Corentin
2022-07-05 16:42 ` Christoph Hellwig
2022-07-05 16:42 ` Christoph Hellwig
2022-07-05 17:56 ` LABBE Corentin
2022-07-05 17:56 ` LABBE Corentin
2022-07-05 17:58 ` Christoph Hellwig [this message]
2022-07-05 17:58 ` Christoph Hellwig
2022-07-06 7:25 ` LABBE Corentin
2022-07-06 7:25 ` LABBE Corentin
2022-07-06 9:47 ` Ben Dooks
2022-07-06 9:47 ` Ben Dooks
2022-07-06 11:58 ` Christoph Hellwig
2022-07-06 11:58 ` Christoph Hellwig
2022-07-06 12:23 ` LABBE Corentin
2022-07-06 12:23 ` LABBE Corentin
2022-07-01 14:36 ` Andre Przywara
2022-07-01 14:36 ` Andre Przywara
2022-07-01 14:55 ` LABBE Corentin
2022-07-01 14:55 ` LABBE Corentin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220705175834.GA15815@lst.de \
--to=hch@lst.de \
--cc=ben.dooks@codethink.co.uk \
--cc=clabbe@baylibre.com \
--cc=heiko@sntech.de \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.