Re: [Xen-devel] [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE

2017-02-22 Thread Boris Ostrovsky
+ +void vpmu_initialise(struct vcpu *v) +{ +get_vpmu(v); + +/* + * Guests without LAPIC (i.e. PV) call vpmu_arch_initialise() + * from pvpmu_init(). + */ >>> implication is that PV VPMU is not counted then? >> No. get_vpmu() is what

Re: [Xen-devel] [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE

2017-02-21 Thread Tian, Kevin
> From: Boris Ostrovsky [mailto:boris.ostrov...@oracle.com] > Sent: Tuesday, February 21, 2017 10:10 PM > > On 02/21/2017 03:09 AM, Tian, Kevin wrote: > >> From: Boris Ostrovsky [mailto:boris.ostrov...@oracle.com] > >> Sent: Saturday, February 18, 2017 1:40 AM > >> > >> vpmu_enabled() (used by hvm

Re: [Xen-devel] [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE

2017-02-21 Thread Boris Ostrovsky
On 02/21/2017 06:00 AM, Andrew Cooper wrote: > On 17/02/17 17:40, Boris Ostrovsky wrote: >> @@ -509,15 +498,63 @@ void vpmu_initialise(struct vcpu *v) >> if ( ret ) >> printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v); >> >> -/* Intel needs to initialize VPMU o

Re: [Xen-devel] [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE

2017-02-21 Thread Boris Ostrovsky
On 02/21/2017 03:09 AM, Tian, Kevin wrote: >> From: Boris Ostrovsky [mailto:boris.ostrov...@oracle.com] >> Sent: Saturday, February 18, 2017 1:40 AM >> >> vpmu_enabled() (used by hvm/pv_cpuid() to properly report 0xa leaf >> for Intel processors) is based on the value of VPMU_CONTEXT_ALLOCATED >> b

Re: [Xen-devel] [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE

2017-02-21 Thread Andrew Cooper
On 17/02/17 17:40, Boris Ostrovsky wrote: > @@ -509,15 +498,63 @@ void vpmu_initialise(struct vcpu *v) > if ( ret ) > printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v); > > -/* Intel needs to initialize VPMU ops even if VPMU is not in use */ > -if ( !is_pri

Re: [Xen-devel] [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE

2017-02-21 Thread Tian, Kevin
> From: Boris Ostrovsky [mailto:boris.ostrov...@oracle.com] > Sent: Saturday, February 18, 2017 1:40 AM > > 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

[Xen-devel] [PATCH v2 1/3] x86/vpmu: Add get/put_vpmu() and VPMU_AVAILABLE

2017-02-17 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