From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 2/4] Rewrite twisted maze of if() statements with more straightforward switch() Date: Mon, 30 Mar 2009 18:03:58 +0200 Message-ID: <49D0ED6E.9070808@web.de> References: <20090329141202.30481.91797.stgit@trex.usersys.redhat.com> <20090329141207.30481.33603.stgit@trex.usersys.redhat.com> <49D07652.30502@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA4CCC91CEF48450ACC6E6135" Cc: Gleb Natapov , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:36907 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752559AbZC3QEE (ORCPT ); Mon, 30 Mar 2009 12:04:04 -0400 In-Reply-To: <49D07652.30502@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA4CCC91CEF48450ACC6E6135 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Avi Kivity wrote: > Gleb Natapov wrote: >> Signed-off-by: Gleb Natapov >> =20 >=20 > This is actually not just a rewrite, but also a bugfix: >=20 >> INTR_INFO); >> @@ -3289,34 +3288,42 @@ static void vmx_complete_interrupts(struct >> vcpu_vmx *vmx) >> vmx->vnmi_blocked_time +=3D >> ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time)); >> =20 >> + vmx->vcpu.arch.nmi_injected =3D false; >> + kvm_clear_exception_queue(&vmx->vcpu); >> + kvm_clear_interrupt_queue(&vmx->vcpu); >> + >> + if (!idtv_info_valid) >> + return; >> + >> vector =3D idt_vectoring_info & VECTORING_INFO_VECTOR_MASK; >> type =3D idt_vectoring_info & VECTORING_INFO_TYPE_MASK; >> - if (vmx->vcpu.arch.nmi_injected) { >> + =20 >> + switch(type) { >> + case INTR_TYPE_NMI_INTR: >> + vmx->vcpu.arch.nmi_injected =3D true; >> /* >> =20 >=20 > The existing code would leave nmi_injected =3D=3D false if we exit on > NMI_INTR, so we drop an NMI here. >=20 I think NMI_INTR and nmi_injected always go together. However, the rework looks good and more logical to me, too. Will see that I can give this (more precisely -v2) a try with our scenarios ASAP. Jan --------------enigA4CCC91CEF48450ACC6E6135 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAknQ7W8ACgkQniDOoMHTA+nVhgCeLie0yI36nBRwav3Rqz/bVQCN fH8An3jXdpD9/+y8UldWvNxxeDGy+I6m =WSp0 -----END PGP SIGNATURE----- --------------enigA4CCC91CEF48450ACC6E6135--