• Suresh E. Warrier's avatar
    KVM: PPC: Book3S HV: Send IPI to host core to wake VCPU · e17769eb
    Suresh E. Warrier authored
    This patch adds support to real-mode KVM to search for a core
    running in the host partition and send it an IPI message with
    VCPU to be woken. This avoids having to switch to the host
    partition to complete an H_IPI hypercall when the VCPU which
    is the target of the the H_IPI is not loaded (is not running
    in the guest).
    
    The patch also includes the support in the IPI handler running
    in the host to do the wakeup by calling kvmppc_xics_ipi_action
    for the PPC_MSG_RM_HOST_ACTION message.
    
    When a guest is being destroyed, we need to ensure that there
    are no pending IPIs waiting to wake up a VCPU before we free
    the VCPUs of the guest. This is accomplished by:
    - Forces a PPC_MSG_CALL_FUNCTION IPI to be completed by all CPUs
      before freeing any VCPUs in kvm_arch_destroy_vm().
    - Any PPC_MSG_RM_HOST_ACTION messages must be executed first
      before any other PPC_MSG_CALL_FUNCTION messages.
    Signed-off-by: default avatarSuresh Warrier <warrier@linux.vnet.ibm.com>
    Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    e17769eb
smp.c 18.7 KB