xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Sergey Dyasli <sergey.dyasli@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"JBeulich@suse.com" <JBeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v1] x86/msr: add Raw and Host domain policies
Date: Fri, 16 Feb 2018 16:02:57 +0000	[thread overview]
Message-ID: <c7b5c37d-b285-bc7c-ecf6-17d2797a5953@citrix.com> (raw)
In-Reply-To: <1518796830.2904.8.camel@citrix.com>

On 16/02/18 16:00, Sergey Dyasli wrote:
> On Fri, 2018-02-16 at 11:38 +0000, Andrew Cooper wrote:
>> On 16/02/18 11:31, Sergey Dyasli wrote:
>>> On Fri, 2018-02-16 at 04:06 -0700, Jan Beulich wrote:
>>>>>>> On 16.02.18 at 11:33, <sergey.dyasli@citrix.com> wrote:
>>>>> On Thu, 2018-02-15 at 06:33 -0700, Jan Beulich wrote:
>>>>>>>>> On 08.02.18 at 11:23, <sergey.dyasli@citrix.com> wrote:
>>>>>>>  	uint64_t val;
>>>>>>> +	int rc;
>>>>>>>  
>>>>>>> -	if (rdmsr_safe(MSR_INTEL_PLATFORM_INFO, val) ||
>>>>>>> +	if ((rc = rdmsr_safe(MSR_INTEL_PLATFORM_INFO, val)) == 0)
>>>>>>> +	{
>>>>>>> +		dp->plaform_info.available = true;
>>>>>>> +		if (val & MSR_PLATFORM_INFO_CPUID_FAULTING)
>>>>>>> +			dp->plaform_info.cpuid_faulting = true;
>>>>>>> +	}
>>>>>>> +
>>>>>>> +	if (rc ||
>>>>>>>  	    !(val & MSR_PLATFORM_INFO_CPUID_FAULTING) ||
>>>>>>>  	    rdmsr_safe(MSR_INTEL_MISC_FEATURES_ENABLES,
>>>>>>>  		       this_cpu(msr_misc_features)))
>>>>>> Below here we have
>>>>>>
>>>>>> 		setup_clear_cpu_cap(X86_FEATURE_CPUID_FAULTING);
>>>>>>
>>>>>> Shouldn't this be reflected in the host policy?
>>>>> I guess the correct thing to do for now for host_msr_domain_policy is:
>>>>>
>>>>>     dp->plaform_info.cpuid_faulting = cpu_has_cpuid_faulting;
>>>>>     
>>>>> Looking at the code, calculate_pv_max_policy() will be simplified with
>>>>> the above change: pv_max_msr_domain_policy will become a copy of host
>>>>> policy.
>>>>>
>>>>> This actually brings a question: what to do about per-pCPU MSRs in the
>>>>> context of MSR policy?
>>>> How does per-pCPU-ness of an MSR affect the policy? Are you
>>>> thinking of CPUs with different capabilities? We assume all CPUs
>>>> are identical in many other places.
>>> Yes, CPUs are assumed to be identical. But currently Xen checks
>>> the presence of MISC_FEATURES_ENABLES (which is a per-pCPU msr)
>>> on the boot CPU, and it affects X86_FEATURE_CPUID_FAULTING. Which
>>> in it's turn affects the presence of MISC_FEATURES_ENABLES for PV vCPUs.
>>>
>>> So the actual question is: where to store the availability of
>>> MISC_FEATURES_ENABLES (and possibly other per-pCPU msrs in the future)
>>> and is it even needed to do so?
>> Store it in one single host policy.
> And where do you propose to actually store it? Currently there are
> two distinct structures: msr_domain_policy and msr_vcpu_policy.

msr_domain_policy, like this patch does.

By and large, I expect the "read only feature style" MSRs to all be in
the domain policy, and the "read/write make stuff happen" MSRs to all be
in the vcpu policy.

We can revisit this if/when we find a counterexample.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      reply	other threads:[~2018-02-16 16:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 10:23 [PATCH v1] x86/msr: add Raw and Host domain policies Sergey Dyasli
2018-02-08 11:08 ` Andrew Cooper
2018-02-08 11:21 ` Roger Pau Monné
2018-02-08 11:29   ` Sergey Dyasli
2018-02-15 13:33 ` Jan Beulich
2018-02-16 10:33   ` Sergey Dyasli
2018-02-16 11:06     ` Jan Beulich
2018-02-16 11:31       ` Sergey Dyasli
2018-02-16 11:37         ` Jan Beulich
2018-02-16 11:38         ` Andrew Cooper
2018-02-16 16:00           ` Sergey Dyasli
2018-02-16 16:02             ` Andrew Cooper [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=c7b5c37d-b285-bc7c-ecf6-17d2797a5953@citrix.com \
    --to=andrew.cooper3@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).