From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: Re: [PATCH] KVM: nVMX: initialize PML fields in vmcs02 Date: Tue, 4 Apr 2017 15:34:21 +0200 Message-ID: <5fa609fa-eb78-a62e-a4f0-1f1796f7bd4e@redhat.com> References: <20170404121853.28057-1-lprosek@redhat.com> <903edb56-6e81-b528-cc20-a710e91aba3b@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: KVM list , kai.huang@linux.intel.com, Wanpeng Li To: Ladi Prosek Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35516 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbdDDNeY (ORCPT ); Tue, 4 Apr 2017 09:34:24 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 04.04.2017 15:19, Ladi Prosek wrote: > On Tue, Apr 4, 2017 at 3:09 PM, David Hildenbrand wrote: >> >>>>> + if (enable_pml) { >>>>> + /* >>>>> + * Conceptually we want to copy the PML address and index from >>>>> + * vmcs01 here, and then back to vmcs01 on nested vmexit. But, >>>>> + * since we always flush the log on each vmexit, this happens >>>> >>>> we == KVM running in g2? >>>> >>>> If so, other hypervisors might handle this differently. >>> >>> No, we as KVM in L0. Hypervisors running in L1 do not see PML at all, >>> this is L0-only code. >> >> Okay, was just confused why we enable PML for our nested guest (L2) >> although not supported/enabled for guest hypervisors (L1). I would have >> guessed that it is to be kept disabled completely for nested guests >> (!SECONDARY_EXEC_ENABLE_PML). >> >> But I assume that this a mysterious detail of the MMU code I still have >> to look into in detail. > > L1 doesn't see PML but L0 uses it for its own bookkeeping. So it's > enabled in vmcs02 (what the CPU uses) but not in vmcs12 (what L1 > sees). So this looks just fine to me. But as I said, haven't looked that detailed into the MMU code yet. -- Thanks, David