lkml.org 
[lkml]   [2010]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side
On Thu, Apr 15, 2010 at 12:48:09PM +0300, Avi Kivity wrote:
> On 04/15/2010 12:44 PM, oerg Roedel wrote:
>>
>>> So, we'd need something like the following:
>>>
>>> if (exit == NMI)
>>> __get_cpu_var(nmi_vcpu) = vcpu;
>>>
>>> stgi();
>>>
>>> if (exit == NMI) {
>>> while (!nmi_handled())
>>> cpu_relax();
>>> __get_cpu_var(nmi_vcpu) = NULL;
>>> }
>>>
>> Hmm, looks a bit complicated to me. The NMI should happen shortly after
>> the stgi instruction. Interrupts are still disabled so we stay on this
>> cpu. Can't we just set and erase the cpu_var at vcpu_load/vcpu_put time?
>>
>>
>
> That means an NMI that happens outside guest code (for example, in the
> mmu, or during the exit itself) would be counted as if in guest code.

Hmm, true. The same is true for an NMI that happens between VMSAVE and
STGI but that window is smaller. Anyway, I think we don't need the
busy-wait loop. The NMI should be executed at a well defined point and
we set the cpu_var back to NULL after that point.

Joerg



\
 
 \ /
  Last update: 2010-04-15 12:43    [W:0.063 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site