Thread (16 messages) 16 messages, 4 authors, 2021-01-28

Re: [PATCH 0/7] crypto: switch to static calls for CRC-T10DIF

flat view

From: Ard Biesheuvel <ardb@kernel.org>
Date: 2021-01-11 21:02:27

On Mon, 11 Jan 2021 at 21:56, Peter Zijlstra [off-list ref] wrote:
On Mon, Jan 11, 2021 at 07:36:20PM +0100, Ard Biesheuvel wrote:
quoted
On Mon, 11 Jan 2021 at 18:27, Ard Biesheuvel [off-list ref] wrote:
quoted
On Mon, 11 Jan 2021 at 17:52, Ard Biesheuvel [off-list ref] wrote:
quoted
quoted
quoted
Special request to Peter to take a look at patch #2, and in particular,
whether synchronize_rcu_tasks() is sufficient to ensure that a module
providing the target of a static call can be unloaded safely.
It seems I may have managed to confuse myself slightly here: without
an upper bound on the size of the input of the crc_t10dif() routine, I
suppose we can never assume that all its callers have finished.
Replying to self again - apologies.

I think this is actually correct after all: synchronize_rcu_tasks()
guarantees that all tasks have passed through a 'safe state', i.e.,
voluntary schedule(), return to userland, etc, which guarantees that
no task could be executing the old static call target after
synchronize_rcu_tasks() returns.
Right, I think it should work.

My initial question was why you'd want to support the unreg at all.
AFAICT these implementations are tiny, why bother having them as a
module, or if you insist having them as a module, why allowing removal?
Yeah, good question.

Having the accelerated version as a module makes sense imo: it will
only be loaded if it is supported on the system, and it can be
blacklisted by the user if it does not want it for any reason. Unload
is just for completeness/symmetry, but it is unlikely to be crucial to
anyone in practice.

In any case, thanks for confirming - if this looks sane to you then we
may be able to use this pattern in other places as well.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help