Re: [PATCH 1/3] x86/alternatives: Teach text_poke_bp() to emulate instructions

From: Peter Zijlstra
Date: Mon Oct 07 2019 - 04:05:37 EST


On Fri, Oct 04, 2019 at 10:45:40PM +0900, Masami Hiramatsu wrote:
> Hi Peter,
>
> On Thu, 3 Oct 2019 13:01:06 +0200
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> > > I'm halfway through a patch introducing:
> > >
> > > union text_poke_insn {
> > > u8 code[POKE_MAX_OPCODE_SUZE];
> > > struct {
> > > u8 opcode;
> > > s32 disp;
> > > } __attribute__((packed));
> > > };
> > >
> > > to text-patching.h to unify all such custom unions we have all over the
> > > place. I'll mob up the above in that.
>
> I think it is good to unify such unions, but I meant above was, it was
> also important to unify the opcode macro. Since poke_int3_handler()
> clasifies the opcode by your *_INSN_OPCODE macro, it is natual to use
> those opcode for text_poke_bp() interface.

Right, but I think we should do that as another patch, there's a lot of
instances in that file and just changing one or two over is 'weird'.

I can put it on the todo to fix that all up.