From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2 4/4] KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP Date: Mon, 24 Mar 2014 19:14:17 +0100 Message-ID: <533075F9.3050007@redhat.com> References: <1395394081-16252-1-git-send-email-pbonzini@redhat.com> <1395394081-16252-5-git-send-email-pbonzini@redhat.com> <20140324175830.GA8721@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, gleb@kernel.org, mtosatti@redhat.com, alex.williamson@redhat.com, jan.kiszka@siemens.com To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14312 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753804AbaCXSOa (ORCPT ); Mon, 24 Mar 2014 14:14:30 -0400 In-Reply-To: <20140324175830.GA8721@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 24/03/2014 18:58, Radim Kr=C4=8Dm=C3=A1=C5=99 ha scritto: >> > + rtc_irq_eoi_tracking_reset(ioapic); >> > + for_each_set_bit(idx, &irr, IOAPIC_NUM_PINS) >> > + ioapic_set_irq(ioapic, idx, 1, true); >> > + >> > + kvm_rtc_eoi_tracking_restore_all(ioapic); > (We shouldn't have RTC interrupt with pending EOI in irr, so the > function could be independent. If the RTC state gets out of sync you get a BUG_ON, so I preferred to b= e=20 safe and first inject the interrupts without any recorded recipient of=20 GSI 8; and then put everything together based on both LAPIC and IOAPIC=20 state. > I'd prefer 'ioapic->irr =3D 0' here ...) The point is that "ioapic->irr =3D 0" is overriding the previous memcpy= ,=20 because state->irr is used as argument to kvm_ioapic_inject_all instead= =2E=20 So I think "iopic->irr =3D 0" should stay close to the memcpy. Paolo