I've added support for the Page Attribute Table (PAT) in x86 CPUs. This is necessary to be able to configure Write Combining for the frame buffer display required by UEFI boot. It is simpler to add this, which is the contemporary method anyway, rather than implement MTRR.
The PAT interface can be called even if the processor does not support PAT although the caller should cater for unsupported memory caching types. Some caching types (eg. Uncached) are guaranteed to be supported with or without PAT. I've added a 'pt_mem_type_t' type to the pmap interface which is used to indicate the memory caching required when mapping non-main RAM, for example. In the x86 case, it is meant to be 'ORd' with the remainder of a pt_entry_t within the relevant pmap code. I didn't want to add anything that was absolutely x86 specific in non-arch code and hoped that the 'pt_mem_type_t' asbstraction would be sufficient for other architectures to redefine as required. I've tested this with my forthcoming patches to kd.c and the submitted immc.c frame buffer usages. I've not yet been able to setup a working Xen hypervisor. My attempts to boot a gnumach-xen result in almost immediate termination suggesting either a kernel crash or else my configuration is faulty. I also tried a kernel from about a year ago but with the same result suggesting it is my setup rather than gnumach. Can it be confirmed that gnumach-xen is currently working ? >From what I've read, a Xen guest cannot alter the PAT MSR, or at least this is true for some kinds of guest. The MSR can only be read and the pre-configured memory cache types used as is. The code in this RFC is implemented with this restriction for all MACH_XEN builds but I've been unable to test this yet which is why I've sent this patch as an RFC. I've not yet thought how to provide a user land interface that enables mapping memory with Write Combining. Regards, Mike.
