Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-02-01 Thread Xu, Like
On 2021/1/29 10:52, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: On 2021/1/26 15:08, Xu, Like wrote: On 2021/1/25 22:47, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: Thanks for replying, On 2021/1/25 10:41, Like Xu wrote: +

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-28 Thread Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.)
On 2021/1/26 15:08, Xu, Like wrote: On 2021/1/25 22:47, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: Thanks for replying, On 2021/1/25 10:41, Like Xu wrote: + k...@vger.kernel.org Hi Liuxiangdong, On 2021/1/22 18:02, Liuxiangdong (Aven, Cloud Infrastructure

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-26 Thread Xu, Like
On 2021/1/25 22:47, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: Thanks for replying, On 2021/1/25 10:41, Like Xu wrote: + k...@vger.kernel.org Hi Liuxiangdong, On 2021/1/22 18:02, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: Hi Like,

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-25 Thread Peter Zijlstra
On Mon, Jan 25, 2021 at 04:08:22PM +0800, Like Xu wrote: > Hi Peter, > > On 2021/1/22 17:56, Peter Zijlstra wrote: > > On Fri, Jan 15, 2021 at 10:51:38AM -0800, Sean Christopherson wrote: > > > On Fri, Jan 15, 2021, Andi Kleen wrote: > > > > > I'm asking about ucode/hardare. Is the "guest pebs

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-25 Thread Peter Zijlstra
On Mon, Jan 25, 2021 at 08:07:06PM +0800, Xu, Like wrote: > So under the premise that counter cross-mapping is allowed, > how can hypercall help fix it ? Hypercall or otherwise exposing the mapping, will let the guest fix it up when it already touches the data. Which avoids the host from having

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-25 Thread Xu, Like
On 2021/1/25 20:18, Peter Zijlstra wrote: On Mon, Jan 25, 2021 at 08:07:06PM +0800, Xu, Like wrote: So under the premise that counter cross-mapping is allowed, how can hypercall help fix it ? Hypercall or otherwise exposing the mapping, will let the guest fix it up when it already touches the

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-25 Thread Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.)
Thanks for replying, On 2021/1/25 10:41, Like Xu wrote: + k...@vger.kernel.org Hi Liuxiangdong, On 2021/1/22 18:02, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: Hi Like, Some questions about

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-25 Thread Xu, Like
On 2021/1/25 19:13, Peter Zijlstra wrote: On Mon, Jan 25, 2021 at 04:08:22PM +0800, Like Xu wrote: Hi Peter, On 2021/1/22 17:56, Peter Zijlstra wrote: On Fri, Jan 15, 2021 at 10:51:38AM -0800, Sean Christopherson wrote: On Fri, Jan 15, 2021, Andi Kleen wrote: I'm asking about ucode/hardare.

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-25 Thread Like Xu
Hi Peter, On 2021/1/22 17:56, Peter Zijlstra wrote: On Fri, Jan 15, 2021 at 10:51:38AM -0800, Sean Christopherson wrote: On Fri, Jan 15, 2021, Andi Kleen wrote: I'm asking about ucode/hardare. Is the "guest pebs buffer write -> PEBS PMI" guaranteed to be atomic? Of course not. So there's

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-24 Thread Like Xu
+ k...@vger.kernel.org Hi Liuxiangdong, On 2021/1/22 18:02, Liuxiangdong (Aven, Cloud Infrastructure Service Product Dept.) wrote: Hi Like, Some questions about https://lore.kernel.org/kvm/20210104131542.495413-1-like...@linux.intel.com/

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-22 Thread Peter Zijlstra
On Fri, Jan 15, 2021 at 10:51:38AM -0800, Sean Christopherson wrote: > On Fri, Jan 15, 2021, Andi Kleen wrote: > > > I'm asking about ucode/hardare. Is the "guest pebs buffer write -> PEBS > > > PMI" > > > guaranteed to be atomic? > > > > Of course not. > > So there's still a window where the

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-15 Thread Andi Kleen
On Fri, Jan 15, 2021 at 10:51:38AM -0800, Sean Christopherson wrote: > On Fri, Jan 15, 2021, Andi Kleen wrote: > > > I'm asking about ucode/hardare. Is the "guest pebs buffer write -> PEBS > > > PMI" > > > guaranteed to be atomic? > > > > Of course not. > > So there's still a window where the

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-15 Thread Sean Christopherson
On Fri, Jan 15, 2021, Andi Kleen wrote: > > I'm asking about ucode/hardare. Is the "guest pebs buffer write -> PEBS > > PMI" > > guaranteed to be atomic? > > Of course not. So there's still a window where the guest could observe the bad counter index, correct?

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-15 Thread Andi Kleen
> I'm asking about ucode/hardare. Is the "guest pebs buffer write -> PEBS PMI" > guaranteed to be atomic? Of course not. > > In practice, under what scenarios will guest counters get cross-mapped? And, > how does this support affect guest accuracy? I.e. how bad do things get for > the >

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-15 Thread Sean Christopherson
On Fri, Jan 15, 2021, Xu, Like wrote: > Hi Sean, > > Thanks for your comments ! > > On 2021/1/15 3:10, Sean Christopherson wrote: > > On Mon, Jan 04, 2021, Like Xu wrote: > > > 2) Slow path (part 3, patch 0012-0017) > > > > > > This is when the host assigned physical PMC has a different index >

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-14 Thread Xu, Like
Hi Sean, Thanks for your comments ! On 2021/1/15 3:10, Sean Christopherson wrote: On Mon, Jan 04, 2021, Like Xu wrote: 2) Slow path (part 3, patch 0012-0017) This is when the host assigned physical PMC has a different index from the virtual PMC (e.g. using physical PMC1 to emulate virtual

Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-14 Thread Sean Christopherson
On Mon, Jan 04, 2021, Like Xu wrote: > 2) Slow path (part 3, patch 0012-0017) > > This is when the host assigned physical PMC has a different index > from the virtual PMC (e.g. using physical PMC1 to emulate virtual PMC0) > In this case, KVM needs to rewrite the PEBS records to change the >

[PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS

2021-01-04 Thread Like Xu
The Precise Event Based Sampling (PEBS) facility on Intel Ice Lake Server platforms can provide an architectural state of the instruction executed after the guest instruction that caused the event. This patch set enables the PEBS via DS feature for KVM guests on the Ice Lake Server. We can use