From: Nadav Har'El Subject: Re: [PATCH 08/10] nEPT: Nested INVEPT Date: Sun, 11 Dec 2011 16:24:54 +0200 Message-ID: <20111211142454.GA9179@fermat.math.technion.ac.il> References: <1320919040-nyh@il.ibm.com> <201111101001.pAAA1vqV019702@rice.haifa.ibm.com> <4EBBC0F2.8040002@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, "Roedel, Joerg" , owasserm@redhat.com, abelg@il.ibm.com To: Avi Kivity Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:26784 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751914Ab1LKOZA (ORCPT ); Sun, 11 Dec 2011 09:25:00 -0500 Content-Disposition: inline In-Reply-To: <4EBBC0F2.8040002@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Nov 10, 2011, Avi Kivity wrote about "Re: [PATCH 08/10] nEPT: Nested INVEPT": > On 11/10/2011 12:01 PM, Nadav Har'El wrote: > > If we let L1 use EPT, we should probably also support the INVEPT instruction. >.. > > + if (vmcs12 && nested_cpu_has_ept(vmcs12) && > > + (vmcs12->ept_pointer == operand.eptp) && > > + vmx->nested.last_eptp02) > > + ept_sync_context(vmx->nested.last_eptp02); > > + else > > + ept_sync_global(); > > Are either of these needed? Won't a write to a shadowed EPT table cause > them anyway? This is very good point... You're right that as it stands, any changes to the guest EPT table (EPT12) will cause changes to the shadow EPT table (EPT02), and these already cause KVM to do an INVEPT, so no point to do this again when the guest asks. So basically, I can have INVEPT emulated by doing absolutely nothing (after checking all the checks), right? I wonder if I am missing any reason why a hypervisor might want to do INVEPT without changing the EPT12 table first. -- Nadav Har'El | Sunday, Dec 11 2011, nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Why do programmers mix up Christmas and http://nadav.harel.org.il |Halloween? Because DEC 25 = OCT 31