Stephane Eranian wrote:
>   
>> As I'd rather not do that, perhaps we can program the apic to issue an 
>> nmi instead of an interrupt while in guest mode.  On receipt of nmi, we 
>> can call the host perfmon handler directly to interpret the performance 
>> counters.
>>
>>     
> Yes, but that would be no different from what I have now without the ack-intr.
> What you'd like is to catch the PMU intr right away and re-inject it without
> using the host perfmon interrupt handler. It seem the only way to do this 
> is by acking intr. Unfortunately, it is an all or nothing control.
>   

It is a little different, but perhaps not enough.  If perfmon is the 
only nmi source, or if you can find out the source of the nmi, then you 
don't need to take the nmi but can instead call the perfmon handler.  
Otherwise we'd need to dispatch interrupts manually.

> The other worry in this scheme is that the injection would be done without
> qemu intervening. Thus you would not be able to check whether the virtual 
> APIC 
> LVT vector is curently masked. Its configuration may be different from the
> actual APIC. But that is probably ok for now. 

You certainly need to go through the apic for correctness, using a 
signal like you outlined before might be a good interim solution.

> Is there a plan to move the
> APIC emulation into KVM?
>
>   

Yes.  It's needed for smp and kernel-only paravirt devices.

>> It really depends on what one wants to do with the performance monitor 
>> on the guest:
>>
>> - if it's just to shut up the nmi watchdog, we can report a cpu model 
>> that does not have the performance monitor (which would be a classic 
>> Pentium? or maybe a 486?)
>>     
>
> No, the goal is to provide full acecss to the PMU for performance monitoring
> just like you would be able on bare HW.
>
>   

Ok.  I'm just glad I don't have to do it ;-)

>   
>> - if we want real performance monitoring, we need to do the msr swap. 
>>     
>
> You mean if you do not want to conflict with the host using the PMU
> for itself? Well, the host perfmon can take care of this.
>   

If the host wants system-wide monitoring (% cpu / tlb miss / whatever in 
each process, including vms) and a vm wants monitoring too, then you 
don't have enough resources to go round.  There's a similar problem with 
the debug registers; if the host wants to debug a guest, which is itself 
debugging a process, something has to give.


-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to