lkml.org 
[lkml]   [2023]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch v4 07/13] perf/x86: Add constraint for guest perf metrics event
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?

\
 
 \ /
  Last update: 2023-10-11 16:21    [W:0.294 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site