This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Re: Xen's use of PAT and PV guests

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel] Re: Xen's use of PAT and PV guests
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 30 Mar 2010 10:39:55 -0700
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Tue, 30 Mar 2010 10:41:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BB1C8050200007800037BCE@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4BB1476D.4060209@xxxxxxxx> <4BB1C8050200007800037BCE@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3
On 03/30/2010 12:44 AM, Jan Beulich wrote:
Jeremy Fitzhardinge<jeremy@xxxxxxxx>  30.03.10 02:35>>>
It therefore seems to me that if I make Linux:

   1. never set the PAT flag (which it won't anyway),
   2. check that the value written to IA32_PAT is as expected, but
      otherwise ignore it, and
   3. use WT rather than WC

then it all should just work.  I'm not completely confident in the third
point though, since I'm not quite sure about the full set of differences
between WT and WC, and their respective interactions with the MTRR, and
whether that would break anything.  At first glance it seems pretty safe
No. For one, while WT is cachable (for reads), WC isn't.

Second, when the MTRRs indicate WC, using WT from PAT is not
recommended (and was earlier documented as undefined behavior).

Yes, I noticed that, and I wondered if that was why Linux is using WC, for max compatibility. But presumably since it is now defined unconditionally, it means that all older (Intel, at least) implementations have that defined behaviour.

Third, performance would likely suffer (MTRR-{WC,UC} + PAT-WT ->  UC
whereas MTRR-{WC,UC} + PAT-WC ->  WC).

Yeah.  If !pat_enabled, Linux will map a WC pte into UC-.

Plus all of this would need revisiting once Linux decides to use WT
or WP.


Ah, I think I know how to do it now: when constructing a PTE, remap Linux's PWT to Xen's PAT to end up with a WC PTE.

Does Xen guarantee that PAT is always available to vcpus as part of its ABI (ie, do we support any pre-PAT cpus?).

Also, I'm assuming Xen's PAT entries 6 and 7 are reserved, in case Intel defines 2 and 3?


Xen-devel mailing list