Re: [PATCH V2 7/9] x86/alternative: Batch of patch operations

From: Daniel Bristot de Oliveira
Date: Tue Dec 18 2018 - 14:27:33 EST


On 12/18/18 6:31 PM, Steven Rostedt wrote:
> On Tue, 18 Dec 2018 17:46:36 +0100
> Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> wrote:
>
>> +void text_poke_bp_batch(struct text_to_poke *tp, unsigned int nr_entries)
>> +{
>> + unsigned int i;
>> + unsigned char int3 = 0xcc;
>> + int patched_all_but_first = 0;
>> +
>> + bp_int3_tpv = tp;
>> + bp_int3_tpv_nr = nr_entries;
>> + bp_patching_in_progress = true;
>> + /*
>> + * Corresponding read barrier in int3 notifier for making sure the
>> + * in_progress and handler are correctly ordered wrt. patching.
>> + */
>> + smp_wmb();
>> +
>> + for (i = 0; i < nr_entries; i++)
>> + text_poke_bp_set_handler(tp[i].addr, tp[i].handler, int3);
>> +
>> + on_each_cpu(do_sync_core, NULL, 1);
>> +
>> + for (i = 0; i < nr_entries; i++) {
>> + if (tp->len - sizeof(int3) > 0) {
> Should this be:
>
> if (tp[i].len - sizeof(int3) > 0) {
>
> ?

Ops! Missed that... you are right.

Fixing in the v3.

Thanks!

-- Daniel