From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>, "Solène Rapenne" <solene@openbsd.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests
Date: Thu, 14 Sep 2023 14:37:59 +0200 [thread overview]
Message-ID: <ZQL-p3LJX7WfwCtC@MacBook-MacBook-Pro-de-Roger.local> (raw)
In-Reply-To: <e2fe16de-cb08-4a0b-adfe-95da6c86ea16@suse.com>
On Thu, Sep 14, 2023 at 07:52:33AM +0200, Jan Beulich wrote:
> On 13.09.2023 16:52, Roger Pau Monne wrote:
> > OpenBSD 7.3 will unconditionally access HWCR if the TSC is reported as
> > Invariant, and it will then attempt to also unconditionally access PSTATE0 if
> > HWCR.TscFreqSel is set (currently the case on Xen).
> >
> > The relation between HWCR.TscFreqSel and PSTATE0 is not clearly written down in
> > the PPR, but it's natural for OSes to attempt to fetch the P0 frequency if the
> > TSC increments at the P0 frequency.
> >
> > Exposing PSTATEn (PSTATE0 at least) with all zeroes is not a suitable solution
> > because the PstateEn bit is read-write, and OSes could legitimately attempt to
> > set PstateEn=1 which Xen couldn't handle.
> >
> > In order to fix expose an empty HWCR, which is an architectural MSR and so must
> > be accessible.
> >
> > Note it was not safe to expose the TscFreqSel bit because it is not
> > architectural, and could change meaning between models.
>
> This imo wants (or even needs) extending to address the aspect of then
> exposing, on newer families, a r/o bit with the wrong value.
We could always be exposing bits with the wrong values on newer
(unreleased?) families, I'm not sure why it needs explicit mentioning
here.
> > Reported-by: Solène Rapenne <solene@openbsd.org>
> > Link: https://github.com/QubesOS/qubes-issues/issues/8502
> > Fixes: 14b95b3b8546 ('x86/AMD: expose HWCR.TscFreqSel to guests')
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>
> As mentioned before, with this Fixes: tag I think the description
> absolutely needs to mention the (changed) view on the Linux log message
> that had triggered the original change. It certainly helps here that
> Thomas has already signaled agreement to a Linux side change.
Sure, what about:
"The motivation for exposing HWCR.TscFreqSel was to avoid warning
messages from Linux. It has been agreed that Linux should be changed
instead to not complaint about missing HWCR.TscFreqSel when running
virtualized."
Thanks, Roger.
next prev parent reply other threads:[~2023-09-14 12:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 14:52 [PATCH v2] x86/amd: do not expose HWCR.TscFreqSel to guests Roger Pau Monne
2023-09-14 5:52 ` Jan Beulich
2023-09-14 12:37 ` Roger Pau Monné [this message]
2023-09-14 12:49 ` Jan Beulich
2023-09-14 12:57 ` Roger Pau Monné
2023-09-14 13:16 ` Jan Beulich
2023-09-14 13:39 ` Roger Pau Monné
2023-09-14 14:17 ` Jan Beulich
2023-09-14 12:53 ` Andrew Cooper
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=ZQL-p3LJX7WfwCtC@MacBook-MacBook-Pro-de-Roger.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=solene@openbsd.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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.