From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 07/11] nEPT: Advertise EPT to L1 Date: Sun, 28 Apr 2013 11:22:16 +0200 Message-ID: <517CEA48.4000902@web.de> References: <1366958611-6935-1-git-send-email-jun.nakajima@intel.com> <1366958611-6935-2-git-send-email-jun.nakajima@intel.com> <1366958611-6935-3-git-send-email-jun.nakajima@intel.com> <1366958611-6935-4-git-send-email-jun.nakajima@intel.com> <1366958611-6935-5-git-send-email-jun.nakajima@intel.com> <1366958611-6935-6-git-send-email-jun.nakajima@intel.com> <1366958611-6935-7-git-send-email-jun.nakajima@intel.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2BPWXUHRJTFPPTTDWUTNO" Cc: kvm@vger.kernel.org To: Jun Nakajima Return-path: Received: from mout.web.de ([212.227.17.11]:54190 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928Ab3D1JWZ (ORCPT ); Sun, 28 Apr 2013 05:22:25 -0400 In-Reply-To: <1366958611-6935-7-git-send-email-jun.nakajima@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2BPWXUHRJTFPPTTDWUTNO Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2013-04-26 08:43, Jun Nakajima wrote: > 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 > Signed-off-by: Nadav Har'El > Signed-off-by: Jun Nakajima > Signed-off-by: Xinhao Xu > --- > arch/x86/kvm/vmx.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 66ead51..76df3a8 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -2027,6 +2027,7 @@ static u32 nested_vmx_secondary_ctls_low, nested_= vmx_secondary_ctls_high; > static u32 nested_vmx_pinbased_ctls_low, nested_vmx_pinbased_ctls_high= ; > static u32 nested_vmx_exit_ctls_low, nested_vmx_exit_ctls_high; > static u32 nested_vmx_entry_ctls_low, nested_vmx_entry_ctls_high; > +static u32 nested_vmx_ept_caps; > static __init void nested_vmx_setup_ctls_msrs(void) > { > /* > @@ -2102,6 +2103,18 @@ static __init void nested_vmx_setup_ctls_msrs(vo= id) > nested_vmx_secondary_ctls_low =3D 0; > nested_vmx_secondary_ctls_high &=3D > SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; > + 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 | VMX_EPT_EXTENT_GLOBAL_BIT | > + VMX_EPT_EXTENT_CONTEXT_BIT | > + VMX_EPT_EXTENT_INDIVIDUAL_BIT; > + nested_vmx_ept_caps &=3D vmx_capability.ept; > + } else > + nested_vmx_ept_caps =3D 0; > + > } > =20 > static inline bool vmx_control_verify(u32 control, u32 low, u32 high) > @@ -2201,8 +2214,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 This patch depends on #defines from the next one. Jan ------enig2BPWXUHRJTFPPTTDWUTNO 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/ iEYEARECAAYFAlF86kwACgkQitSsb3rl5xQ7bQCg3sTdfoBey6Sf/l+yliUqQsxv 9jIAoJNDbbZI9hy/LDDknU0QP+J7g9y4 =nMd6 -----END PGP SIGNATURE----- ------enig2BPWXUHRJTFPPTTDWUTNO--