linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org, Rob Landley <rob@landley.net>,
	Glauber Costa <glommer@redhat.com>,
	Rik van Riel <riel@redhat.com>, Avi Kivity <avi@redhat.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm: eoi msi documentation
Date: Sun, 13 May 2012 19:03:36 +0300	[thread overview]
Message-ID: <20120513160335.GA26928@redhat.com> (raw)
In-Reply-To: <20120513155622.GG15230@redhat.com>

On Sun, May 13, 2012 at 06:56:23PM +0300, Gleb Natapov wrote:
> > +	However, hypervisor can set and clear this memory bit at any time:
> > +	therefore to make sure hypervisor does not interrupt the
> > +	guest and clear the least significant bit in the memory area
> > +	in the window between guest testing it to detect
> > +	whether it can skip EOI apic write and between guest
> > +	clearing it to signal EOI to the hypervisor,
> > +	guest must both read the least sgnificant bit in the memory area and
> > +	clear it using a single CPU instruction, such as test and clear, or
> > +	compare and exchange.
> > +
> Looks good, but everything below this is here by mistake.

Ugh. Right. Good catch,

> Are You still
> going to resend host side patch to address my other comment?

Yes, like this.
I'll give more people a chance to review first though.


diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 77e0244..c7e6ffb 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1490,6 +1490,7 @@ int kvm_pv_enable_apic_eoi(struct kvm_vcpu *vcpu, u64 data)
 	if (eoi_enabled(vcpu))
 		eoi_clr_pending(vcpu);
 	vcpu->arch.eoi.msr_val = data;
-	kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.eoi.data, addr);
-	return 0;
+	if (!eoi_enabled(vcpu))
+		return 0;
+	return kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.eoi.data, addr);
 }

      reply	other threads:[~2012-05-13 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-13 15:13 [PATCH] kvm: eoi msi documentation Michael S. Tsirkin
2012-05-13 15:56 ` Gleb Natapov
2012-05-13 16:03   ` Michael S. Tsirkin [this message]

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=20120513160335.GA26928@redhat.com \
    --to=mst@redhat.com \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    --cc=rob@landley.net \
    /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;
as well as URLs for NNTP newsgroup(s).