[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <53F72A46020000780002C957@mail.emea.novell.com>
Date: Fri, 22 Aug 2014 10:32:22 +0100
From: "Jan Beulich" <JBeulich@...e.com>
To: "Juergen Gross" <JGross@...e.com>
Cc: <stefan.bader@...onical.com>, <toshi.kani@...com>,
<x86@...nel.org>, <ville.syrjala@...ux.intel.com>,
"xen-devel" <xen-devel@...ts.xenproject.org>,
<konrad.wilk@...cle.com>, <linux-kernel@...r.kernel.org>,
<hpa@...or.com>
Subject: Re: [Xen-devel] [PATCH RFC 2/3] x86: Enable PAT to use cache
mode translation tables
>>> On 19.08.14 at 15:25, <JGross@...e.com> wrote:
> @@ -118,8 +167,14 @@ void pat_init(void)
> PAT(4, WB) | PAT(5, WC) | PAT(6, UC_MINUS) | PAT(7, UC);
>
> /* Boot CPU check */
> - if (!boot_pat_state)
> + if (!boot_pat_state) {
> rdmsrl(MSR_IA32_CR_PAT, boot_pat_state);
> + /*
> + * Init cache mode tables before writing MSR to give Xen a
> + * chance to correct the changes when doing the write.
> + */
This comment seems pretty odd to me: For one, a PV guest on Xen
shouldn't be trying to write PAT MSR at all under the current ABI
(the write will be ignored, yes, but accompanied with a warning
message, which PV kernels - by the mere fact that they're PV -
should try to avoid). And then "correct the changes" both gives
the impression as if they were wrong and as if some of what the
kernel writes may be under the kernel's control. Hence I think this
code and comment should either be consistently assuming that the
kernel has no control at all, or should read back the value after
having written it, and set the internal tables based on the value
read back.
Jan
> + pat_init_cache_modes(pat);
> + }
>
> wrmsrl(MSR_IA32_CR_PAT, pat);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists