From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 6/7] KVM: nVMX: Implement support for EFER saving on VM-exit Date: Mon, 05 Aug 2013 09:35:59 +0200 Message-ID: <51FF55DF.1010905@web.de> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qOf4be0VVmkjm1bew4ITIAToXh4PR1sx6" Cc: Gleb Natapov , Paolo Bonzini , kvm , Xiao Guangrong , Jun Nakajima , Yang Zhang To: Arthur Chunqi Li Return-path: Received: from mout.web.de ([212.227.15.14]:60650 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754800Ab3HEHgD (ORCPT ); Mon, 5 Aug 2013 03:36:03 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LetQh-1UFssh2WUB-00qjMq for ; Mon, 05 Aug 2013 09:36:01 +0200 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qOf4be0VVmkjm1bew4ITIAToXh4PR1sx6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-08-05 09:21, Arthur Chunqi Li wrote: > On Mon, Aug 5, 2013 at 1:49 AM, Jan Kiszka wrote: >> From: Jan Kiszka >> >> Implement and advertise VM_EXIT_SAVE_IA32_EFER. L0 traps EFER writes >> unconditionally, so we always find the current L2 value in the >> architectural state. >> >> Signed-off-by: Jan Kiszka >> --- >> arch/x86/kvm/vmx.c | 4 +++- >> 1 files changed, 3 insertions(+), 1 deletions(-) >> >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index 84a05b4..7208d0b 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -2203,7 +2203,7 @@ static __init void nested_vmx_setup_ctls_msrs(vo= id) >> nested_vmx_exit_ctls_high =3D 0; >> #endif >> nested_vmx_exit_ctls_high |=3D (VM_EXIT_ALWAYSON_WITHOUT_TRUE_= MSR | >> - VM_EXIT_LOAD_IA32_EFER); >> + VM_EXIT_LOAD_IA32_EFER | VM_EXIT_SAVE_IA32_EFER); > Here you may need to access MSR_IA32_VMX_EXIT_CTLS first to check if > host support these two features. The codes for "entry controls" > following it can achieve goals like this. We are providing this feature independently of the host's support. Every write to EFER is trapped by L0, so we can emulate saving by reading what L0 recorded. Jan --qOf4be0VVmkjm1bew4ITIAToXh4PR1sx6 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/ iEYEARECAAYFAlH/Vd8ACgkQitSsb3rl5xSdHgCfbYrBYegexlBlgnaABMOp6d39 JHEAnigZSviA0xMJlaeMUR4cEKfYfF4U =xliY -----END PGP SIGNATURE----- --qOf4be0VVmkjm1bew4ITIAToXh4PR1sx6--