[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAB=NE6WtZtyy3xhG170id3pVGfVpgWdYhODxEi+gYRNor-GSzw@mail.gmail.com>
Date: Tue, 23 Feb 2016 15:36:21 -0800
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...capital.net>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Rusty Russell <rusty@...tcorp.com.au>,
David Vrabel <david.vrabel@...rix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Michael Brown <mcb30@...e.org>,
Juergen Gross <jgross@...e.com>,
Ming Lei <ming.lei@...onical.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>, linux-arch@...r.kernel.org,
Russell King <linux@....linux.org.uk>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
jbaron@...mai.com, ananth@...ibm.com,
anil.s.keshavamurthy@...el.com, David Miller <davem@...emloft.net>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
andriy.shevchenko@...ux.intel.com,
David Woodhouse <dwmw2@...radead.org>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
linux-security-module <linux-security-module@...r.kernel.org>
Subject: Re: [RFC v2 2/7] tables.h: add linker table support
On Tue, Feb 23, 2016 at 3:22 PM, H. Peter Anvin <hpa@...or.com> wrote:
> On 02/23/2016 03:08 PM, Luis R. Rodriguez wrote:
>>
>> OK yes I see the issue now. I've modified this to use const, and
>> retested the kprobe patch and it works well still. kprobe would not
>> use LINKTABLE_TEXT, instead it uses its own macro, however users of
>> LINKTABLE_TEXT would then have const declared. The implications are
>> that you *can* declare structs so long as everything is const.
>>
>
> No, such structures belong in .rodata not in .text.
>
> I have been thinking about it somewhat, and for text we really have text
> "ranges" rather than tables. The big difference between the two are:
>
> 1. priority ordering doesn't make any sense for ranges.
I considered the possibility perhaps we want to just split out a
series of initial basic macros that enables *only* such basic
functionality and declarations, and linker tables would then build on
top of these. I think that ma help here.
> 2. ranges can be hierarchial, that is, range "bar" can be entirely
> inside range "foo".
We'd want to enable this without having to modify the linker script
further -- I thought about how such things might be possible but not
for this case but rather, for the case where in linker tables a
developer may wish to get range addresses for a specific order level.
Although separate, the problem seems similar. At least in theory I was
convinced I had a solution to the order level problem, perhaps it may
suffice for this too:
When and if you need an intermediary set of range addresses you then
also declare another set of extern pointers, similar in nature with
the empty string and ~ ending delimiter, we just move one notch in.
SORT() will take care of ordering things for us, but the issue here is
the empty string doesn't allow hierarchies so perhaps to enable that
we may need another beginning delimiter that would enable recursive
hierarchies. If this seems to at least in theory make sense I can give
it a shot through a simple proof of concept and see if it works.
> 3. ranges aren't typed (although in C, that pretty much means they are
> "char" or "unsigned char" as there really isn't any way to define an
> "array of void".)
Sure. kprobe is a good example.
> 4. the only useful operator on a range is "is address X inside this
> range"; this operator is likely *not* useful for a table, since
> if you have to ever invoke it you are probably doing something very
> wrong.
kprobe uses it :P
> For this to work, we need strings such that they will always sort in the
> appropriate order with the bracket symbols around subranges. I need to
> think about this a few minutes before I actually say anything about it...
Ah seems we're in the same line of thought ?
Luis
Powered by blists - more mailing lists