From: Julian Stecklina <js@alien8.de>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Don't mistreat edge-triggered INIT IPI as INIT de-assert. (LAPIC)
Date: Thu, 12 Jan 2012 18:07:51 +0100 [thread overview]
Message-ID: <1326388071.12267.13.camel@tabernacle> (raw)
In-Reply-To: <20111223104031.GB24308@amt.cnet>
[-- Attachment #1: Type: text/plain, Size: 2144 bytes --]
Am Freitag, den 23.12.2011, 08:40 -0200 schrieb Marcelo Tosatti:
> On Mon, Dec 19, 2011 at 02:14:27AM +0100, Julian Stecklina wrote:
> > If the guest programs an IPI with level=0 (de-assert) and trig_mode=0 (edge),
> > it is erroneously treated as INIT de-assert and ignored, but to quote the
> > spec: "For this delivery mode [INIT de-assert], the level flag must be set to
> > 0 and trigger mode flag to 1."
>
> Yes, the implementation ignores INIT de-assert. Quoting the spec:
>
> "(INIT Level De-assert) (Not supported in the Pentium 4 and Intel Xeon
> processors.)"
>
> Your patch below is not improving the implementation to be closer to the
> spec: it'll trigger the INIT state initialization with trig_mode == 0
> (which is not in accordance with your spec quote above).
After reading the spec again and consulting with the guy who wrote the
code triggering this, it seems the whole "if (level)" in the code path
below is superfluous. Regarding level my spec says:
"This flag has no meaning in Pentium 4 and Intel Xeon processors, and
will always be issued as a 1."
Judging from Section 10.2 this means every CPU where the LAPICs
communicate over the system bus (everything after and including the P4).
Thus the if can be removed, since its condition is always true
(regardless of what the programmer actually programmed into the level
field).
If there is no objection, I'll submit a revised patch.
> > Signed-off-by: Julian Stecklina <js@alien8.de>
> > ---
> > arch/x86/kvm/lapic.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> > index a7f3e65..260770d 100644
> > --- a/arch/x86/kvm/lapic.c
> > +++ b/arch/x86/kvm/lapic.c
> > @@ -433,7 +433,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
> > break;
> >
> > case APIC_DM_INIT:
> > - if (level) {
> > + if (!trig_mode || level) {
> > result = 1;
> > vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
> > kvm_make_request(KVM_REQ_EVENT, vcpu);
> > --
> > 1.7.7.4
> >
Regards, Julian
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-01-12 17:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 1:14 [PATCH] KVM: Don't mistreat edge-triggered INIT IPI as INIT de-assert. (LAPIC) Julian Stecklina
2011-12-23 10:40 ` Marcelo Tosatti
2011-12-23 14:07 ` Julian Stecklina
2012-01-12 17:07 ` Julian Stecklina [this message]
2012-01-13 10:52 ` Marcelo Tosatti
2012-01-13 11:46 ` Julian Stecklina
2012-01-16 10:18 ` Marcelo Tosatti
2012-01-16 13:02 ` js
2012-01-24 11:09 ` Marcelo Tosatti
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=1326388071.12267.13.camel@tabernacle \
--to=js@alien8.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox