From: Andrew Cooper <Andrew.Cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/spec-ctrl: Use IST RSB protection for !SVM systems
Date: Mon, 15 Aug 2022 09:33:23 +0000 [thread overview]
Message-ID: <8ff66724-8cf2-9f1a-c8aa-2ab1d4d33247@citrix.com> (raw)
In-Reply-To: <6c8fd8b4-85ed-6599-5761-a3f6e9fdeb36@suse.com>
On 15/08/2022 09:26, Jan Beulich wrote:
> On 05.08.2022 12:38, Andrew Cooper wrote:
>> --- a/xen/arch/x86/spec_ctrl.c
>> +++ b/xen/arch/x86/spec_ctrl.c
>> @@ -1327,8 +1327,24 @@ void __init init_speculation_mitigations(void)
>> * mappings.
>> */
>> if ( opt_rsb_hvm )
>> + {
>> setup_force_cpu_cap(X86_FEATURE_SC_RSB_HVM);
>>
>> + /*
>> + * For SVM, Xen's RSB safety actions are performed before STGI, so
>> + * behave atomically with respect to IST sources.
>> + *
>> + * For VT-x, NMIs are atomic with VMExit (the NMI gets queued but not
>> + * delivered) whereas other IST sources are not atomic. Specifically,
>> + * #MC can hit ahead the RSB safety action in the vmexit path.
>> + *
>> + * Therefore, it is necessary for the IST logic to protect Xen against
>> + * possible rogue RSB speculation.
>> + */
>> + if ( !cpu_has_svm )
>> + default_spec_ctrl_flags |= SCF_ist_rsb;
> Only now, when I'm about to backport this, it occurs to me to ask: Why
> is this !cpu_has_svm rather than cpu_has_vmx?
Because it is only SVM known to be safe.
> Plus shouldn't this further
> be gated upon HVM actually being in use (i.e. in particular CONFIG_HVM=y
> in the first place)?
Perhaps, but not locally here. All of init_speculation_mitigations()
wants reconsidering if you're going down that route.
~Andrew
next prev parent reply other threads:[~2022-08-15 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-05 10:38 [PATCH] x86/spec-ctrl: Use IST RSB protection for !SVM systems Andrew Cooper
2022-08-05 10:49 ` Jan Beulich
2022-08-15 8:26 ` Jan Beulich
2022-08-15 9:33 ` Andrew Cooper [this message]
2022-08-15 9:41 ` Jan Beulich
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=8ff66724-8cf2-9f1a-c8aa-2ab1d4d33247@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.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.