From: Gleb Natapov <gleb@redhat.com>
To: Stefan Fritsch <sf@sfritsch.de>
Cc: Jan Kiszka <jan.kiszka@siemens.com>, kvm@vger.kernel.org
Subject: Re: How to do fast accesses to LAPIC TPR under kvm?
Date: Thu, 18 Oct 2012 11:35:13 +0200 [thread overview]
Message-ID: <20121018093513.GF20788@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1210180928330.25378@eru.sfritsch.de>
On Thu, Oct 18, 2012 at 09:43:46AM +0200, Stefan Fritsch wrote:
> >Everything that unconditionally traps, and so do CR8 accesses, does not
> >help.
>
> I was hoping that CR8 access would not trap unconditionally. The AMD
> Programmer's Manual Vol. 2, section 15.21.2 seems to imply that
> there is a mode where this is not the case:
>
> <quote>
> SVM provides a virtual TPR register, V_TPR, for use by the guest;
> its value is loaded from the VMCB by VMRUN and written back to the
> VMCB by #VMEXIT. The APIC's TPR always controls the task priority
> for physical interrupts, and the V_TPR always controls virtual
> interrupts.
>
> While running a guest with V_INTR_MASKING cleared to 0:
> * Writes to CR8 affect both the APIC's TPR and the V_TPR register
> * Reads from CR8 operate as they would without SVM
>
> While running a guest with V_INTR_MASKING set to 1:
> * Writes to CR8 affect only the V_TPR register
> * Reads from CR8 return V_TPR.
> </quote>
>
> Is V_INTR_MASKING == 1 not used in kvm? Is it not usable at all for
> some reason? Or have I misunderstood the description?
>
You misunderstood the description. V_INTR_MASKING=1 means that CR8 writes
are not propagated to real HW APIC.
But KVM does not trap access to CR8 unconditionally. It enables CR8
intercept only when there is pending interrupt in IRR that cannot be
immediately delivered due to current TPR value. This should eliminate 99%
of CR8 intercepts.
--
Gleb.
next prev parent reply other threads:[~2012-10-18 9:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 19:24 How to do fast accesses to LAPIC TPR under kvm? Stefan Fritsch
2012-10-18 6:13 ` Jan Kiszka
2012-10-18 7:43 ` Stefan Fritsch
2012-10-18 9:35 ` Gleb Natapov [this message]
2012-10-18 12:27 ` Avi Kivity
2012-10-18 17:25 ` Stefan Fritsch
2012-10-19 22:39 ` Stefan Fritsch
2012-10-22 14:10 ` Avi Kivity
2012-10-24 9:19 ` Stefan Fritsch
2012-10-25 13:34 ` Avi Kivity
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=20121018093513.GF20788@redhat.com \
--to=gleb@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=sf@sfritsch.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.