Re: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64

From: Linus Torvalds
Date: Thu Nov 29 2018 - 12:54:50 EST


On Thu, Nov 29, 2018 at 9:50 AM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> - corrupt random registers because we "know" they aren't in use

Just to clarify: I think that's a completely unacceptable model.

We already have lots of special calling conventions, including ones
that do not have any call-clobbered registers at all, because we have
special magic calls in inline asm.

Some of those might be prime material for doing static calls (ie PV-op
stuff, where the native model does *not* change any registers).

So no. Don't do ugly hacks like that.

Linus