Re: [PATCH] kvm: Fix perf timer mode IP reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 26, 2017 at 11:26:07AM +0200, Paolo Bonzini wrote:
> On 26/07/2017 02:20, Andi Kleen wrote:
> > From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> > 
> > KVM and perf have a special backdoor mechanism to report the IP for interrupts
> > re-executed after vm exit. This works for the NMIs that perf normally uses.
> > 
> > However when perf is in timer mode it doesn't work because the timer interrupt
> > doesn't get this special treatment. This is common when KVM is running
> > nested in another hypervisor which may not implement the PMU, so only
> > timer mode is available.
> > 
> > Call the functions to set up the backdoor IP also for non NMI interrupts.
> > 
> > I renamed the functions to set up the backdoor IP reporting to be more
> > appropiate for their new use.  The SVM change is only compile tested.
> > 
> > v2: Moved the functions inline.
> > For the normal interrupt case the before/after functions are now
> > called from x86.c, not arch specific code.
> 
> You haven't removed the code from vmx_handle_external_intr and 
> svm_handle_external_intr.

Ok.

> 
> > For the NMI case we still need to call it in the architecture
> > specific code, because it's already needed in the low level *_run
> > functions.
> 
> I must have been unclear; what I was asking is, can the calls cover
> a much wider range of vcpu_enter_guest?

Handling the external interrupt case from x86 without exporting
is no problem (like my patch did)

But to handle the NMI case it needs to be exported because
the NMI case is directly handled in the lowlevel vcpu_runs*.

And I'm not sure it's safe to set over the actual low level
guest runs. e.g. the AMD code already seems to change interrupts
there.

-andi



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux