Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-12-06 Thread Natarajan, Janakarajan
On 12/5/2017 11:56 AM, Radim Krcmar wrote: 2017-12-01 13:30-0600, Natarajan, Janakarajan: On 11/17/2017 5:44 AM, Borislav Petkov wrote: On Thu, Nov 16, 2017 at 12:00:11PM -0600, Natarajan, Janakarajan wrote: Ah my apologies. So when the pmu is initialized the cpuid entries aren't available the

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-12-05 Thread Radim Krcmar
2017-12-01 13:30-0600, Natarajan, Janakarajan: > On 11/17/2017 5:44 AM, Borislav Petkov wrote: > > On Thu, Nov 16, 2017 at 12:00:11PM -0600, Natarajan, Janakarajan wrote: > > > Ah my apologies. So when the pmu is initialized the cpuid entries > > > aren't available then. > > So let's see: > > > >

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-12-01 Thread Natarajan, Janakarajan
On 11/17/2017 5:44 AM, Borislav Petkov wrote: On Thu, Nov 16, 2017 at 12:00:11PM -0600, Natarajan, Janakarajan wrote: Ah my apologies. So when the pmu is initialized the cpuid entries aren't available then. So let's see: ... kvm_arch_vcpu_create() -> svm_create_vcpu() -> kvm_vcpu_init() -> kvm

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-27 Thread Natarajan, Janakarajan
On 11/17/2017 5:44 AM, Borislav Petkov wrote: On Thu, Nov 16, 2017 at 12:00:11PM -0600, Natarajan, Janakarajan wrote: Ah my apologies. So when the pmu is initialized the cpuid entries aren't available then. So let's see: ... kvm_arch_vcpu_create() -> svm_create_vcpu() -> kvm_vcpu_init() -> kvm

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-17 Thread Borislav Petkov
On Thu, Nov 16, 2017 at 12:00:11PM -0600, Natarajan, Janakarajan wrote: > Ah my apologies. So when the pmu is initialized the cpuid entries > aren't available then. So let's see: ... kvm_arch_vcpu_create() -> svm_create_vcpu() -> kvm_vcpu_init() -> kvm_arch_vcpu_init() -> <--- HERE kvm_pmu_init

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-16 Thread Natarajan, Janakarajan
On 11/16/2017 11:25 AM, Borislav Petkov wrote: On Thu, Nov 16, 2017 at 11:13:47AM -0600, Natarajan, Janakarajan wrote: On 11/15/2017 1:07 PM, Borislav Petkov wrote: On Wed, Nov 15, 2017 at 01:04:03PM -0600, Natarajan, Janakarajan wrote: So, when the amd_pmu_init is called, a query to guest_cpu

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-16 Thread Borislav Petkov
On Thu, Nov 16, 2017 at 11:13:47AM -0600, Natarajan, Janakarajan wrote: > On 11/15/2017 1:07 PM, Borislav Petkov wrote: > > On Wed, Nov 15, 2017 at 01:04:03PM -0600, Natarajan, Janakarajan wrote: > > > So, when the amd_pmu_init is called, a query to guest_cpuid_family() > > > gives a > > > value o

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-16 Thread Natarajan, Janakarajan
On 11/15/2017 1:07 PM, Borislav Petkov wrote: On Wed, Nov 15, 2017 at 01:04:03PM -0600, Natarajan, Janakarajan wrote: So, when the amd_pmu_init is called, a query to guest_cpuid_family() gives a value of -1. And that is because...? And it can be fixed to give the proper guest family I presume .

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-15 Thread Borislav Petkov
On Wed, Nov 15, 2017 at 01:04:03PM -0600, Natarajan, Janakarajan wrote: > So, when the amd_pmu_init is called, a query to guest_cpuid_family() gives a > value of -1. And that is because...? And it can be fixed to give the proper guest family I presume ...? -- Regards/Gruss, Boris. SUSE Linu

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-15 Thread Natarajan, Janakarajan
On 11/9/2017 12:34 PM, Borislav Petkov wrote: Subject: Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest Btw, your subjects need a prefix: "x86/kvm: Add guest support for the AMD core performance counters" for example. Okay. On Mon, Nov 06, 2017 at 11:44:

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-09 Thread Borislav Petkov
> Subject: Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest Btw, your subjects need a prefix: "x86/kvm: Add guest support for the AMD core performance counters" for example. On Mon, Nov 06, 2017 at 11:44:25AM -0600, Janakarajan Natarajan wrote: > This patch

[PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-11-06 Thread Janakarajan Natarajan
This patch adds support for AMD Core Performance counters in the guest. The base event select and counter MSRs are changed. In addition, with the core extension, there are 2 extra counters available for performance measurements for a total of 6. With the new MSRs, the logic to map them to the gp_c