From: Paolo Bonzini Subject: Re: [PATCH 4/4] x86: kvm: mmu: use ept a/d in vmcs02 iff used in vmcs12 Date: Sat, 1 Jul 2017 09:59:10 +0200 Message-ID: <8573a0e1-f4ef-b89f-0edc-059b7747cf79@redhat.com> References: <5bdf824538481ee2308354165e8ebe7b59b7b8a1.1498868316.git.pfeiner@google.com> <1103545766.13264371.1498886972980.JavaMail.zimbra@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm list , David Matlack To: Peter Feiner Return-path: Received: from mail-wm0-f52.google.com ([74.125.82.52]:35187 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751752AbdGAH7P (ORCPT ); Sat, 1 Jul 2017 03:59:15 -0400 Received: by mail-wm0-f52.google.com with SMTP id w126so127191946wme.0 for ; Sat, 01 Jul 2017 00:59:15 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 01/07/2017 09:29, Peter Feiner wrote: > You're right: this is busted. I wrote these patches before you > implemented EPT A/D nesting (i.e., PML was moot for guest mode). > > I think the patch hunk can go away entirely actually. As long as PML > is enabled, it's ok to flush the buffer. The interesting case is when > the vcpu is in guest mode with EPT A/D disabled. In this case, L0's > PML isn't filled while L2 runs because EPT A/D is disabled in the > vmcs02 (thanks to this patch), so there's nothing in the buffer! That was my thought too. > It's troubling is that there's no test case covering L0's use of PML + > nesting. Stress testing live migrations of L1 hypervisors (and > implicitly their L2 guests) is one way of doing it, but it's pretty > clumsy. A tightly coupled L0 userspace, L1 and L2 guests would be the > way to go because you could just coordinate ioctls with guest memory > accesses. Indeed. We need to do api/-style testing of nested virt. Paolo