Re: [PATCH] Add a text_poke syscall

From: Andi Kleen
Date: Tue Nov 19 2013 - 15:16:38 EST


> > + pages[1] = NULL;
> > + npages = ((unsigned long)addr & PAGE_MASK) ==
> > + (((unsigned long)addr + len) & PAGE_MASK) ? 1 : 2;
>
> This is off by one, I think. That should be addr + len - 1.

Thanks fixed.

>
> > + err = get_user_pages_fast((unsigned long)addr, npages, 1, pages);
> > + if (err < 0)
> > + return err;
> > + err = 0;
> > + mutex_lock(&text_mutex);
> > + bp_target_mm = current->mm;
> > + bp_int3_addr = (u8 *)addr + 1;
>
> Do you need an smp_wmb here? (Maybe there's a strong enough barrier in
> __text_poke_bp.)

__text_poke_bp already has enough barriers (although I don't
think they are really needed in any case)

-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/