From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 3/3] amd/msr: implement VIRT_SPEC_CTRL for HVM guests using legacy SSBD
Date: Mon, 28 Mar 2022 17:32:13 +0200 [thread overview]
Message-ID: <9f68f1b9-46a4-cfae-0783-bb2edaeb7b07@suse.com> (raw)
In-Reply-To: <YkHTQ47POJe5lpwU@Air-de-Roger>
On 28.03.2022 17:24, Roger Pau Monné wrote:
> On Mon, Mar 28, 2022 at 04:21:02PM +0200, Jan Beulich wrote:
>> On 15.03.2022 15:18, Roger Pau Monne wrote:
>>> @@ -677,14 +680,17 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
>>> if ( !cp->extd.virt_ssbd )
>>> goto gp_fault;
>>>
>>> - /*
>>> - * Only supports SSBD bit, the rest are ignored. Only modify the SSBD
>>> - * bit in case other bits are set.
>>> - */
>>> - if ( val & SPEC_CTRL_SSBD )
>>> - msrs->spec_ctrl.raw |= SPEC_CTRL_SSBD;
>>> + /* Only supports SSBD bit, the rest are ignored. */
>>> + if ( cpu_has_amd_ssbd )
>>> + {
>>> + /* Only modify the SSBD bit in case other bits are set. */
>>
>> While more a comment on the earlier patch introducing this wording, it
>> occurred to me only here that this is ambiguous: It can also be read as
>> "Only modify the SSBD bit as long as other bits are set."
>
> Hm, no, that's not what I meant. I meant to note that here we are
> careful to only modify the SSBD bit of spec_ctrl, because other bits
> might be used for other purposes.
Right, I understand that's what you mean, and because I understand
the ambiguity also slipped my attention in the earlier patch.
> We can't do:
>
> msrs->spec_ctrl.raw = SPEC_CTRL_SSBD;
>
> But maybe this doesn't require a comment, as it seems to raise more
> questions than answer?
I wouldn't mind if (in the earlier patch) you simply dropped the 2nd
sentence. Or alternatively how about "Also only record the SSBD bit
to return for future reads" or something along these lines?
Jan
prev parent reply other threads:[~2022-03-28 15:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 14:18 [PATCH v2 0/3] amd/msr: implement MSR_VIRT_SPEC_CTRL for HVM guests Roger Pau Monne
2022-03-15 14:18 ` [PATCH v2 1/3] amd/msr: implement VIRT_SPEC_CTRL for HVM guests on top of SPEC_CTRL Roger Pau Monne
2022-03-28 13:40 ` Jan Beulich
2022-03-15 14:18 ` [PATCH v2 2/3] amd/msr: allow passthrough of VIRT_SPEC_CTRL for HVM guests Roger Pau Monne
2022-03-28 14:02 ` Jan Beulich
2022-03-28 15:19 ` Roger Pau Monné
2022-03-28 15:26 ` Jan Beulich
2022-03-15 14:18 ` [PATCH v2 3/3] amd/msr: implement VIRT_SPEC_CTRL for HVM guests using legacy SSBD Roger Pau Monne
2022-03-28 14:21 ` Jan Beulich
2022-03-28 15:24 ` Roger Pau Monné
2022-03-28 15:32 ` Jan Beulich [this message]
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=9f68f1b9-46a4-cfae-0783-bb2edaeb7b07@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=roger.pau@citrix.com \
--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.