From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754214AbZEIIO0 (ORCPT ); Sat, 9 May 2009 04:14:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753663AbZEIIOA (ORCPT ); Sat, 9 May 2009 04:14:00 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:13110 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753554AbZEIIN4 (ORCPT ); Sat, 9 May 2009 04:13:56 -0400 X-Greylist: delayed 584 seconds by postgrey-1.27 at vger.kernel.org; Sat, 09 May 2009 04:13:56 EDT X-IronPort-AV: E=Sophos;i="4.40,320,1238976000"; d="scan'208";a="5182777" User-Agent: Microsoft-Entourage/12.17.0.090302 Date: Sat, 09 May 2009 09:04:08 +0100 Subject: Re: [Xen-devel] Re: [PATCH 06/16] xen: disable PAT From: Keir Fraser To: Alan Cox , Ian Campbell CC: Jeremy Fitzhardinge , the arch/x86 maintainers , Suresh Siddha , , "Pallipadi, Venkatesh" , Kernel Mailing List , Jeremy Fitzhardinge , Xen-devel , Jan Beulich , "H. Peter Anvin" , Ingo Molnar , Lu , Thomas Gleixner , Arjan van de Ven Message-ID: Thread-Topic: [Xen-devel] Re: [PATCH 06/16] xen: disable PAT Thread-Index: AcnQbmzcsN7BkIN8SpipbDH09qFsgAADk2gS In-Reply-To: <20090508155031.4403f7e0@lxorguk.ukuu.org.uk> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-OriginalArrivalTime: 09 May 2009 08:04:11.0653 (UTC) FILETIME=[BCA9B350:01C9D07C] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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