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

From: Linus Torvalds
Date: Wed Jan 10 2018 - 15:49:45 EST


On Wed, Jan 10, 2018 at 12:33 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> Use gdb on /proc/kcore and disassemble self to see the _real_ code.

Yes, because that works so well when you get these random reports of
crazy behavior that simply doesn't ever trigger on any machine you
have.

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

Yes. It's definitely a good challenge, and can be _very_ satisfying
when you then finally figure it out.

I'm not sure it's worth the pain before that point, though.

So I think we should strive to make our alternatives code just catch
some of the more subtle errors early instead.

Linus