From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: nVMX: Fully support of nested VMX preemption timer Date: Sun, 25 Aug 2013 09:44:43 +0200 Message-ID: <5219B5EB.9050900@web.de> References: <1377369850-18583-1-git-send-email-root@Blade1-01.Blade1-01> <5219A7BA.8050602@web.de> <5219B222.5070204@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gNO3IJQtNsO30AnKGmuSIhXm425FcwX9X" Cc: kvm , Gleb Natapov , Paolo Bonzini To: Arthur Chunqi Li Return-path: Received: from mout.web.de ([212.227.15.3]:62587 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754236Ab3HYHoq (ORCPT ); Sun, 25 Aug 2013 03:44:46 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MVLak-1VYyG543Is-00Yh8L for ; Sun, 25 Aug 2013 09:44:44 +0200 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gNO3IJQtNsO30AnKGmuSIhXm425FcwX9X Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-08-25 09:37, Arthur Chunqi Li wrote: > On Sun, Aug 25, 2013 at 3:28 PM, Jan Kiszka wrote: >> On 2013-08-25 09:24, Arthur Chunqi Li wrote: >>> On Sun, Aug 25, 2013 at 2:44 PM, Jan Kiszka wrote= : >>>> On 2013-08-24 20:44, root wrote: >>>>> This patch contains the following two changes: >>>>> 1. Fix the bug in nested preemption timer support. If vmexit L2->L0= >>>>> with some reasons not emulated by L1, preemption timer value should= >>>>> be save in such exits. >>>>> 2. Add support of "Save VMX-preemption timer value" VM-Exit control= s >>>>> to nVMX. >>>>> >>>>> With this patch, nested VMX preemption timer features are fully >>>>> supported. >>>>> >>>>> Signed-off-by: Arthur Chunqi Li >>>>> --- >>>>> arch/x86/kvm/vmx.c | 30 +++++++++++++++++++++++++----- >>>>> 1 file changed, 25 insertions(+), 5 deletions(-) >>>>> >>>>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >>>>> index 57b4e12..9579409 100644 >>>>> --- a/arch/x86/kvm/vmx.c >>>>> +++ b/arch/x86/kvm/vmx.c >>>>> @@ -2204,7 +2204,8 @@ static __init void nested_vmx_setup_ctls_msrs= (void) >>>>> #ifdef CONFIG_X86_64 >>>>> VM_EXIT_HOST_ADDR_SPACE_SIZE | >>>>> #endif >>>>> - VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT; >>>>> + VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT | >>>>> + VM_EXIT_SAVE_VMX_PREEMPTION_TIMER; >>>>> nested_vmx_exit_ctls_high |=3D (VM_EXIT_ALWAYSON_WITHOUT_TRUE= _MSR | >>>>> VM_EXIT_LOAD_IA32_EFER); >>>> >>>> In the absence of VM_EXIT_SAVE_VMX_PREEMPTION_TIMER, you need to hid= e >>>> PIN_BASED_VMX_PREEMPTION_TIMER from the guest as we cannot emulate i= ts >>>> behavior properly in that case. > Besides, we need to test that in the absence of > PIN_BASED_VMX_PREEMPTION_TIMER, we need to hide > VM_EXIT_SAVE_VMX_PREEMPTION_TIMER, though this should not happen > according to Intel SDM. If the SDM guarantees this for us, we don't need such a safety measure. Otherwise, it should be added, yes. Jan --gNO3IJQtNsO30AnKGmuSIhXm425FcwX9X 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/ iEYEARECAAYFAlIZtesACgkQitSsb3rl5xSs+gCgjKEkD0Eb1FTpB2mdlmB7u3wT KDQAoMK07MgQHrBuRC4a0vC13l8Nnb75 =WbUU -----END PGP SIGNATURE----- --gNO3IJQtNsO30AnKGmuSIhXm425FcwX9X--