From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Sergey Dyasli <sergey.dyasli@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v2 04/13] libx86: Share struct cpuid_policy with userspace
Date: Mon, 16 Jul 2018 11:16:10 +0100 [thread overview]
Message-ID: <e8fb6303-1d5d-71b9-7f74-ca53fcedca9e@citrix.com> (raw)
In-Reply-To: <5B4C6DB402000078001D4416@prv1-mh.provo.novell.com>
On 16/07/18 11:04, Jan Beulich wrote:
>>>> On 16.07.18 at 11:51, <andrew.cooper3@citrix.com> wrote:
>> On 16/07/18 10:38, Jan Beulich wrote:
>>>>>> On 13.07.18 at 22:03, <andrew.cooper3@citrix.com> wrote:
>>>> +static inline void cpuid_featureset_to_policy(
>>>> + const uint32_t fs[FEATURESET_NR_ENTRIES], struct cpuid_policy *p)
>>>> +{
>>>> + p->basic._1d = fs[FEATURESET_1d];
>>>> + p->basic._1c = fs[FEATURESET_1c];
>>>> + p->extd.e1d = fs[FEATURESET_e1d];
>>>> + p->extd.e1c = fs[FEATURESET_e1c];
>>>> + p->xstate.Da1 = fs[FEATURESET_Da1];
>>>> + p->feat._7b0 = fs[FEATURESET_7b0];
>>>> + p->feat._7c0 = fs[FEATURESET_7c0];
>>>> + p->extd.e7d = fs[FEATURESET_e7d];
>>>> + p->extd.e8b = fs[FEATURESET_e8b];
>>>> + p->feat._7d0 = fs[FEATURESET_7d0];
>>>> +}
>>> I realize this is only code movement, but since you didn't answer the
>>> question raised on the Intel Process Trace thread (v2 03/10) yet, I'll
>>> raise it here again: Shouldn't other fields of p be set to zero here?
>> No - why should it?
>>
>> (In fact, it very deliberately does not, and changing this will break
>> all of the policy derivation logic.)
> Did you look at the context in which I've raised the question originally?
Yes, but I still don't understand what prompted the question.
There is not a single use of caller cpuid_featureset_to_policy() where
zeroing the rest of the policy would be an appropriate or reasonable
thing to do.
> I did in particular ask about this effectively still being a form of black
> listing (I said "white listing" there by mistake), just taking leaf 6 (and
> Intel hardware) as example. guest_cpuid() takes whatever is there in
> the policy, and update_domain_cpuid_info() does nothing either.
See the head of recalculate_misc() which unilaterally zeroes that leaf,
irrespective of toolstack settings.
> It was my understanding that with the switch to the new model we're
> now strictly while listing features. Luwei's patch would extend the
> un-audited handing through to RDT and SGX leaves.
That is one reason why I won't ack the patch in that shape. But as I'm
currently rewriting this logic for a different reason, explaining the
correct steps to extend MAX_*_LEAF will cause unnecessary work for Luwei
as the implementation is about to change under his feet.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-07-16 10:16 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 20:03 [PATCH v2 00/13] x86: CPUID and MSR policy marshalling support Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 01/13] x86/msr: Drop stale comment for vcpu_msrs.spec_ctrl Andrew Cooper
2018-07-16 7:21 ` Jan Beulich
2018-07-16 9:37 ` Roger Pau Monné
2018-07-16 11:02 ` Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 02/13] libx86: Introduce libx86/cpuid.h Andrew Cooper
2018-07-16 9:23 ` Jan Beulich
2018-07-16 10:22 ` Andrew Cooper
2018-07-16 10:51 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 03/13] libx86: generate cpuid-autogen.h in the libx86 include dir Andrew Cooper
2018-07-16 9:31 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 04/13] libx86: Share struct cpuid_policy with userspace Andrew Cooper
2018-07-16 9:38 ` Jan Beulich
2018-07-16 9:51 ` Andrew Cooper
2018-07-16 10:04 ` Jan Beulich
2018-07-16 10:16 ` Andrew Cooper [this message]
2018-07-16 10:24 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 05/13] libx86: introduce a libx86 shared library Andrew Cooper
2018-07-16 9:02 ` Wei Liu
2018-07-16 10:17 ` Jan Beulich
2018-07-16 10:35 ` Andrew Cooper
2018-07-16 10:52 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 06/13] libx86: Introduce libx86/msr.h and share msr_policy with userspace Andrew Cooper
2018-07-16 9:41 ` Roger Pau Monné
2018-07-16 10:19 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects Andrew Cooper
2018-07-16 9:18 ` Wei Liu
2018-07-16 9:45 ` Jan Beulich
2018-07-16 10:39 ` Andrew Cooper
2018-07-16 10:55 ` Jan Beulich
2018-07-16 10:45 ` Jan Beulich
2018-07-17 10:02 ` Andrew Cooper
2018-07-17 11:58 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 08/13] libx86: Introduce a helper to serialise msr_policy objects Andrew Cooper
2018-07-16 9:24 ` Wei Liu
2018-07-16 10:47 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 09/13] libx86: Introduce a helper to deserialise cpuid_policy objects Andrew Cooper
2018-07-16 9:57 ` Wei Liu
2018-07-17 10:09 ` Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 10/13] libx86: introduce a helper to deserialise msr_policy objects Andrew Cooper
2018-07-16 10:07 ` Wei Liu
2018-07-16 11:36 ` Jan Beulich
2018-07-17 10:17 ` Andrew Cooper
2018-07-17 12:01 ` Jan Beulich
2018-07-17 16:06 ` Andrew Cooper
2018-07-17 16:23 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 11/13] x86: Introduce struct cpu_policy to refer to a group of individual policies Andrew Cooper
2018-07-16 9:55 ` Roger Pau Monné
2018-07-16 10:32 ` Wei Liu
2018-07-16 12:04 ` Jan Beulich
2018-07-16 12:16 ` Andrew Cooper
2018-07-16 12:29 ` Jan Beulich
2018-07-16 13:15 ` Andrew Cooper
2018-07-16 13:23 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 12/13] x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy Andrew Cooper
2018-07-16 10:16 ` Roger Pau Monné
2018-07-16 10:58 ` Andrew Cooper
2018-07-16 11:04 ` Jan Beulich
2018-07-16 11:54 ` Jan Beulich
2018-07-17 16:50 ` Andrew Cooper
2018-07-18 6:45 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 13/13] x86/domctl: Implement XEN_DOMCTL_get_cpu_policy Andrew Cooper
2018-07-16 10:26 ` Roger Pau Monné
2018-07-17 17:08 ` Andrew Cooper
2018-07-16 12:00 ` Jan Beulich
2018-07-30 2:14 ` Chao Gao
2018-08-17 21:22 ` Daniel De Graaf
2018-07-30 2:46 ` [PATCH v2 00/13] x86: CPUID and MSR policy marshalling support Chao Gao
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=e8fb6303-1d5d-71b9-7f74-ca53fcedca9e@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=sergey.dyasli@citrix.com \
--cc=xen-devel@lists.xen.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).