From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: nVMX: Improve I/O exit handling Date: Mon, 11 Feb 2013 11:16:25 +0100 Message-ID: <5118C4F9.707@web.de> References: <51180635.3060003@web.de> <20130211100721.GA11107@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2XVHTUGRMKFPLIMCIMCVV" Cc: Gleb Natapov , Marcelo Tosatti , kvm , Orit Wasserman To: Nadav Har'El Return-path: Received: from mout.web.de ([212.227.15.3]:62490 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754732Ab3BKKQu (ORCPT ); Mon, 11 Feb 2013 05:16:50 -0500 In-Reply-To: <20130211100721.GA11107@fermat.math.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2XVHTUGRMKFPLIMCIMCVV Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-02-11 11:07, Nadav Har'El wrote: > On Sun, Feb 10, 2013, Jan Kiszka wrote about "[PATCH] KVM: nVMX: Improv= e I/O exit handling": >> +static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, >> + struct vmcs12 *vmcs12) >> +{ >> + unsigned long exit_qualification; >> + gpa_t bitmap, last_bitmap; >> + bool string, rep; >> + u16 port; >> + int size; >> + u8 b; >> + >> + if (nested_cpu_has(get_vmcs12(vcpu), CPU_BASED_UNCOND_IO_EXITING)) >> + return 1; >=20 > Instead of calling get_vmcs12(vcpu), you can just use "vmcs12" variable= > which you already have. I see I left the same redundant call also in > nested_vmx_exit_handled_msr :( Indeed, copy&pasted from there... >=20 >> + if (port < 0x8000) >> + bitmap =3D vmcs12->io_bitmap_a; >> + else >> + bitmap =3D vmcs12->io_bitmap_b; >> + bitmap +=3D port / 8; >=20 > In the port >=3D 0x8000, I believe need to subtract 0x8000 from the por= t > number before using it as an offset into io_bitmap_b? Oops. There was already a stupid bug in that path, failed to validate it again. v2 will follow. Thanks for reviewing, Jan ------enig2XVHTUGRMKFPLIMCIMCVV 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.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlEYxP0ACgkQitSsb3rl5xQt+QCg0ZP908JV7o/Zzo34V3qdX52g yysAnjvZV034Wcb707EQFHAwNrZFSUSs =2jc/ -----END PGP SIGNATURE----- ------enig2XVHTUGRMKFPLIMCIMCVV--