This is the mail archive of the gcc@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] Kernel livepatching support in GCC


> > As I am bit concerned with performance why require nops there? Add a
> > byte count number >= requested thats boundary of next instruction. When
> > lifepatching for return you need to copy this followed by jump back to next
> > instruction. Then gcc could fill that with instructions that don't
> > depend on address, fill with nops as trivial first implementation.
> > 
> > Would that be possible?
> 
> So instead of placing NOPs to be overwritten you intend to simply overwrite the existing code after
> making a backup of it? 

This is how Linux k/uprobes work. But it only works for a subset of instructions and is
fairly complicated because you need a complete decoder that is able to adjust any program counter
relative data offsets. Having a patch area is far easier and more reliable.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only


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