From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: eranian-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: VT-x and Performance counter interrupt in KVM mode
Date: Wed, 28 Mar 2007 18:03:34 +0200 [thread overview]
Message-ID: <460A91D6.9050607@qumranet.com> (raw)
In-Reply-To: <20070328154155.GB12647-HU54gidqsKnWxDs0y9d3MAC/G2K4zDHf@public.gmane.org>
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
next prev parent reply other threads:[~2007-03-28 16:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-27 16:35 VT-x and Performance counter interrupt in KVM mode Stephane Eranian
[not found] ` <20070327163515.GE11818-HU54gidqsKnWxDs0y9d3MAC/G2K4zDHf@public.gmane.org>
2007-03-27 17:10 ` Avi Kivity
[not found] ` <46095022.2030209-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-28 15:41 ` Stephane Eranian
[not found] ` <20070328154155.GB12647-HU54gidqsKnWxDs0y9d3MAC/G2K4zDHf@public.gmane.org>
2007-03-28 16:03 ` Avi Kivity [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-03-21 4:58 Shobha Ranganathan
[not found] ` <826581.57009.qm-jpo5DsbaTqqB9c0Qi4KiSl5cfvJIxWXgQQ4Iyu8u01E@public.gmane.org>
2007-03-21 7:23 ` Avi Kivity
2007-03-21 7:25 ` Dor Laor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=460A91D6.9050607@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=eranian-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox