Re: [PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-04-09 Thread Xu, Like
On 2021/4/9 15:59, Peter Zijlstra wrote: On Fri, Apr 09, 2021 at 03:07:38PM +0800, Xu, Like wrote: Hi Peter, On 2021/4/8 15:52, Peter Zijlstra wrote: This is because in the early part of this function, we have operations:     if (x86_pmu.flags & PMU_FL_PEBS_ALL)         arr[0].guest &= ~c

Re: [PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-04-09 Thread Peter Zijlstra
On Fri, Apr 09, 2021 at 03:07:38PM +0800, Xu, Like wrote: > Hi Peter, > > On 2021/4/8 15:52, Peter Zijlstra wrote: > > > This is because in the early part of this function, we have operations: > > > > > >     if (x86_pmu.flags & PMU_FL_PEBS_ALL) > > >         arr[0].guest &= ~cpuc->pebs_enabled

Re: [PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-04-09 Thread Xu, Like
Hi Peter, On 2021/4/8 15:52, Peter Zijlstra wrote: This is because in the early part of this function, we have operations:     if (x86_pmu.flags & PMU_FL_PEBS_ALL)         arr[0].guest &= ~cpuc->pebs_enabled;     else         arr[0].guest &= ~(cpuc->pebs_enabled & PEBS_COUNTER_MASK); and i

Re: [PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-04-08 Thread Xu, Like
On 2021/4/8 15:52, Peter Zijlstra wrote: On Thu, Apr 08, 2021 at 01:39:49PM +0800, Xu, Like wrote: Hi Peter, Thanks for your detailed comments. If you have more comments for other patches, please let me know. On 2021/4/7 23:39, Peter Zijlstra wrote: On Mon, Mar 29, 2021 at 01:41:29PM +0800,

Re: [PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-04-08 Thread Peter Zijlstra
On Thu, Apr 08, 2021 at 01:39:49PM +0800, Xu, Like wrote: > Hi Peter, > > Thanks for your detailed comments. > > If you have more comments for other patches, please let me know. > > On 2021/4/7 23:39, Peter Zijlstra wrote: > > On Mon, Mar 29, 2021 at 01:41:29PM +0800, Like Xu wrote: > > > @@ -38

Re: [PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-04-07 Thread Xu, Like
Hi Peter, Thanks for your detailed comments. If you have more comments for other patches, please let me know. On 2021/4/7 23:39, Peter Zijlstra wrote: On Mon, Mar 29, 2021 at 01:41:29PM +0800, Like Xu wrote: @@ -3869,10 +3876,12 @@ static struct perf_guest_switch_msr *intel_guest_get_msrs(in

Re: [PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-04-07 Thread Peter Zijlstra
On Mon, Mar 29, 2021 at 01:41:29PM +0800, Like Xu wrote: > @@ -3869,10 +3876,12 @@ static struct perf_guest_switch_msr > *intel_guest_get_msrs(int *nr, void *data) > > if (arr[1].guest) > arr[0].guest |= arr[1].guest; > - else > + else

[PATCH v4 08/16] KVM: x86/pmu: Add IA32_DS_AREA MSR emulation to manage guest DS buffer

2021-03-28 Thread Like Xu
When CPUID.01H:EDX.DS[21] is set, the IA32_DS_AREA MSR exists and points to the linear address of the first byte of the DS buffer management area, which is used to manage the PEBS records. When guest PEBS is enabled and the value is different from the host, KVM will add the IA32_DS_AREA MSR to the