[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <286AC319A985734F985F78AFA26841F73DF71F0B@shsmsx102.ccr.corp.intel.com>
Date: Fri, 15 Feb 2019 09:00:00 +0000
From: "Wang, Wei W" <wei.w.wang@...el.com>
To: 'Like Xu' <like.xu@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"peterz@...radead.org" <peterz@...radead.org>
CC: "Liang, Kan" <kan.liang@...el.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"Xu, Like" <like.xu@...el.com>,
"jannh@...gle.com" <jannh@...gle.com>,
"arei.gonglei@...wei.com" <arei.gonglei@...wei.com>,
"jmattson@...gle.com" <jmattson@...gle.com>
Subject: RE: [PATCH v5 10/12] KVM/x86/lbr: lazy save the guest lbr stack
On Friday, February 15, 2019 9:50 AM, Like Xu wrote:
> To: Wang, Wei W <wei.w.wang@...el.com>; linux-kernel@...r.kernel.org;
> kvm@...r.kernel.org; pbonzini@...hat.com; ak@...ux.intel.com;
> peterz@...radead.org
> Cc: Liang, Kan <kan.liang@...el.com>; mingo@...hat.com;
> rkrcmar@...hat.com; Xu, Like <like.xu@...el.com>; jannh@...gle.com;
> arei.gonglei@...wei.com; jmattson@...gle.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
Powered by blists - more mailing lists