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

Reply via email to