This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] asm goto


Are we sure that it wouldn't be better to offer a feature that isn't
extending asm? We're just putting in a specific feature that will be
abused in exactly one way, forever tying this kernel to whatever
versions of GCC implement this feature.

I'm fairly certain that someone will come up with a use for this feature other than nop patching.

Even nop patching itself can be used for other purposes than tracing.


For example, for paravirtualization the kernel tries to patch out calls to functions when Linux is running on bare metal, rewriting calls to nops when the function does nothing, or to moves when the function is "return arg1;".

It even compiling the calls manually (surrounded by pushes in the pv case) to keep the best register allocation, but this sequence is quite big and it wastes cache in the no-pvops case.

Being able to just say

   IF_FEATURE(paravirt)
     pv_ops.hypercall_cli();
   else
     asm("cli");

or something like that, with almost no performance penalty, would be a nice boon.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]