Re: [PATCH v2 6/6] x86/pat: Document PAT initializations

From: Toshi Kani
Date: Tue Mar 22 2016 - 17:23:22 EST


On Tue, 2016-03-22 at 18:02 +0100, Borislav Petkov wrote:
> On Wed, Mar 16, 2016 at 06:46:59PM -0600, Toshi Kani wrote:
> > Update PAT documentation to describe how PAT is initialized under
> > various configurations.
> >
Â:
> > Â
> > +PAT Initialization
> > +------------------
> > +
> > +The following table describes how PAT is initialized under various
> > +configurations. PAT must be set to enable to initialize PAT MSR in
> > order
>
> Err "PAT MSR must be updated by Linux in order to support WC and WT" ...
> or so?

Right. Will do.

> > +to support WC and WT attributes. Otherwise, PAT keeps PAT MSR value
> > set
> > +by BIOS.
>
> "Otherwise, the PAT MSR has the value programmed in it by the firmware."

Will do.

> > Note, Xen enables WC attribute in BIOS setup for guests.
> > +
> > + MTRR PATÂÂÂCall SequenceÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂPAT StateÂÂPAT MSR
> > + =========================================================
> > + EÂÂÂÂEÂÂÂÂÂMTRR -> pat_init()ÂÂÂÂÂÂÂÂÂÂEnableÂÂÂÂÂOS
>
> s/Enable/Enabled/

Will do.

> MTRR->pat_init() - either use function names for both or do pseudo like
> so:
>
> MTRR init -> PAT init

OK, I will change all to pseudo. ÂMTRR has multiple caller functions, and
we do not have enough space to write them all.

> > + EÂÂÂÂDÂÂÂÂÂMTRR -> pat_init()ÂÂÂÂÂÂÂÂÂÂDisableÂÂÂÂ-
>
> s/Disable/Disabled/. Ditto for the rest.

Will do.

> > + DÂÂÂÂEÂÂÂÂÂMTRR -> pat_disable()ÂÂÂÂÂÂÂDisableÂÂÂÂBIOS
> > + DÂÂÂÂDÂÂÂÂÂMTRR -> pat_disable()ÂÂÂÂÂÂÂDisableÂÂÂÂ-
> > + -ÂÂÂÂnp/EÂÂnopat() -> pat_disable()ÂÂÂÂDisableÂÂÂÂBIOS
> > + -ÂÂÂÂnp/DÂÂnopat() -> pat_disable()ÂÂÂÂDisableÂÂÂÂ-
> > + EÂÂÂÂ!P/EÂÂMTRR -> pat_init()ÂÂÂÂÂÂÂÂÂÂDisableÂÂÂÂBIOS
> > + DÂÂÂÂ!P/EÂÂMTRR -> pat_disable()ÂÂÂÂÂÂÂDisableÂÂÂÂBIOS
> > + !MÂÂÂ!P/EÂÂMTRR stub -> pat_disable()ÂÂDisableÂÂÂÂBIOS
> > +
> > + Legend
> > + ------------------------------------------------
> > + EÂÂÂÂÂÂÂÂFeature enabled in CPU
> > + D ÂÂFeature disabled/unsupported in CPU
> > + np ÂÂ"nopat" boot option specified
> > + !P ÂÂCONFIG_X86_PAT option unset
> > + !M ÂÂCONFIG_MTRR option unset
> > + EnableÂÂÂPAT state set to enable
> > + DisableÂÂPAT state set to disable
> > + OSÂÂÂÂÂÂÂPAT initializes PAT MSR with OS setup
> > + BIOSÂÂÂÂÂPAT keeps PAT MSR with BIOS setup
> > +

Thanks,
-Toshi