Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-17 Thread Boris Ostrovsky
On 02/17/2017 10:58 AM, Andrew Cooper wrote: On 17/02/17 14:17, Boris Ostrovsky wrote: On 02/17/2017 03:27 AM, Jan Beulich wrote: On 16.02.17 at 19:09, wrote: On 02/16/2017 12:09 PM, Andrew Cooper wrote: Second, if it is available, has the toolstack chosen to allow the domain to use it.

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-17 Thread Andrew Cooper
On 17/02/17 14:17, Boris Ostrovsky wrote: > > > On 02/17/2017 03:27 AM, Jan Beulich wrote: > On 16.02.17 at 19:09, wrote: >>> On 02/16/2017 12:09 PM, Andrew Cooper wrote: Second, if it is available, has the toolstack chosen to allow the domain to use it. This should determine w

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-17 Thread Boris Ostrovsky
On 02/17/2017 03:28 AM, Jan Beulich wrote: On 16.02.17 at 18:31, wrote: On 02/16/2017 11:59 AM, Jan Beulich wrote: Also this new model basically limits the opportunity to change the mode to the case where no guest at all is running, iiuc. Previously this would have been possible with any num

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-17 Thread Boris Ostrovsky
On 02/17/2017 03:27 AM, Jan Beulich wrote: On 16.02.17 at 19:09, wrote: On 02/16/2017 12:09 PM, Andrew Cooper wrote: Second, if it is available, has the toolstack chosen to allow the domain to use it. This should determine whether features/information are visible in CPUID. You mean if too

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-17 Thread Jan Beulich
>>> On 16.02.17 at 18:31, wrote: > On 02/16/2017 11:59 AM, Jan Beulich wrote: >> Also this new model basically limits the opportunity to change the >> mode to the case where no guest at all is running, iiuc. Previously >> this would have been possible with any number of guests running, >> as long

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-17 Thread Jan Beulich
>>> On 16.02.17 at 19:09, wrote: > On 02/16/2017 12:09 PM, Andrew Cooper wrote: >> Second, if it is available, has the toolstack chosen to allow the domain >> to use it. This should determine whether features/information are >> visible in CPUID. > > You mean if toolstack masks out leaf 0xa on In

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-16 Thread Boris Ostrovsky
On 02/16/2017 12:09 PM, Andrew Cooper wrote: On 16/02/17 16:59, Jan Beulich wrote: On 16.02.17 at 15:59, wrote: vpmu_enabled() (used by hvm/pv_cpuid() to properly report 0xa leaf for Intel processors) is based on the value of VPMU_CONTEXT_ALLOCATED bit. This is problematic: * For HVM guests

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-16 Thread Andrew Cooper
On 16/02/17 16:59, Jan Beulich wrote: On 16.02.17 at 15:59, wrote: >> vpmu_enabled() (used by hvm/pv_cpuid() to properly report 0xa leaf >> for Intel processors) is based on the value of VPMU_CONTEXT_ALLOCATED >> bit. This is problematic: >> * For HVM guests VPMU context is allocated lazily,

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-16 Thread Boris Ostrovsky
On 02/16/2017 11:59 AM, Jan Beulich wrote: On 16.02.17 at 15:59, wrote: vpmu_enabled() (used by hvm/pv_cpuid() to properly report 0xa leaf for Intel processors) is based on the value of VPMU_CONTEXT_ALLOCATED bit. This is problematic: * For HVM guests VPMU context is allocated lazily, during

Re: [Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-16 Thread Jan Beulich
>>> On 16.02.17 at 15:59, wrote: > vpmu_enabled() (used by hvm/pv_cpuid() to properly report 0xa leaf > for Intel processors) is based on the value of VPMU_CONTEXT_ALLOCATED > bit. This is problematic: > * For HVM guests VPMU context is allocated lazily, during the first > access to VPMU MSRs. S

[Xen-devel] [PATCH] x86/vpmu: Add get/put_vpmu() and VPMU_ENABLED

2017-02-16 Thread Boris Ostrovsky
vpmu_enabled() (used by hvm/pv_cpuid() to properly report 0xa leaf for Intel processors) is based on the value of VPMU_CONTEXT_ALLOCATED bit. This is problematic: * For HVM guests VPMU context is allocated lazily, during the first access to VPMU MSRs. Since the leaf is typically queried before gu