From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: Don't mistreat edge-triggered INIT IPI as INIT de-assert. (LAPIC) Date: Fri, 23 Dec 2011 08:40:31 -0200 Message-ID: <20111223104031.GB24308@amt.cnet> References: <1324257267-17200-1-git-send-email-js@alien8.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Julian Stecklina Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18387 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756758Ab1LWLiu (ORCPT ); Fri, 23 Dec 2011 06:38:50 -0500 Content-Disposition: inline In-Reply-To: <1324257267-17200-1-git-send-email-js@alien8.de> Sender: kvm-owner@vger.kernel.org List-ID: 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). > Signed-off-by: Julian Stecklina > --- > 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 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html