diff options
author | Suresh Warrier <warrier@linux.vnet.ibm.com> | 2016-08-19 15:35:52 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2016-09-12 10:12:07 +1000 |
commit | f7af5209b87c592aad81da65bd104241aa43d36a (patch) | |
tree | fa79559eef76511beb8713dcc802efc6d272ed2a /arch/powerpc/kvm/book3s_hv_rm_xics.c | |
parent | e3c13e56a4717ee334837a20c596e527eb6355e1 (diff) | |
download | blackbird-op-linux-f7af5209b87c592aad81da65bd104241aa43d36a.tar.gz blackbird-op-linux-f7af5209b87c592aad81da65bd104241aa43d36a.zip |
KVM: PPC: Book3S HV: Complete passthrough interrupt in host
In existing real mode ICP code, when updating the virtual ICP
state, if there is a required action that cannot be completely
handled in real mode, as for instance, a VCPU needs to be woken
up, flags are set in the ICP to indicate the required action.
This is checked when returning from hypercalls to decide whether
the call needs switch back to the host where the action can be
performed in virtual mode. Note that if h_ipi_redirect is enabled,
real mode code will first try to message a free host CPU to
complete this job instead of returning the host to do it ourselves.
Currently, the real mode PCI passthrough interrupt handling code
checks if any of these flags are set and simply returns to the host.
This is not good enough as the trap value (0x500) is treated as an
external interrupt by the host code. It is only when the trap value
is a hypercall that the host code searches for and acts on unfinished
work by calling kvmppc_xics_rm_complete.
This patch introduces a special trap BOOK3S_INTERRUPT_HV_RM_HARD
which is returned by KVM if there is unfinished business to be
completed in host virtual mode after handling a PCI passthrough
interrupt. The host checks for this special interrupt condition
and calls into the kvmppc_xics_rm_complete, which is made an
exported function for this reason.
[paulus@ozlabs.org - moved logic to set r12 to BOOK3S_INTERRUPT_HV_RM_HARD
in book3s_hv_rmhandlers.S into the end of kvmppc_check_wake_reason.]
Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_rm_xics.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_rm_xics.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c index 17f5b851db8c..3b8d7ac0be7c 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_xics.c +++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c @@ -751,7 +751,7 @@ long kvmppc_deliver_irq_passthru(struct kvm_vcpu *vcpu, icp_eoi(irq_desc_get_chip(irq_map->desc), irq_map->r_hwirq, xirr); if (check_too_hard(xics, icp) == H_TOO_HARD) - return 1; + return 2; else return -2; } |