Support for i386 PATs
Hi!
Does anybody have a strong opinion against adding support for i386 Page Attribute Tables?
The main benefit would be that one can have write-combining memory regions without setting up MTRRs. This will come in handy for a device we're working with where the device driver needs to allocate the display memory directly from system memory, and it may be difficult to fit the mtrr alignment constraints.
Outline:
The PAT may be set up at boot time with fixed backwards-compatible memory types for the different PAT entries + defines like the following:
#define _PAGE_PAT_WB xxx
#define _PAGE_PAT_WT xxx
#define _PAGE_PAT_UC0 xxx
#define _PAGE_PAT_UC1 xxx
#define _PAGE_PAT_WC xxx
which can be used in parallel with the old _PAGE_PWT and _PAGE_PCD bits.
The idea is that new memory types, WC for example, will use the pat entries 7 downto 4, whereas 0-3 are left to boot setting to maintain backwards compatibility.
Issues:
1) The _PAGE_BIT_PAT will be the same as _PAGE_PSE, and _PAGE_PROTNONE.
As I understand it, _PAGE_PROTNONE is not used when the page is present, so this might not be an issue. What about _PAGE_PSE?
2) The PATs need to be setup for each processor just after system boot. Where is the best place to do this?
/Thomas Hellström
Quoted 10 lines · Thomas Hellström
Hi!
Does anybody have a strong opinion against adding support for i386 Page Attribute Tables?
The main benefit would be that one can have write-combining memory regions without setting up MTRRs. This will come in handy for a device we're working with where the device driver needs to allocate the display memory directly from system memory, and it may be difficult to fit the mtrr alignment constraints.
An additional benefit if that you can easily run out of mtrrs. My home machine boots with all 8 mtrrs used, leaving none for the G965 graphics. I have to compress two mtrrs into one in order to get decent performance.
Quoted 13 lines
Outline:
The PAT may be set up at boot time with fixed backwards-compatible memory types for the different PAT entries + defines like the following:#define
_PAGE_PAT_WBxxx
#define_PAGE_PAT_WTxxx
#define_PAGE_PAT_UC0xxx
#define_PAGE_PAT_UC1xxx
#define_PAGE_PAT_WCxxxwhich can be used in parallel with the old
_PAGE_PWTand_PAGE_PCDbits.
Quoted 7 lines
The idea is that new memory types, WC for example, will use the pat entries 7 downto 4, whereas 0-3 are left to boot setting to maintain backwards compatibility.
Issues:
1) The_PAGE_BIT_PATwill be the same as_PAGE_PSE, and_PAGE_PROTNONE.
As I understand it,_PAGE_PROTNONEis not used when the page is present, so this might not be an issue. What about_PAGE_PSE?
pse pages place the pat bit in bit 12, you will need to account for that.
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 4 lines · Thomas Hellström
Hi!
Does anybody have a strong opinion against adding support for i386 Page Attribute Tables?
It pops up about once a year, everyone agrees it'd be a good idea, and then nothing happens. Last year, I started picking over Terrence Ripperda's original implementation, but that needs a bit of work. (http://lkml.org/lkml/2005/5/12/187)
Whoa, two years even. Time flies.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 6 lines · Dave Jones
Quoted 4 lines · Thomas Hellström
Hi!
Does anybody have a strong opinion against adding support for i386 Page Attribute Tables?
Quoted 9 lines
It pops up about once a year, everyone agrees it'd be a good idea, and then nothing happens. Last year, I started picking over Terrence Ripperda's original implementation, but that needs a bit of work. (http://lkml.org/lkml/2005/5/12/187)
Whoa, two years even. Time flies.Dave
Ah.
This might explain why nothing happens :).
I had something much simpler in mind.
Just the basic PAT setup and some new pgprot_ types which affected drivers could use directly.
Like in(drivers/char/drm/drm_vm.c) where ia64 has a pgprot_writecombine() function.
/Thomas