Re: [PATCH v4 14/16] kprobes: move kprobe declarations to asm-generic/kprobes.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 29, 2016 at 11:04:18PM +0900, Masami Hiramatsu wrote:
> On Tue, 23 Aug 2016 18:31:05 +0200
> "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx> wrote:
> 
> > On Tue, Aug 23, 2016 at 12:11:40AM +0900, Masami Hiramatsu wrote:
> > > On Fri, 19 Aug 2016 14:34:12 -0700
> > > mcgrof@xxxxxxxxxx wrote:
> > > 
> > > > From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx>
> > > > 
> > > > Often all is needed is these small helpers, instead of compiler.h
> > > > or a full kprobes.h. This is important for asm helpers, in fact even
> > > > some asm/kprobes.h make use of these helpers... instead just keep a
> > > > generic asm file with helpers useful for asm code with the least amount
> > > > of clutter as possible.
> > > > 
> > > > Likewise we need now to also address what to do about this file for both
> > > > when architectures have CONFIG_HAVE_KPROBES, and when they do not. Then
> > > > for when architectures have CONFIG_HAVE_KPROBES but have disabled
> > > > CONFIG_KPROBES.
> > > > 
> > > > Right now most asm/kprobes.h do not have guards against CONFIG_KPROBES,
> > > > this means most architecture code cannot include asm/kprobes.h safely.
> > > > Correct this and add guards for architectures missing them. Additionally
> > > > provide architectures that not have kprobes support with the default
> > > > asm-generic solution. This lets us force asm/kprobes.h on the header
> > > > include/linux/kprobes.h always, but most importantly we can now safely
> > > > include just asm/kprobes.h on architecture code without bringing
> > > > the full kitchen sink of header files.
> > > > 
> > > > Two architectures already provided a guard against CONFIG_KPROBES on
> > > > its kprobes.h: sh, arch. The rest of the architectures needed gaurds
> > > > added. We avoid including any not-needed headers on asm/kprobes.h
> > > > unless kprobes have been enabled.
> > > > 
> > > > In a subsequent atomic change we can try now to remove compiler.h from
> > > > include/linux/kprobes.h.
> > > 
> > > Hmm, this looks a bit overkill... I rather like move it into linux/table.h.
> > 
> > That's the thing, we can't reasonably expect every table to add an entry into
> > table.h, this should be up to each user. Moving it to tables.h just prolongs
> > what needs to be done. In this case the change is justifiable given kprobe
> > annotations are required for some architectures early in architecture code, and
> > including compiler.h on early architecture code blows up. There is no easy fix
> > to this, and this this was *actually* the cleanest solution I could devise
> > without much changes.
> 
> Aah, I misread your patch, it is asm-generic/kprobes.h, not asm/kprobes.h.
> I think it is OK now.
> 
> Acked-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>

Thanks! Can you also review: patch 15:

kprobes: port .kprobes.text to section range

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux