From: Ram Pai Date: Fri, 03 Jan 2020 20:37:12 +0000 Subject: Re: [PATCH v4 2/2] KVM: PPC: Implement H_SVM_INIT_ABORT hcall Message-Id: <20200103203712.GG5556@oc0525413822.ibm.com> List-Id: References: <20191219215146.27278-1-sukadev@linux.ibm.com> <20191219215146.27278-2-sukadev@linux.ibm.com> In-Reply-To: <20191219215146.27278-2-sukadev@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sukadev Bhattiprolu Cc: Michael Ellerman , Paul Mackerras , bharata@linux.ibm.com, linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org, linux-mm@kvack.org On Thu, Dec 19, 2019 at 01:51:46PM -0800, Sukadev Bhattiprolu wrote: > Implement the H_SVM_INIT_ABORT hcall which the Ultravisor can use to > abort an SVM after it has issued the H_SVM_INIT_START and before the > H_SVM_INIT_DONE hcalls. This hcall could be used when Ultravisor > encounters security violations or other errors when starting an SVM. > ..snip.. > +unsigned long kvmppc_h_svm_init_abort(struct kvm *kvm) > +{ > + int srcu_idx; > + struct kvm_memory_slot *memslot; > + > + /* > + * Expect to be called only after INIT_START and before INIT_DONE. > + * If INIT_DONE was completed, use normal VM termination sequence. > + */ > + if (!(kvm->arch.secure_guest & KVMPPC_SECURE_INIT_START) || > + (kvm->arch.secure_guest & KVMPPC_SECURE_INIT_DONE)) > + return H_UNSUPPORTED; Ah.. this version has already incorporated my prior comment! I should have reviewed your v4 version first. One small comment.. H_STATE is a better return code than H_UNSUPPORTED. RP