Re: [PATCH v10 08/11] KVM: x86/pmu: Add LBR feature emulation via guest LBR event

2020-05-11 Thread Xu, Like
On 2020/5/8 21:09, Peter Zijlstra wrote: On Mon, Apr 27, 2020 at 11:16:40AM +0800, Like Xu wrote: On 2020/4/24 20:16, Peter Zijlstra wrote: And I suppose that is why you need that horrible: needs_guest_lbr_without_counter() thing to begin with. Do you suggest to use event->attr.config check to

Re: [PATCH v10 08/11] KVM: x86/pmu: Add LBR feature emulation via guest LBR event

2020-05-08 Thread Peter Zijlstra
On Mon, Apr 27, 2020 at 11:16:40AM +0800, Like Xu wrote: > On 2020/4/24 20:16, Peter Zijlstra wrote: > > And I suppose that is why you need that horrible: > > needs_guest_lbr_without_counter() thing to begin with. > > Do you suggest to use event->attr.config check to replace > "needs_branch_stack

Re: [PATCH v10 08/11] KVM: x86/pmu: Add LBR feature emulation via guest LBR event

2020-05-08 Thread Like Xu
Hi Peter, On 2020/4/27 11:16, Like Xu wrote: Hi Peter, On 2020/4/24 20:16, Peter Zijlstra wrote: On Thu, Apr 23, 2020 at 04:14:09PM +0800, Like Xu wrote: +static int intel_pmu_create_lbr_event(struct kvm_vcpu *vcpu) +{ +    struct kvm_pmu *pmu = vcpu_to_pmu(vcpu); +    struct perf_event *even