Re: [PATCH V4 5/9] x86/alternative: Split text_poke_bp() into tree steps

From: Daniel Bristot de Oliveira
Date: Fri Feb 15 2019 - 07:47:29 EST


On 2/8/19 1:15 AM, Steven Rostedt wrote:
> On Mon, 4 Feb 2019 20:58:58 +0100
> Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> wrote:
>
>>
>> +static void text_poke_bp_set_handler(void *addr, void *handler,
>> + unsigned char int3)
>> +{
>> + bp_int3_handler = handler;
>> + bp_int3_addr = (u8 *)addr + sizeof(int3);
>> + text_poke(addr, &int3, sizeof(int3));
>> +}
>> +
>> +
>> +static void patch_first_byte(void *addr, const void *opcode, unsigned char int3)
>> +{
>> + /* patch the first byte */
>> + text_poke(addr, opcode, sizeof(int3));
>> +}
> Hmm, perhaps get rid of the first function entirely, and just do...
> (although why have the "int3" here anyway?)
>

These helpers were created because they were used twice in the first versions of
this patch set. But with the change suggested by Masami, they are called only in
the text_poke_bp_batch() now, so I am thinking to get rid of them all (removing
this patch).

Thoughts?

Thanks!
-- Daniel