From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH v3 1/6] KVM: Don't use KVM_REQ_PENDING_TIMER
Date: Tue, 10 Jul 2012 12:13:20 +0300 [thread overview]
Message-ID: <4FFBF230.8010700@redhat.com> (raw)
In-Reply-To: <20120710085002.GB23898@redhat.com>
On 07/10/2012 11:50 AM, Gleb Natapov wrote:
> On Mon, Jul 09, 2012 at 08:05:40PM +0300, Avi Kivity wrote:
> > It's a write-only bit, set by the timer and cleared by the main loop.
> > Remove it. Retain the definition since ppc uses it.
> >
> > Signed-off-by: Avi Kivity <avi@redhat.com>
> > ---
> > arch/x86/kvm/timer.c | 8 ++------
> > arch/x86/kvm/x86.c | 1 -
> > 2 files changed, 2 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/x86/kvm/timer.c b/arch/x86/kvm/timer.c
> > index 6b85cc6..c28f838 100644
> > --- a/arch/x86/kvm/timer.c
> > +++ b/arch/x86/kvm/timer.c
> > @@ -27,14 +27,10 @@ enum hrtimer_restart kvm_timer_fn(struct hrtimer *data)
> > /*
> > * There is a race window between reading and incrementing, but we do
> > * not care about potentially losing timer events in the !reinject
> > - * case anyway. Note: KVM_REQ_PENDING_TIMER is implicitly checked
> > - * in vcpu_enter_guest.
> So what about the part that says "KVM_REQ_PENDING_TIMER is implicitly
> checked in vcpu_enter_guest"? This patch drops the check. So now if
> timer triggers while vcpu is in userspace it will enter guest mode
> without injecting timer interrupt on the next ioctl(KVM_RUN). Or do I
> miss something here?
You're right, the bit appears to be write-only, but it isn't. The check
inside the critical section for vcpu->requests reads it.
I guess we can make the check explicit by doing a 'goto out' if the bit
is set.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
next prev parent reply other threads:[~2012-07-10 9:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 17:05 [PATCH v3 0/6] Optimize vcpu->requests processing Avi Kivity
2012-07-09 17:05 ` [PATCH v3 1/6] KVM: Don't use KVM_REQ_PENDING_TIMER Avi Kivity
2012-07-10 8:50 ` Gleb Natapov
2012-07-10 9:13 ` Avi Kivity [this message]
2012-07-09 17:05 ` [PATCH v3 2/6] KVM: Simplify KVM_REQ_EVENT/req_int_win handling Avi Kivity
2012-07-09 17:05 ` [PATCH v3 3/6] KVM: Move mmu reload out of line Avi Kivity
2012-07-10 3:57 ` Xiao Guangrong
2012-07-10 7:48 ` Avi Kivity
2012-07-09 17:05 ` [PATCH v3 4/6] KVM: Optimize vcpu->requests checking Avi Kivity
2012-07-09 17:05 ` [PATCH v3 5/6] KVM: Reorder KVM_REQ_EVENT to optimize processing Avi Kivity
2012-07-09 17:05 ` [PATCH v3 6/6] KVM: Clean up vcpu->requests == 0 processing Avi Kivity
2012-09-24 5:55 ` [PATCH v3 0/6] Optimize vcpu->requests processing Xiao Guangrong
2012-09-24 9:48 ` Avi Kivity
2012-09-24 10:19 ` Xiao Guangrong
2012-09-24 10:52 ` Avi Kivity
2012-09-24 11:16 ` Xiao Guangrong
2012-09-24 12:12 ` 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=4FFBF230.8010700@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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.