• Paul Mackerras's avatar
    KVM: PPC: Book3S HV: Don't do ultravisor calls on systems without ultravisor · d89c69f4
    Paul Mackerras authored
    Commit 22945688 ("KVM: PPC: Book3S HV: Support reset of secure
    guest") added a call to uv_svm_terminate, which is an ultravisor
    call, without any check that the guest is a secure guest or even that
    the system has an ultravisor.  On a system without an ultravisor,
    the ultracall will degenerate to a hypercall, but since we are not
    in KVM guest context, the hypercall will get treated as a system
    call, which could have random effects depending on what happens to
    be in r0, and could also corrupt the current task's kernel stack.
    Hence this adds a test for the guest being a secure guest before
    doing uv_svm_terminate().
    
    Fixes: 22945688 ("KVM: PPC: Book3S HV: Support reset of secure guest")
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    d89c69f4
book3s_hv.c 148 KB