Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Andrew Cooper
On 22/02/17 16:34, Boris Ostrovsky wrote: >> 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. > > Something like this? This please, to match the AMD side. diff --git a/xen/include/asm-x86/cpuid.h

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Boris Ostrovsky
> 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. Something like this? diff --git a/xen/include/asm-x86/cpuid.h b/xen/include/asm-x86/cpuid.h index bc3fc7c..f73ae19 100644 --- a/xen/include/asm-x86/cpuid.h +++

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Jan Beulich
>>> On 22.02.17 at 16:02, wrote: > On 02/22/2017 09:38 AM, Jan Beulich wrote: > On 22.02.17 at 15:15, wrote: >>> On 02/22/2017 04:55 AM, Jan Beulich wrote: >>> On 17.02.17 at 18:40, wrote: > ---

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Andrew Cooper
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, wrote: >>> On 02/22/2017 04:55 AM, Jan Beulich wrote: >>> On 17.02.17 at 18:40, wrote: > ---

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Boris Ostrovsky
On 02/22/2017 09:38 AM, Jan Beulich wrote: On 22.02.17 at 15:15, wrote: >> On 02/22/2017 04:55 AM, Jan Beulich wrote: >> On 17.02.17 at 18:40, wrote: --- a/xen/arch/x86/cpu/vpmu_intel.c +++ b/xen/arch/x86/cpu/vpmu_intel.c

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Jan Beulich
>>> On 22.02.17 at 15:15, wrote: > On 02/22/2017 04:55 AM, Jan Beulich wrote: > On 17.02.17 at 18:40, wrote: >>> --- a/xen/arch/x86/cpu/vpmu_intel.c >>> +++ b/xen/arch/x86/cpu/vpmu_intel.c >>> @@ -884,6 +884,10 @@ int

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Boris Ostrovsky
On 02/22/2017 04:55 AM, Jan Beulich wrote: On 17.02.17 at 18:40, 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 ) >>

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-22 Thread Jan Beulich
>>> On 17.02.17 at 18:40, 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 (

Re: [Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-21 Thread Tian, Kevin
> From: Boris Ostrovsky [mailto:boris.ostrov...@oracle.com] > Sent: Saturday, February 18, 2017 1:40 AM > > When toolstack overrides CPUID leaf 0xa values (on Intel processors) > VPMU should not be available to the guest. only when override with an invalid version? otherwise ok to me.

[Xen-devel] [PATCH v2 2/3] x86/vpmu: Disable VPMU if guest's CPUID indicates no PMU support

2017-02-17 Thread Boris Ostrovsky
When toolstack overrides CPUID leaf 0xa values (on Intel processors) VPMU should not be available to the guest. Signed-off-by: Boris Ostrovsky --- * New in v2 xen/arch/x86/cpu/vpmu_intel.c | 4 xen/arch/x86/domctl.c | 14 ++ 2 files