Re: [PATCH] Mutilated form of Andi Kleen's AMD prefetch errata patch

Andi Kleen
2003-10-01T08:01:03Z

On Wed, Oct 01, 2003 at 08:55:51AM +0100, Jamie Lokier wrote:
> Andi Kleen wrote:
> > Jamie Lokier <jamie@shareable.org> writes:
> > > It is easy enough to fix by making the fault handler not take
> > > mmap_sem if the fault's in the kernel address range. (With apologies
> > > to the folk running kernel mode userspace...)
> >
> > It won't work because kernel can cause user space faults
> > (think get_user). And handling these must be protected.
>
> Are we mis-communicating? By "fault in the kernel address range", I

Yep, we were. I read it as "instruction faulting is in kernel range"
(aka you check the ring0 bit in the error_code), not checking cr2 >= TASK_SIZE.

-Andi