From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH] KVM/VMX: Check ept_pointer before flushing ept tlb Date: Wed, 07 Nov 2018 11:49:05 +0100 Message-ID: <8736sdupr2.fsf@vitty.brq.redhat.com> References: <20181106133043.83570-1-Tianyu.Lan@microsoft.com> <87lg66urwd.fsf@vitty.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Lan Tianyu , pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, michael.h.kelley@microsoft.com, kys@microsoft.com To: Tianyu Lan Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Tianyu Lan writes: > Hi Vitaly: > Thanks for your review. > > On 11/6/2018 11:50 PM, Vitaly Kuznetsov wrote: >> ltykernel@gmail.com writes: >> >>> From: Lan Tianyu >>> >>> This patch is to initialize ept_pointer to INVALID_PAGE and check it >>> before flushing ept tlb. If ept_pointer is invalidated, bypass the flush >>> request. >>> >> >> To be honest I fail to understand the reason behind the patch: instead >> of doing one unneeded flush request with ept_pointer==0 (after vCPU is >> initialized) we now do the check every time. Could you please elaborate >> on why this is needed? > > The reason to introduce the check here is to avoid flushing ept tlb > without valid ept table. When nested guest boots up and only BP is > active, we should not do flush for APs and L1 hypervisor hasn't set > valid EPT table for APs. Yes, I understand that but I'm trying to avoid additional checks on hotpath as during normal operation EPT pointer is always set. Could we just initialize ept_pointers_match to something like EPT_POINTERS_NOTSET and achive the same result? -- Vitaly