From: David Hildenbrand Subject: Re: [PATCH v1 08/13] KVM: VMX: call ept_sync_global() with enable_ept only Date: Thu, 17 Aug 2017 12:06:33 +0200 Message-ID: <9013bcfc-d2ea-665b-846c-728e9e624a97@redhat.com> References: <20170804131428.15844-1-david@redhat.com> <20170804131428.15844-9-david@redhat.com> <5916587c-6ba9-6e29-0408-9601cf61d3bc@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= To: Paolo Bonzini , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750857AbdHQKGf (ORCPT ); Thu, 17 Aug 2017 06:06:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 995CC5275A for ; Thu, 17 Aug 2017 10:06:35 +0000 (UTC) In-Reply-To: <5916587c-6ba9-6e29-0408-9601cf61d3bc@redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 14.08.2017 12:25, Paolo Bonzini wrote: > On 04/08/2017 15:14, David Hildenbrand wrote: >> ept_* function should only be called with enable_ept being set. >> >> Signed-off-by: David Hildenbrand >> --- >> arch/x86/kvm/vmx.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c >> index 4709032..11dfdca 100644 >> --- a/arch/x86/kvm/vmx.c >> +++ b/arch/x86/kvm/vmx.c >> @@ -3512,7 +3512,8 @@ static int hardware_enable(void) >> wrmsrl(MSR_IA32_FEATURE_CONTROL, old | test_bits); >> } >> kvm_cpu_vmxon(phys_addr); >> - ept_sync_global(); >> + if (enable_ept) >> + ept_sync_global(); >> >> return 0; >> } >> > > We probably should also disable EPT if !cpu_has_vmx_invept_global() in > hardware_setup, and remove the "if" from ept_sync_global(). > > Paolo > Sounds good, I'll add a patch to the next version of this series. -- Thanks, David