[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4D3C14BB-6830-46E1-A9E2-D8EBD7E3A2FA@amacapital.net>
Date: Fri, 7 Jun 2019 09:33:27 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Nadav Amit <namit@...are.com>,
the arch/x86 maintainers <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Jason Baron <jbaron@...mai.com>, Jiri Kosina <jkosina@...e.cz>,
David Laight <David.Laight@...lab.com>,
Borislav Petkov <bp@...en8.de>,
Julia Cartwright <julia@...com>, Jessica Yu <jeyu@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Edward Cree <ecree@...arflare.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH 10/15] static_call: Add basic static call infrastructure
> On Jun 7, 2019, at 1:49 AM, Ard Biesheuvel <ard.biesheuvel@...aro.org> wrote:
>
>> On Fri, 7 Jun 2019 at 10:29, Peter Zijlstra <peterz@...radead.org> wrote:
>>
>> On Thu, Jun 06, 2019 at 10:44:23PM +0000, Nadav Amit wrote:
>>>> + * Usage example:
>>>> + *
>>>> + * # Start with the following functions (with identical prototypes):
>>>> + * int func_a(int arg1, int arg2);
>>>> + * int func_b(int arg1, int arg2);
>>>> + *
>>>> + * # Define a 'my_key' reference, associated with func_a() by default
>>>> + * DEFINE_STATIC_CALL(my_key, func_a);
>>>> + *
>>>> + * # Call func_a()
>>>> + * static_call(my_key, arg1, arg2);
>>>> + *
>>>> + * # Update 'my_key' to point to func_b()
>>>> + * static_call_update(my_key, func_b);
>>>> + *
>>>> + * # Call func_b()
>>>> + * static_call(my_key, arg1, arg2);
>>>
>>> I think that this calling interface is not very intuitive.
>>
>> Yeah, it is somewhat unfortunate..
>>
>
> Another thing I brought up at the time is that it would be useful to
> have the ability to 'reset' a static call to its default target. E.g.,
> for crypto modules that implement an accelerated version of a library
> interface, removing the module should revert those call sites back to
> the original target, without putting a disproportionate burden on the
> module itself to implement the logic to support this.
I was thinking this could be a layer on top. We could have a way to register a static call with the module core so that, when a GPL module with an appropriate symbol is loaded, the static call gets replaced.
KVM could use this too. Or we could just require KVM to be built in some day.
Powered by blists - more mailing lists