Re: meaning of vmalloc shortcut comment in fault.c

Brian Gerst (bgerst@didntduck.org)
Tue, 05 Jun 2001 11:11:06 -0400


Bjorn Wesen wrote:
>
> Can someone elaborate on why it's bad to refer to tsk directly below (this
> is a 2.4.5 change in x86) and why it's needed on x86 and not other archs..
>
> What should I do for an arch that does not have a "cr3" machine register
> to check with ?

%cr3 is the page table pointer on the x86. Changing the page table
pointer and changing the stack pointer (from which tsk is derived) is
not done atomically during a task switch. If an interrupt happens in
between and causes a page fault on a vmalloced area, using tsk may refer
to the wrong page tables. %cr3 by definition always has the current
page table pointer.

--

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