Re: EFAULT reading /dev/mem... - broken x86info

From: Manfred Spraul
Date: Mon Nov 10 2003 - 12:19:22 EST


Dave Jones wrote:

On Mon, Nov 10, 2003 at 05:50:25PM +0100, Manfred Spraul wrote:
> It breaks either your app or your AGP driver - what's simpler to fix? > I'm biased, because if you update the AGP driver, then I must figure out > how to fix DEBUG_PAGEALLOC 8-)

I'm not convinced changing agpgart is worth the pain.
The only userspace app that actually grovels through the aperture
in this way is the agpgart test code, so this shouldn't be an issue.


You misunderstood my objection:
we cannot assume that every page is mapped in the kernel linear mapping:
- with DEBUG_PAGEALLOC, lots of pages are removed from the linear mapping
- even without it, all pages that are used for AGP are removed from the mapping.

Thus if something fails with DEBUG_PAGEALLOC, it will fail sometimes with AGP gart as well.

I thought the DEBUG_PAGEALLOC stuff just unmapped pages that had been
kmalloc'd ? The area of memory we're trying to read those mptables from
shouldn't be unmapped in the first place should they ? Confused.


DEBUG_PAGEALLOC unmaps pages on kmem_cache_free and __free_pages(). The pages are mapped again during get_free_pages and kmem_cache_alloc.

0x86000 looks like a normal page - what guarantees that it's not used by the kernel?

--
Manfred

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