From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
"Ian Jackson" <Ian.Jackson@citrix.com>,
"Paul Durrant" <paul@xen.org>, "Wei Liu" <wl@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 7/9] x86/hvm: Disable MPX by default
Date: Wed, 17 Jun 2020 12:32:23 +0200 [thread overview]
Message-ID: <6898eb94-868c-b706-7cdd-7d54db09c1b0@suse.com> (raw)
In-Reply-To: <ee0819ab-71fe-dcc3-69c0-798ca9a2972c@citrix.com>
On 16.06.2020 18:15, Andrew Cooper wrote:
> On 16/06/2020 10:33, Jan Beulich wrote:
>> On 15.06.2020 16:15, Andrew Cooper wrote:
>>> @@ -479,6 +497,18 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
>>> goto out;
>>> }
>>>
>>> + /*
>>> + * Account for feature which have been disabled by default since Xen 4.13,
>>> + * so migrated-in VM's don't risk seeing features disappearing.
>>> + */
>>> + if ( restore )
>>> + {
>>> + if ( di.hvm )
>>> + {
>>> + p->feat.mpx = test_bit(X86_FEATURE_MPX, host_featureset);
>> Why do you derive this from the host featureset instead of the max
>> one for the guest type?
>
> Because that is how the logic worked for 4.13.
>
> Also, because we don't have easy access to the actual guest max
> featureset at this point. I could add two new sysctl subops to
> get_featureset, but the reason for not doing so before are still
> applicable now.
>
> There is a theoretical case where host MPX is visible but guest max is
> hidden, and that is down to the vmentry controls. As this doesn't exist
> in real hardware, I'm not terribly concerned about it.
I'd also see us allow features to be kept for the host, but masked
off of the/some guest feature sets, by way of a to-be-introduced
command line option.
I take your reply to mean that you agree that conceptually it
ought to be max which gets used here, but there's no practical
difference at this point.
>> Also, while you modify p here, ...
>>
>>> + }
>>> + }
>>> +
>>> if ( featureset )
>>> {
>>> uint32_t disabled_features[FEATURESET_NR_ENTRIES],
>> ... the code in this if()'s body ignores p altogether.
>
> That is correct.
>
>> I realize the
>> only caller of the function passes NULL for "featureset", but I'd
>> like to understand the rationale here anyway before giving an R-b.
>
> The meaning of 'featureset' is "here are the exact bits I want you to use".
With validation to happen only in the hypervisor then, I suppose?
If for both parts my understanding is correct:
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Jan
next prev parent reply other threads:[~2020-06-17 10:32 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 14:15 [PATCH for-4.14 0/9] XSA-320 follow for IvyBridge Andrew Cooper
2020-06-15 14:15 ` [PATCH 1/9] tools/libx[cl]: Introduce struct xc_xend_cpuid for xc_cpuid_set() Andrew Cooper
2020-06-15 14:51 ` Ian Jackson
2020-06-15 14:15 ` [PATCH 2/9] tests/cpu-policy: Confirm that CPUID serialisation is sorted Andrew Cooper
2020-06-15 14:52 ` Ian Jackson
2020-06-15 15:00 ` Andrew Cooper
2020-06-15 15:34 ` Ian Jackson
2020-06-15 16:12 ` Andrew Cooper
2020-06-16 6:51 ` Jan Beulich
2020-06-16 9:01 ` Jan Beulich
2020-06-15 14:15 ` [PATCH 3/9] tools/libx[cl]: Move processing loop down into xc_cpuid_set() Andrew Cooper
2020-06-15 14:54 ` Ian Jackson
2020-06-16 9:16 ` Jan Beulich
2020-06-16 15:58 ` Andrew Cooper
2020-06-15 14:15 ` [PATCH 4/9] tools/libx[cl]: Merge xc_cpuid_set() into xc_cpuid_apply_policy() Andrew Cooper
2020-06-15 14:55 ` Ian Jackson
2020-06-15 14:15 ` [PATCH 5/9] tools/libx[cl]: Plumb bool restore down " Andrew Cooper
2020-06-15 14:55 ` Ian Jackson
2020-06-15 14:15 ` [PATCH 6/9] x86/gen-cpuid: Distinguish default vs max in feature annotations Andrew Cooper
2020-06-15 14:15 ` [PATCH 7/9] x86/hvm: Disable MPX by default Andrew Cooper
2020-06-16 9:33 ` Jan Beulich
2020-06-16 16:15 ` Andrew Cooper
2020-06-17 10:32 ` Jan Beulich [this message]
2020-06-17 11:16 ` Andrew Cooper
2020-06-17 11:24 ` Jan Beulich
2020-06-17 11:28 ` Andrew Cooper
2020-06-17 11:41 ` Jan Beulich
2020-06-17 11:47 ` Andrew Cooper
2020-06-15 14:15 ` [PATCH 8/9] x86/cpuid: Introduce missing feature adjustment in calculate_pv_def_policy() Andrew Cooper
2020-06-16 9:40 ` Jan Beulich
2020-06-16 16:17 ` Andrew Cooper
2020-06-15 14:15 ` [PATCH 9/9] x86/spec-ctrl: Hide RDRAND by default on IvyBridge Andrew Cooper
2020-06-16 10:00 ` Jan Beulich
2020-06-16 16:26 ` Andrew Cooper
2020-06-17 10:39 ` Jan Beulich
2020-06-17 11:21 ` Andrew Cooper
2020-06-15 17:04 ` [PATCH for-4.14 0/9] XSA-320 follow for IvyBridge Paul Durrant
2020-06-17 12:46 ` Paul Durrant
2020-06-18 7:18 ` Jan Beulich
2020-06-18 9:37 ` 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=6898eb94-868c-b706-7cdd-7d54db09c1b0@suse.com \
--to=jbeulich@suse.com \
--cc=Ian.Jackson@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=paul@xen.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).