All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: kevin.tian@intel.com, jun.nakajima@intel.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support
Date: Wed, 22 Feb 2017 15:10:14 +0000	[thread overview]
Message-ID: <19cf5c82-cba5-5842-cb46-be319e5a261c@citrix.com> (raw)
In-Reply-To: <4aa8a7a1-92fd-2e03-693f-2d1fe15c3df2@oracle.com>

On 22/02/17 15:02, Boris Ostrovsky wrote:
> On 02/22/2017 09:38 AM, Jan Beulich wrote:
>>>>> On 22.02.17 at 15:15, <boris.ostrovsky@oracle.com> wrote:
>>> On 02/22/2017 04:55 AM, Jan Beulich wrote:
>>>>>>> On 17.02.17 at 18:40, <boris.ostrovsky@oracle.com> wrote:
>>>>> --- a/xen/arch/x86/cpu/vpmu_intel.c
>>>>> +++ b/xen/arch/x86/cpu/vpmu_intel.c
>>>>> @@ -884,6 +884,10 @@ int vmx_vpmu_initialise(struct vcpu *v)
>>>>>      if ( vpmu_mode == XENPMU_MODE_OFF )
>>>>>          return 0;
>>>>>  
>>>>> +    if ( MASK_EXTR(v->domain->arch.cpuid->basic.raw[0xa].a, 
>>>>> +                   PMU_VERSION_MASK) == 0 )
>>>>> +        return -EINVAL;
>>>> How about other unsupported (too large) values?
>>> Yes, we can check here for version >=5 as well.
>>>
>>> (I don't think we should make this additional test in
>>> update_domain_cpuid_info())
>> ... because of ... ? After all it's the purpose of this patch to not
>> expose the vPMU in such cases, which imo ought to be done
>> consistently in both places.
> Because I felt that having zero as a version is an indication of
> explicit admin's desire to disable VPMU. Too high a version is more
> likely misconfiguration and can be taken care of during VPMU initialization.

I would expect the 0 case to be disabled.  5 will be a real PMU version
number sometime (probably).

I think the code as-is is ok, although it would be nice to extend the
basic{} union to have a named uint8_t for pmu_version.

~Andrew

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

  reply	other threads:[~2017-02-22 15:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 17:40 [PATCH v2 0/3] VPMU management update Boris Ostrovsky
2017-02-17 17:40 ` [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE Boris Ostrovsky
2017-02-21  8:09   ` Tian, Kevin
2017-02-21 14:09     ` Boris Ostrovsky
2017-02-22  3:05       ` Tian, Kevin
2017-02-22 14:06         ` Boris Ostrovsky
2017-02-21 11:00   ` Andrew Cooper
2017-02-21 14:12     ` Boris Ostrovsky
2017-02-17 17:40 ` [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support Boris Ostrovsky
2017-02-21  8:13   ` Tian, Kevin
2017-02-22  9:55   ` Jan Beulich
2017-02-22 14:15     ` Boris Ostrovsky
2017-02-22 14:38       ` Jan Beulich
2017-02-22 15:02         ` Boris Ostrovsky
2017-02-22 15:10           ` Andrew Cooper [this message]
2017-02-22 16:34             ` Boris Ostrovsky
2017-02-22 16:42               ` Andrew Cooper
2017-02-22 15:16           ` Jan Beulich
2017-02-17 17:40 ` [PATCH v2 3/3] libxc/x86: PV guests should see leaf 0xa on Intel Boris Ostrovsky
2017-02-20 14:15   ` Wei Liu
2017-02-20 14:16     ` Andrew Cooper
2017-02-20 14:17       ` Wei Liu

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=19cf5c82-cba5-5842-cb46-be319e5a261c@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.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 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.