All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jan Beulich <JBeulich@novell.com>
Cc: Xen-devel <xen-devel@lists.xensource.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: Xen's use of PAT and PV guests
Date: Tue, 30 Mar 2010 10:39:55 -0700	[thread overview]
Message-ID: <4BB2376B.7020400@goop.org> (raw)
In-Reply-To: <4BB1C8050200007800037BCE@vpn.id2.novell.com>

On 03/30/2010 12:44 AM, Jan Beulich wrote:
>>>> Jeremy Fitzhardinge<jeremy@goop.org>  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
>> though...
>>      
> 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.
>    

Yes.

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?

     J

  reply	other threads:[~2010-03-30 17:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  0:35 Xen's use of PAT and PV guests Jeremy Fitzhardinge
2010-03-30  7:44 ` Jan Beulich
2010-03-30 17:39   ` Jeremy Fitzhardinge [this message]
2010-03-30 17:59     ` Keir Fraser
2010-03-30 18:25       ` Jeremy Fitzhardinge
2010-03-30 16:57 ` Konrad Rzeszutek Wilk
2010-03-30 18:43   ` Jeremy Fitzhardinge
2010-03-31  8:26     ` Jan Beulich
2010-03-30 17:56 ` Ian Campbell
2010-03-30 21:47   ` Jeremy Fitzhardinge
2010-03-31  8:31     ` Ian Campbell
2010-03-31 16:55       ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BB2376B.7020400@goop.org \
    --to=jeremy@goop.org \
    --cc=JBeulich@novell.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.