From: Juergen Gross <jgross@suse.com>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: stefan.bader@canonical.com, toshi.kani@hp.com,
linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
konrad.wilk@oracle.com, ville.syrjala@linux.intel.com,
hpa@zytor.com, x86@kernel.org
Subject: Re: [PATCH RFC 0/3] x86: Full support of PAT
Date: Wed, 20 Aug 2014 14:35:33 +0200 [thread overview]
Message-ID: <53F49615.3030101@suse.com> (raw)
In-Reply-To: <20140820130511.771aeafa@alan.etchedpixels.co.uk>
On 08/20/2014 02:05 PM, One Thousand Gnomes wrote:
>> The Linux kernel currently supports only 4 different cache modes. The PAT MSR
>> is set up in a way that the setting of _PAGE_PAT in a pte doesn't matter: the
>> top 4 entries in the PAT MSR are the same as the 4 lower entries.
>>
>> This results in the kernel not supporting e.g. write-through mode. Especially
>> this cache mode would speed up drivers of video cards which now have to use
>> uncached accesses.
>
>
> Pentium II erratum A52 (and similar on quite a few other processors)
>
> Problem: The Page Attribute Table (PAT) contains eight entries, which
> must all be initialized and considered when setting up memory types for
> the Pentium II processor. However, in Mode B or Mode C paging, the upper
> four entries do not function correctly for 4-Kbyte pages. Specifically,
> bit seven of page table entries that translate addresses to 4-Kbyte pages
> should be used as the upper bit of a three-bit index to determine the PAT
> entry that specifies the memory type for the page. When Mode B (CR4.PSE =
> 1) and/or Mode C (CR4.PAE) are enabled, the processor forces this bit to
> zero when determining the memory type regardless of the value in the page
> table entry. The upper four entries of the PAT function correctly for
> 2-Mbyte and 4-Mbyte large pages (specified by bit 12 of the page
> directory entry for those translations). Implication: Only the lower four
> PAT entries are useful for 4 KB translations when Mode B or C paging is
> used. In Mode A paging (4-Kbyte pages only), all eight entries may be
> used. All eight entries may be used for large pages in Mode B or C paging.
>
>
>
> Doing this stuff for Xen also IMHO makes no sense at all. We shouldn't
> have a kernel full of crap to deal with Xen-isms. IFF it means the
> changes can also implement a mix of four PAT entries on Pentium-M or
> earlier CPUs with PAT errata, and the full PAT on processors without
> errata then IMHO it becomes a whole world more interesting.
This is the case.
The patches as posted don't change PAT MSR settings at all. Using all 8
PAT MSR entries on processors without errata is easy while limit usage
to only 4 entries is possible as well. It is possible to make the
decision dynamically while booting the system. The only difference is
the value written to the PAT MSR, as this value is used to modify the
tables used for translating between cache modes and pte bits. If a
driver wants to set write-through mode on a processor with the PAT
erratum, the translation will result in uncached mode which is okay.
Regarding Xen: The patches don't introduce further Xen-isms. They reduce
the Xen specialties by being able to use the same translation mechanisms
on a native system as on a Xen based system. The only differences are
the values in the translation tables, as Xen is using a different PAT
configuration as native Linux (with my patches Linux could use the same
PAT configuration as Xen, of course).
Juergen
next prev parent reply other threads:[~2014-08-20 12:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 13:25 [PATCH RFC 0/3] x86: Full support of PAT jgross
2014-08-19 13:25 ` [PATCH RFC 1/3] x86: Make page cache mode a real type jgross
2014-08-20 19:26 ` Toshi Kani
2014-08-21 9:30 ` [Xen-devel] " Juergen Gross
2014-08-22 9:24 ` Jan Beulich
2014-08-22 17:43 ` Toshi Kani
2014-08-21 22:09 ` Toshi Kani
2014-08-22 5:25 ` Juergen Gross
2014-08-19 13:25 ` [PATCH RFC 2/3] x86: Enable PAT to use cache mode translation tables jgross
2014-08-22 9:32 ` Jan Beulich
[not found] ` <53F72A46020000780002C957@mail.emea.novell.com>
2014-08-25 12:22 ` Juergen Gross
2014-08-19 13:25 ` [PATCH RFC 3/3] Support Xen pv-domains using PAT jgross
2014-08-20 12:05 ` [PATCH RFC 0/3] x86: Full support of PAT One Thousand Gnomes
2014-08-20 12:21 ` Jan Beulich
2014-08-20 22:00 ` [Xen-devel] " H. Peter Anvin
2014-08-20 12:35 ` Juergen Gross [this message]
2014-08-20 21:59 ` H. Peter Anvin
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=53F49615.3030101@suse.com \
--to=jgross@suse.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=hpa@zytor.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stefan.bader@canonical.com \
--cc=toshi.kani@hp.com \
--cc=ville.syrjala@linux.intel.com \
--cc=x86@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).