From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v7 13/15] nEPT: Advertise EPT to L1 Date: Tue, 06 Aug 2013 10:20:45 +0200 Message-ID: <5200B1DD.508@web.de> References: <1375690040-5764-1-git-send-email-gleb@redhat.com> <1375690040-5764-14-git-send-email-gleb@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dxUl0HmRJTODcOi0GJ0ShoHpWIU9KTreK" Cc: kvm@vger.kernel.org, Xiao Guangrong , Jun Nakajima , Yang Zhang , pbonzini@redhat.com To: Gleb Natapov Return-path: Received: from mout.web.de ([212.227.15.14]:50095 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753526Ab3HFIUt (ORCPT ); Tue, 6 Aug 2013 04:20:49 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MfYXz-1VVhjR3PT9-00P2aL for ; Tue, 06 Aug 2013 10:20:48 +0200 In-Reply-To: <1375690040-5764-14-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dxUl0HmRJTODcOi0GJ0ShoHpWIU9KTreK Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2013-08-05 10:07, Gleb Natapov wrote: > From: Nadav Har'El >=20 > Advertise the support of EPT to the L1 guest, through the appropriate M= SR. >=20 > This is the last patch of the basic Nested EPT feature, so as to allow > bisection through this patch series: The guest will not see EPT support= until > this last patch, and will not attempt to use the half-applied feature. >=20 > Reviewed-by: Xiao Guangrong > Signed-off-by: Nadav Har'El > Signed-off-by: Jun Nakajima > Signed-off-by: Xinhao Xu > Signed-off-by: Yang Zhang > Signed-off-by: Gleb Natapov > --- > arch/x86/kvm/vmx.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) >=20 > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 51c06c2..c65a08a 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -2250,6 +2250,22 @@ static __init void nested_vmx_setup_ctls_msrs(vo= id) > SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES | > 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_ept_caps =3D VMX_EPT_PAGE_WALK_4_BIT; > + nested_vmx_ept_caps |=3D VMX_EPT_INVEPT_BIT; > + nested_vmx_ept_caps &=3D vmx_capability.ept; > + /* > + * Since invept is completely emulated we support both global > + * and context invalidation independent of what host cpu > + * supports > + */ > + nested_vmx_ept_caps |=3D VMX_EPT_EXTENT_GLOBAL_BIT | And another whitespace damage (space after tab). Jan > + VMX_EPT_EXTENT_CONTEXT_BIT; > + } else > + nested_vmx_ept_caps =3D 0; > + > /* miscellaneous data */ > rdmsr(MSR_IA32_VMX_MISC, nested_vmx_misc_low, nested_vmx_misc_high); > nested_vmx_misc_low &=3D VMX_MISC_PREEMPTION_TIMER_RATE_MASK | > @@ -2358,8 +2374,8 @@ static int vmx_get_vmx_msr(struct kvm_vcpu *vcpu,= u32 msr_index, u64 *pdata) > nested_vmx_secondary_ctls_high); > break; > case MSR_IA32_VMX_EPT_VPID_CAP: > - /* Currently, no nested ept or nested vpid */ > - *pdata =3D 0; > + /* Currently, no nested vpid support */ > + *pdata =3D nested_vmx_ept_caps; > break; > default: > return 0; >=20 --dxUl0HmRJTODcOi0GJ0ShoHpWIU9KTreK 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/ iEYEARECAAYFAlIAsd4ACgkQitSsb3rl5xQMwgCgzJVYul28pC0KK/N+Tn8VkBq+ kuUAn1xs69aPjXI1VwfJYc+96tSRx0zT =Sqa0 -----END PGP SIGNATURE----- --dxUl0HmRJTODcOi0GJ0ShoHpWIU9KTreK--