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: Tue, 31 Dec 2013 09:55:11 +0100 Message-ID: <52C2866F.5070101@web.de> References: <1388436989-8597-1-git-send-email-zzhsuny@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="28tPKjbLwawB0Bks8OtT9PB3rG1e51reD" 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.15.3]:52218 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027Ab3LaIzS (ORCPT ); Tue, 31 Dec 2013 03:55:18 -0500 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0M7KR8-1VC10l0JMs-00x4bh for ; Tue, 31 Dec 2013 09:55:17 +0100 In-Reply-To: <1388436989-8597-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) --28tPKjbLwawB0Bks8OtT9PB3rG1e51reD Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2013-12-30 21:56, Zhihui Zhang wrote: > According to Table C-1 of Intel SDM 3C, a VM exit happens on an I/O ins= truction when > "use I/O bitmaps" VM-execution control was 0 _and_ the "unconditional I= /O exiting" > VM-execution control was 1. So we can't just check "unconditional I/O e= xiting" alone. > This patch was improved by suggestion from Jan Kiszka. >=20 > Signed-off-by: Zhihui Zhang > --- > arch/x86/kvm/vmx.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) >=20 > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index b2fe1c2..45617db 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -6460,11 +6460,8 @@ static bool nested_vmx_exit_handled_io(struct kv= m_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)) > - return 0; > + return nested_cpu_has(vmcs12, CPU_BASED_UNCOND_IO_EXITING); > =20 > exit_qualification =3D vmcs_readl(EXIT_QUALIFICATION); > =20 >=20 Reviewed-by: Jan Kiszka --28tPKjbLwawB0Bks8OtT9PB3rG1e51reD 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/ iEYEARECAAYFAlLChnMACgkQitSsb3rl5xRR8gCfcMBAWKbdTuuLxZ0MrxQH8AzA efQAn1/2ft+xJJchgHmnuIq8eoyvcYve =NfBw -----END PGP SIGNATURE----- --28tPKjbLwawB0Bks8OtT9PB3rG1e51reD--