lkml.org 
[lkml]   [2019]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v5 10/12] KVM/x86/lbr: lazy save the guest lbr stack
Date
On Friday, February 15, 2019 9:50 AM, Like Xu wrote:
> To: Wang, Wei W <wei.w.wang@intel.com>; linux-kernel@vger.kernel.org;
> kvm@vger.kernel.org; pbonzini@redhat.com; ak@linux.intel.com;
> peterz@infradead.org
> Cc: Liang, Kan <kan.liang@intel.com>; mingo@redhat.com;
> rkrcmar@redhat.com; Xu, Like <like.xu@intel.com>; jannh@google.com;
> arei.gonglei@huawei.com; jmattson@google.com
> Subject: Re: [PATCH v5 10/12] KVM/x86/lbr: lazy save the guest lbr stack
>
> On 2019/2/14 17:06, Wei Wang wrote:
> > When the vCPU is scheduled in:
> > - if the lbr feature was used in the last vCPU time slice, set the lbr
> > stack to be interceptible, so that the host can capture whether the
> > lbr feature will be used in this time slice;
> > - if the lbr feature wasn't used in the last vCPU time slice, disable
> > the vCPU support of the guest lbr switching.
> >
> > Upon the first access to one of the lbr related MSRs (since the vCPU
> > was scheduled in):
> > - record that the guest has used the lbr;
> > - create a host perf event to help save/restore the guest lbr stack;
>
> Based on commit "15ad71460" and guest-use-lbr-only usage, is this possible
> to create none of host perf event for vcpu and simply reuse
> __intel_pmu_lbr_save/restore in intel_pmu_sched_out/in and keep the
> lbr_stack sync with kvm_pmu->lbr_stack rather than task_ctx of perf_event ?

Yes, both method should work. People may have different opinions about
kvm or perf to own the job of lbr switching. Let's see.. if most people vote for
kvm to do the switching, I'll make that change.
Otherwise, I'll stay with what we already have.

Best,
Wei
\
 
 \ /
  Last update: 2019-02-15 10:01    [W:0.053 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site