From: Avi Kivity <avi@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: x86@kernel.org, kvm@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
gleb@redhat.com, Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv4 3/5] kvm: host side for eoi optimization
Date: Thu, 17 May 2012 12:28:22 +0300 [thread overview]
Message-ID: <4FB4C4B6.6000203@redhat.com> (raw)
In-Reply-To: <42ba7beaa25855997e02fea91a11c9224c51720e.1337168687.git.mst@redhat.com>
On 05/16/2012 02:46 PM, Michael S. Tsirkin wrote:
> Implementation of PV EOI using shared memory.
> This reduces the number of exits an interrupt
> causes as much as by half.
>
> The idea is simple: there's a bit, per APIC, in guest memory,
> that tells the guest that it does not need EOI.
> We set it before injecting an interrupt and clear
> before injecting a nested one. Guest tests it using
> a test and clear operation - this is necessary
> so that host can detect interrupt nesting -
> and if set, it can skip the EOI MSR.
>
> There's a new MSR to set the address of said register
> in guest memory. Otherwise not much changed:
> - Guest EOI is not required
> - Register is tested & ISR is automatically cleared on exit
>
> For testing results see description of previous patch
> 'kvm_para: guest side for eoi avoidance'.
>
>
> + /*
> + * It's legal for guest to ignore the PV EOI optimization
> + * and signal EOI by APIC write. If this happens, clear
> + * PV EOI on guest's behalf.
> + */
> + if (pv_eoi_enabled(apic->vcpu))
> + pv_eoi_clr_pending(apic->vcpu);
I'm a little worried about all the clr_pending() calls scattered
around. What happens if we forget one? In particular, we might miss
one on nested vmentry.
A safer path is to always clear it, but to enable it again during
reentry if all conditions are satisified. Might be a little slower though.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-05-17 9:28 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-16 11:45 [PATCHv4 0/5] apic: eoi optimization support Michael S. Tsirkin
2012-05-16 11:45 ` [PATCHv4 1/5] kvm_para: guest side for eoi avoidance Michael S. Tsirkin
2012-05-16 11:46 ` [PATCHv4 2/5] x86/bitops: note on __test_and_clear_bit atomicity Michael S. Tsirkin
2012-05-16 11:46 ` [PATCHv4 3/5] kvm: host side for eoi optimization Michael S. Tsirkin
2012-05-16 15:49 ` Marcelo Tosatti
2012-05-16 16:22 ` Michael S. Tsirkin
2012-05-16 16:32 ` Gleb Natapov
2012-05-16 16:50 ` Michael S. Tsirkin
2012-05-16 17:04 ` Marcelo Tosatti
2012-05-16 17:21 ` Gleb Natapov
2012-05-16 17:23 ` Marcelo Tosatti
2012-05-16 17:34 ` Gleb Natapov
2012-05-16 17:40 ` Marcelo Tosatti
2012-05-16 17:48 ` Gleb Natapov
2012-05-16 17:53 ` Michael S. Tsirkin
2012-05-16 17:20 ` Marcelo Tosatti
2012-05-16 17:58 ` Michael S. Tsirkin
2012-05-16 18:15 ` Marcelo Tosatti
2012-05-16 18:25 ` Gleb Natapov
2012-05-16 18:29 ` Michael S. Tsirkin
2012-05-16 18:38 ` Gleb Natapov
2012-05-16 19:07 ` Michael S. Tsirkin
2012-05-16 21:37 ` Marcelo Tosatti
2012-05-17 7:28 ` Gleb Natapov
2012-05-17 7:49 ` Michael S. Tsirkin
2012-05-17 7:56 ` Gleb Natapov
2012-05-17 7:57 ` Avi Kivity
2012-05-17 8:07 ` Gleb Natapov
2012-05-17 9:24 ` Avi Kivity
2012-05-17 9:34 ` Gleb Natapov
2012-05-17 9:10 ` Michael S. Tsirkin
2012-05-17 9:12 ` Gleb Natapov
2012-05-17 9:25 ` Avi Kivity
2012-05-16 18:28 ` Michael S. Tsirkin
2012-05-16 18:35 ` Michael S. Tsirkin
2012-05-17 9:28 ` Avi Kivity [this message]
2012-05-16 11:46 ` [PATCHv4 4/5] kvm: eoi msi documentation Michael S. Tsirkin
2012-05-16 11:46 ` [PATCHv4 5/5] kvm: only sync when attention bits set Michael S. Tsirkin
2012-05-16 15:41 ` [PATCHv4 0/5] apic: eoi optimization support Michael S. Tsirkin
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=4FB4C4B6.6000203@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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 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.