Re: [GIT PULL] core kernel fixes

From: Ingo Molnar
Date: Fri Jul 10 2009 - 16:03:25 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, 10 Jul 2009, Ingo Molnar wrote:
> > >
> > > but I really migth have done soemthing wrong there. It's a
> > > simple function, but somebody needs to double-check that I
> > > haven't made it worse.
> >
> > Looks correct to me.
>
> Note, I didn't look at how 'end' works, and it really does matter
> if 'end' is an "inclusive" or "exclusive" end pointer address. So
> my replacement overlap() function was written more as a conceptual
> patch - I did not check the exact semantics of the arguments
> passed in.
>
> If 'end' is exclusive, then 'b1' should be calculated as
> 'a1+size-1', because the ranges must have the same rules. And then
> you should use the 'strict inequality' operators for testing the
> ranges.

The ranges are inclusive in terms of non-overlap: we can have
adjacent ranges with b1==a2 or b2==a1 that are still considered
non-overlapping. Hence the sharp test you used (which is negated)
looks correct to me.

The end-of-range symbols we use:

if (overlap(addr, len, _text, _etext) ||
overlap(addr, len, __start_rodata, __end_rodata))

Are all at the first byte outside of the to-be-avoided range:

.text : {
_text = .; /* Text */
*(.text)
*(.text.*)
_etext = . ;
}

...

__param : AT(ADDR(__param) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___param) = .; \
*(__param) \
VMLINUX_SYMBOL(__stop___param) = .; \
. = ALIGN((align)); \
VMLINUX_SYMBOL(__end_rodata) = .; \
} \

...

I think ...

Ingo
--
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/