From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bharata B Rao Date: Wed, 06 Nov 2019 08:48:44 +0000 Subject: Re: [PATCH v10 4/8] KVM: PPC: Radix changes for secure guest Message-Id: <20191106083644.GE21634@in.ibm.com> List-Id: References: <20191104041800.24527-1-bharata@linux.ibm.com> <20191104041800.24527-5-bharata@linux.ibm.com> <20191106055823.GE12069@oak.ozlabs.ibm.com> In-Reply-To: <20191106055823.GE12069@oak.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, linux-mm@kvack.org, paulus@au1.ibm.com, aneesh.kumar@linux.vnet.ibm.com, jglisse@redhat.com, cclaudio@linux.ibm.com, linuxram@us.ibm.com, sukadev@linux.vnet.ibm.com, hch@lst.de On Wed, Nov 06, 2019 at 04:58:23PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:56AM +0530, Bharata B Rao wrote: > > - After the guest becomes secure, when we handle a page fault of a page > > belonging to SVM in HV, send that page to UV via UV_PAGE_IN. > > - Whenever a page is unmapped on the HV side, inform UV via UV_PAGE_INVAL. > > - Ensure all those routines that walk the secondary page tables of > > the guest don't do so in case of secure VM. For secure guest, the > > active secondary page tables are in secure memory and the secondary > > page tables in HV are freed when guest becomes secure. > > Why do we free the page tables? Just to save a little memory? It > feels like it would make things more fragile. I guess we could just leave the page tables around and they would get populated again if and when the guest is reset (i,e., when it goes back to non-secure mode) However it appeared cleaner to cleanup the page tables given that aren't in user any longer. > > Also, I don't see where the freeing gets done in this patch. There isn't a very good reason for freeing code to be not part of this patch. I just put that in reset patch (6/8) where there is code for reinitializing page tables again. Regards, Bharata.