[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZSl4Mp3EZ5AnLGRD@google.com>
Date: Fri, 13 Oct 2023 10:02:42 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Mingwei Zhang <mizhang@...gle.com>, Ingo Molnar <mingo@...nel.org>,
Dapeng Mi <dapeng1.mi@...ux.intel.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Kan Liang <kan.liang@...ux.intel.com>,
Like Xu <likexu@...cent.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>, kvm@...r.kernel.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Zhenyu Wang <zhenyuw@...ux.intel.com>,
Zhang Xiong <xiong.y.zhang@...el.com>,
Lv Zhiyuan <zhiyuan.lv@...el.com>,
Yang Weijiang <weijiang.yang@...el.com>,
Dapeng Mi <dapeng1.mi@...el.com>,
Jim Mattson <jmattson@...gle.com>,
David Dunn <daviddunn@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [Patch v4 07/13] perf/x86: Add constraint for guest perf metrics event
On Wed, Oct 11, 2023, Peter Zijlstra wrote:
> On Wed, Oct 04, 2023 at 02:50:46PM -0700, Sean Christopherson wrote:
>
> > Thinking about this more, what if we do a blend of KVM's FPU swapping and debug
> > register swapping?
> >
> > A. Load guest PMU state in vcpu_enter_guest() after IRQs are disabled
> > B. Put guest PMU state (and load host state) in vcpu_enter_guest() before IRQs
> > are enabled, *if and only if* the current CPU has one or perf events that
> > wants to use the hardware PMU
> > C. Put guest PMU state at vcpu_put()
> > D. Add a perf callback that is invoked from IRQ context when perf wants to
> > configure a new PMU-based events, *before* actually programming the MSRs,
> > and have KVM's callback put the guest PMU state
> >
>
> No real objection, but I would suggest arriving at that solution by
> first building the simple-stupid thing and then making it more
> complicated in additinoal patches. Hmm?
Yeah, for sure.
Powered by blists - more mailing lists