Re: [git pull] core, x86: make LIST_POISON less deadly

From: Linus Torvalds
Date: Mon Jul 14 2008 - 12:00:25 EST




On Mon, 14 Jul 2008, Ingo Molnar wrote:
> >
> > Why not use something sane like 0xdead000000000000, which has the high
> > bit set but very fundamentally isn't a valid pointer, and never will
> > be? And which is a *lot* more visually obvious too!
>
> initially i suggested that too - but such addresses raise a #GP instead
> of a page fault so their decoding is a bit harder.

But raising a GP is exactly what you want: a PF is an indication that the
address was actually half-way valid, and will not fault at all on some
(possibly future) machine.

> We dont do any instruction decoding in #GP handlers to figure out what
> happened, while in the pagefault case we know which address faulted,
> etc.

Why would we care? It would be very obvious from the instruction
disassembly plus the register contents. No need to decode instructions.

> Perhaps we could try to make #GP handlers a bit more informative -
> although decoding instructions will make things a bit more fragile
> inevitably.
>
> Perhaps make it 0xffffcdead0000000 ?

I'm really not seeing the reason for not just doing it right.

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