From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: nVMX: Disable unrestricted mode if ept=0 Date: Sun, 07 Dec 2014 11:22:25 +0100 Message-ID: <54842A61.5080006@web.de> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tnAe4I37OQdXeLG2SXP1FP80s71tudeI8" Cc: pbonzini@redhat.com, linux-kernel@vger.kernel.org To: Bandan Das , kvm@vger.kernel.org Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tnAe4I37OQdXeLG2SXP1FP80s71tudeI8 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 2014-12-06 16:02, Bandan Das wrote: >=20 > If L0 has disabled EPT, don't advertise unrestricted > mode at all since it depends on EPT to run real mode code. >=20 > Signed-off-by: Bandan Das > --- > arch/x86/kvm/vmx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 3e556c6..ed70394 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -2377,12 +2377,12 @@ static __init void nested_vmx_setup_ctls_msrs(v= oid) > nested_vmx_secondary_ctls_low =3D 0; > nested_vmx_secondary_ctls_high &=3D > SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES | > - SECONDARY_EXEC_UNRESTRICTED_GUEST | > SECONDARY_EXEC_WBINVD_EXITING; > =20 > if (enable_ept) { > /* nested EPT: emulate EPT also to L1 */ > - nested_vmx_secondary_ctls_high |=3D SECONDARY_EXEC_ENABLE_EPT; > + nested_vmx_secondary_ctls_high |=3D SECONDARY_EXEC_ENABLE_EPT | > + SECONDARY_EXEC_UNRESTRICTED_GUEST; > nested_vmx_ept_caps =3D VMX_EPT_PAGE_WALK_4_BIT | > VMX_EPTP_WB_BIT | VMX_EPT_2MB_PAGE_BIT | > VMX_EPT_INVEPT_BIT; >=20 Reviewed-by: Jan Kiszka Jan --tnAe4I37OQdXeLG2SXP1FP80s71tudeI8 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.22 (GNU/Linux) iEYEARECAAYFAlSEKmEACgkQitSsb3rl5xQehwCg6QOqwmMo6IoO55OMLRNh0pyg UmMAoMUoPtMqYUuauAs7bHu+mrAF4286 =+v5/ -----END PGP SIGNATURE----- --tnAe4I37OQdXeLG2SXP1FP80s71tudeI8--