Re: chasing the four level page table

From: H. Peter Anvin
Date: Fri Jan 14 2005 - 21:56:50 EST


Followup to: <9e47339105010721225c0cfb32@xxxxxxxxxxxxxx>
By author: Jon Smirl <jonsmirl@xxxxxxxxx>
In newsgroup: linux.dev.kernel
>
> On Thu, 6 Jan 2005 16:41:59 -0500, Dave Jones <davej@xxxxxxxxxx> wrote:
> > No other device driver is also doing such lowlevel stuff with
> > page tables directly afaics. drivers/char/drm seem to be the only drivers
> > using [pgd|pmd|pte]_offset() routines.
>
> On 6 Jan 2005 20:38:27 +0100, Andi Kleen <ak@xxxxxx> wrote:
> > Perhaps we should add a get_user_phys() or somesuch for this.
>
> I think this is a case where the memory manager is missing a function
> that DRM needs. If there was a get_user_phys() function DRM wouldn't
> need to walk the page tables.
>

FWIW, the Nvidia device driver wrapper also has this issue.

There seems to be at least two classes of device drivers -- graphics
and RDMA -- which have a genuine need to DMA user pages, after
appropriate locking, of course.

At that point we're better off having the mm export the right
functionality to keep device driver authors from doing it wrong.

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