Re: [PATCH] x86/alternatives: Fix optimize_nops() checking

From: Peter Zijlstra
Date: Wed Jan 10 2018 - 16:44:33 EST


On Wed, Jan 10, 2018 at 12:26:25PM -0800, Linus Torvalds wrote:
> Imagine just how crazy that would be to debug. You'd be basically
> executing insane code, and looking at the sources - or even the
> binaries - it would _look_ completely sane.

Been there done that.. we have too much self modifying code for that
not to have been needed.

Use gdb on /proc/kcore and disassemble self to see the _real_ code.

But yes, tricky stuff. Not arguing we need relocations in alternatives,
just saying debugging them (and static keys and others) is great fun.