Re: Calling current() from interrupt context

From: Kenn Humborg (kenn@linux.ie)
Date: Sun Oct 08 2000 - 20:09:49 EST


On Mon, Oct 09, 2000 at 02:20:27AM +0200, Andi Kleen wrote:
> On Mon, Oct 09, 2000 at 12:30:17AM +0200, Jamie Lokier wrote:
> > Kenn Humborg wrote:
> > > My feeling is that interrupt code has no business calling current(),
> > > but I don't know the kernel well enough to be sure. Is there any
> > > interrupt-level code that calls current() or is it a design
> > > principle that it cannot be called?
...
> > So if you can make the machine crash utterly when calling "current" in
> > irq context, or when dereferencing the result, that would probably be a
> > good thing :-)

Easily done. Because I don't really know how big we need to make the
stacks yet, I've put a non-accessible guard page just below the
interrupt stack. I can arrange for (SP & ~8192) to hit this page.

>
> 2.4 TCP code relies on current being valid in a softirq.
>
> The m68k port which has a interrupt stack solves the problem by
> loading current into a global register variable on all kernel entries.
> x86-64 will likely do the same.

How do you tell GCC to stay away from that register when compiling
the kernel without also making it unusable in userland?

Later,
Kenn

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:11 EST