From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bharata B Rao Date: Mon, 11 Nov 2019 06:55:37 +0000 Subject: Re: [PATCH v10 6/8] KVM: PPC: Support reset of secure guest Message-Id: <20191111065522.GH21634@in.ibm.com> List-Id: References: <20191104041800.24527-1-bharata@linux.ibm.com> <20191104041800.24527-7-bharata@linux.ibm.com> <20191111052806.GC4017@oak.ozlabs.ibm.com> In-Reply-To: <20191111052806.GC4017@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 Mon, Nov 11, 2019 at 04:28:06PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:58AM +0530, Bharata B Rao wrote: > > Add support for reset of secure guest via a new ioctl KVM_PPC_SVM_OFF. > > This ioctl will be issued by QEMU during reset and includes the > > the following steps: > > > > - Ask UV to terminate the guest via UV_SVM_TERMINATE ucall > > - Unpin the VPA pages so that they can be migrated back to secure > > side when guest becomes secure again. This is required because > > pinned pages can't be migrated. > > Unpinning the VPA pages is normally handled during VM reset by QEMU > doing set_one_reg operations to set the values for the > KVM_REG_PPC_VPA_ADDR, KVM_REG_PPC_VPA_SLB and KVM_REG_PPC_VPA_DTL > pseudo-registers to zero. Is there some reason why this isn't > happening for a secure VM, and if so, what is that reason? > If it is happening, then why do we need to unpin the pages explicitly > here? We were observing these VPA pages still remaining pinned during reset and hence subsequent paging-in of these pages were failing. Unpinning them fixed the problem. I will investigate and get back on why exactly these pages weren't gettting unpinned normally as part of reset. > > > - Reinitialize guest's partitioned scoped page tables. These are > > freed when guest becomes secure (H_SVM_INIT_DONE) > > It doesn't seem particularly useful to me to free the partition-scoped > page tables when the guest becomes secure, and it feels like it makes > things more fragile. If you don't free them then, then you don't need > to reallocate them now. Sure, I will not free them in the next version. Regards, Bharata.