Terence Ripperda <tripperda@nvidia.com> writes:
> Hello all,
>
> I've discussed adding Page Attribute Table (PAT) support to the kernel w/ a few developers offline. They were very supportive and suggested I bring the discussion to lkml so others could get involved.
change_page_attr() will already do it for the kernel mappings. Just
define a PAGE_KERNEL_WC. Drawback is that it will convert the mapping
to 4K pages (from 2/4MB), but there is probably no alternative unless
all your mappings are 2MB aligned.
But the tricky part of it is that you need to make sure all mappings
to that memory have the same caching attribute, otherwise you invoke
undefined x86 behaviour and risk cache corruptions on some CPUs.
For the special case of AGP it's quite simple - when an user process maps
the aperture it can just set the correct bits in its own mmap method
like it already does for uncachable mappings. But for other mappings
it is more difficult.
For normal memory you would need to find a way to synchronize the
attributes in all mappers (e.g. setting a flag in struct page or
similar). For frame buffer you also need to handle it in all mmap'ers
(like fbcon or /dev/mem). I think handling these generic cases will
need a few VM changes.
[actually even the agp aperture can be accessed using /dev/mem,
but thats probably unlikely to happen because there is a better interface
and could be ignored]
-Andi
-
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/
This archive was generated by hypermail 2b29 : Fri May 23 2003 - 22:00:41 EST