From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] Check use I/O bitmap first before unconditional I/O exit Date: Mon, 30 Dec 2013 20:35:03 +0100 Message-ID: <52C1CAE7.9070605@web.de> References: <1388416188-3261-1-git-send-email-zzhsuny@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XTmCnau6qXOoE6aB6lRLg44nLOSIiVBAh" Cc: kvm@vger.kernel.org To: Zhihui Zhang , gleb@redhat.com, pbonzini@redhat.com, hpa@zytor.com Return-path: Received: from mout.web.de ([212.227.17.11]:49721 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094Ab3L3TfO (ORCPT ); Mon, 30 Dec 2013 14:35:14 -0500 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0Lr2dj-1VT4dI3XPP-00efgT for ; Mon, 30 Dec 2013 20:35:12 +0100 In-Reply-To: <1388416188-3261-1-git-send-email-zzhsuny@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XTmCnau6qXOoE6aB6lRLg44nLOSIiVBAh Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2013-12-30 16:09, Zhihui Zhang wrote: > Signed-off-by: Zhihui Zhang You should explain the "why" here, e.g. point to the SDM section that requires this ordering. > --- > arch/x86/kvm/vmx.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index b2fe1c2..44d4f829 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -6460,11 +6460,11 @@ static bool nested_vmx_exit_handled_io(struct k= vm_vcpu *vcpu, > int size; > u8 b; > =20 > - if (nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING)) > - return 1; > - > - if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) > + if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) { > + if (nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING)) > + return 1; Minor nit, but what about if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING); instead? Logic is correct, thanks for addressing this. Could you also write an according sub-test in kvm-unit-tests [1]? We are already checking IO bitmap accesses, but not yet unconditional PIO exiting. Would be great! Jan [1] https://git.kernel.org/cgit/virt/kvm/kvm-unit-tests.git > return 0; > + } > =20 > exit_qualification =3D vmcs_readl(EXIT_QUALIFICATION); > =20 >=20 --XTmCnau6qXOoE6aB6lRLg44nLOSIiVBAh 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.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlLByu0ACgkQitSsb3rl5xRmewCgmqR7oqT7C1JSsqY6f4U1ppl/ kY0AoJCo28tr6UgLpEBri3G/2E66PCUc =tuuF -----END PGP SIGNATURE----- --XTmCnau6qXOoE6aB6lRLg44nLOSIiVBAh--