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

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



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!

> 
>   Luis


-- 
Masami Hiramatsu <mhiramat@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.