Re: [RFC 0/3] x86: Patchable constants

From: H. Peter Anvin
Date: Wed Feb 07 2018 - 15:52:43 EST


FYI: the interface I'm implementing looks like this:

[output =] const_op(data, variable);

... where variable can be any variable with a static address, although
in any sane scenario it should be __ro_after_init. During
initialization, it kicks out to an out-of-line (.alternatives_aux)
handler which accesses the variable in normal fashion, but at
alternatives-patching time it inlines the relevant opcodes.

Some of the assembly infrastructure for this is indeed hairy, especially
when the out-of-line hander needs temp registers.

-hpa