From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bharata B Rao Date: Thu, 04 Jun 2020 02:43:32 +0000 Subject: Re: [PATCH v1 3/4] KVM: PPC: Book3S HV: migrate remaining normal-GFNs to secure-GFNs in H_SVM_INIT_D Message-Id: <20200604023132.GC31382@in.ibm.com> List-Id: References: <1590892071-25549-1-git-send-email-linuxram@us.ibm.com> <1590892071-25549-4-git-send-email-linuxram@us.ibm.com> <20200601115518.GA31382@in.ibm.com> <20200601190535.GA6925@oc0525413822.ibm.com> <20200602100639.GB31382@in.ibm.com> <20200603231025.GA5772@oc0525413822.ibm.com> In-Reply-To: <20200603231025.GA5772@oc0525413822.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Ram Pai Cc: rcampbell@nvidia.com, ldufour@linux.ibm.com, cclaudio@linux.ibm.com, kvm-ppc@vger.kernel.org, aneesh.kumar@linux.ibm.com, sukadev@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com, david@gibson.dropbear.id.au On Wed, Jun 03, 2020 at 04:10:25PM -0700, Ram Pai wrote: > On Tue, Jun 02, 2020 at 03:36:39PM +0530, Bharata B Rao wrote: > > On Mon, Jun 01, 2020 at 12:05:35PM -0700, Ram Pai wrote: > > > On Mon, Jun 01, 2020 at 05:25:18PM +0530, Bharata B Rao wrote: > > > > On Sat, May 30, 2020 at 07:27:50PM -0700, Ram Pai wrote: > > > > > H_SVM_INIT_DONE incorrectly assumes that the Ultravisor has explicitly > > > > > called H_SVM_PAGE_IN for all secure pages. > > > > > > > > I don't think that is quite true. HV doesn't assume anything about > > > > secure pages by itself. > > > > > > Yes. Currently, it does not assume anything about secure pages. But I am > > > proposing that it should consider all pages (except the shared pages) as > > > secure pages, when H_SVM_INIT_DONE is called. > > > > Ok, then may be also add the proposed changes to H_SVM_INIT_DONE > > documentation. > > ok. > > > > > > > > > In other words, HV should treat all pages; except shared pages, as > > > secure pages once H_SVM_INIT_DONE is called. And this includes pages > > > added subsequently through memory hotplug. > > > > So after H_SVM_INIT_DONE, if HV touches a secure page for any > > reason and gets encrypted contents via page-out, HV drops the > > device pfn at that time. So what state we would be in that case? We > > have completed H_SVM_INIT_DONE, but still have a normal (but encrypted) > > page in HV? > > Good point. > > The corresponding GFN will continue to be a secure GFN. Just that its > backing PFN is not a device-PFN, but a memory-PFN. Also that backing > memory-PFN contains encrypted content. > > I will clarify this in the patch; about secure-GFN state. I feel all this is complicating the states in HV and is avoidable if UV just issued page-in calls during memslot registration uvcall. Regards, Bharata.