From: Keir Fraser Subject: Re: Re: [PATCH 06/16] xen: disable PAT Date: Sat, 09 May 2009 09:04:08 +0100 Message-ID: References: <20090508155031.4403f7e0@lxorguk.ukuu.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090508155031.4403f7e0@lxorguk.ukuu.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Alan Cox , Ian Campbell Cc: Jeremy Fitzhardinge , Jeremy Fitzhardinge , "H. Peter Anvin" , Suresh Siddha , Linux, the arch/x86 maintainers , Kernel Mailing List , Xen-devel , "Pallipadi, Venkatesh" , Ingo Molnar , Lu , Thomas Gleixner , Arjan van de Ven List-Id: xen-devel@lists.xenproject.org On 08/05/2009 15:50, "Alan Cox" wrote: >> Roughly speaking the kernel needs to cope with different values written >> to MSR_IA32_CR_PAT than the single hard coded value it would write >> itself if given the chance. Essentially _PAGE_CACHE_* need to become >> dynamic (or I guess we could change the native layout to match Xen's, I >> don't know why native differs from the initial state, I guess just to >> avoid using the PAT bit for some reason. > > Because it is required for some processor variants due to errata. This is > also why the BIOS has them programmed as a mirror between 0-3 and 4-7. > > I don't think changing Linux here is the right thing to do - if anything > Xen probably needs to change. My suggestion is that Xen changes its PAT[1] from WT to WC. AFAIK only suse's Linux port is currently using Xen's PAT support, and it does not actually use the WT cache attribute. Then Xen's PAT[0-3] would match what Linux expects, and Linux apparently does not risk using PAT[4-7] because of processor errata so their values are irrelevant. Linux can check that it is running on Xen with suitable PAT setup by reading MSR_IA32_CR_PAT and checking PAT[0-3], and only enable PAT usage in case of a match. -- Keir