summaryrefslogtreecommitdiff
path: root/arch/powerpc/kvm/book3s_hv_builtin.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2017-02-08 19:35:34 +1100
committerPaul Mackerras <paulus@ozlabs.org>2017-02-08 19:35:34 +1100
commita4a741a04814170358f470d7103f8b13ceb6fefc (patch)
treed1ce5e0563befbdc5c777dc008e8d1ae029320b6 /arch/powerpc/kvm/book3s_hv_builtin.c
parent050f23390f6bdbfa7dd2800884d32490489851b7 (diff)
parentab9bad0ead9ab179ace09988a3f1cfca122eb7c2 (diff)
Merge remote-tracking branch 'remotes/powerpc/topic/ppc-kvm' into kvm-ppc-next
This merges in a fix which touches both PPC and KVM code, which was therefore put into a topic branch in the powerpc tree. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_builtin.c')
-rw-r--r--arch/powerpc/kvm/book3s_hv_builtin.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
index 96e7e609f621..c42a7e63b39e 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -29,11 +29,6 @@
#include <asm/opal.h>
#include <asm/smp.h>
-static bool in_realmode(void)
-{
- return !(mfmsr() & MSR_IR);
-}
-
#define KVM_CMA_CHUNK_ORDER 18
/*
@@ -230,13 +225,10 @@ void kvmhv_rm_send_ipi(int cpu)
/* Else poke the target with an IPI */
xics_phys = paca[cpu].kvm_hstate.xics_phys;
- if (!in_realmode())
- opal_int_set_mfrr(get_hard_smp_processor_id(cpu), IPI_PRIORITY);
- else if (xics_phys)
+ if (xics_phys)
rm_writeb(xics_phys + XICS_MFRR, IPI_PRIORITY);
else
- opal_rm_int_set_mfrr(get_hard_smp_processor_id(cpu),
- IPI_PRIORITY);
+ opal_int_set_mfrr(get_hard_smp_processor_id(cpu), IPI_PRIORITY);
}
/*
@@ -419,10 +411,8 @@ static long kvmppc_read_one_intr(bool *again)
/* Now read the interrupt from the ICP */
xics_phys = local_paca->kvm_hstate.xics_phys;
rc = 0;
- if (!in_realmode())
+ if (!xics_phys)
rc = opal_int_get_xirr(&xirr, false);
- else if (!xics_phys)
- rc = opal_rm_int_get_xirr(&xirr, false);
else
xirr = _lwzcix(xics_phys + XICS_XIRR);
if (rc < 0)
@@ -453,15 +443,12 @@ static long kvmppc_read_one_intr(bool *again)
*/
if (xisr == XICS_IPI) {
rc = 0;
- if (!in_realmode()) {
- opal_int_set_mfrr(hard_smp_processor_id(), 0xff);
- rc = opal_int_eoi(h_xirr);
- } else if (xics_phys) {
+ if (xics_phys) {
_stbcix(xics_phys + XICS_MFRR, 0xff);
_stwcix(xics_phys + XICS_XIRR, xirr);
} else {
- opal_rm_int_set_mfrr(hard_smp_processor_id(), 0xff);
- rc = opal_rm_int_eoi(h_xirr);
+ opal_int_set_mfrr(hard_smp_processor_id(), 0xff);
+ rc = opal_int_eoi(h_xirr);
}
/* If rc > 0, there is another interrupt pending */
*again = rc > 0;
@@ -482,14 +469,11 @@ static long kvmppc_read_one_intr(bool *again)
/* We raced with the host,
* we need to resend that IPI, bummer
*/
- if (!in_realmode())
- opal_int_set_mfrr(hard_smp_processor_id(),
- IPI_PRIORITY);
- else if (xics_phys)
+ if (xics_phys)
_stbcix(xics_phys + XICS_MFRR, IPI_PRIORITY);
else
- opal_rm_int_set_mfrr(hard_smp_processor_id(),
- IPI_PRIORITY);
+ opal_int_set_mfrr(hard_smp_processor_id(),
+ IPI_PRIORITY);
/* Let side effects complete */
smp_mb();
return 1;