summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc64/dev/xive.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/powerpc64/dev/xive.c')
-rw-r--r--sys/arch/powerpc64/dev/xive.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/arch/powerpc64/dev/xive.c b/sys/arch/powerpc64/dev/xive.c
index babe34a9a3d..0271b605f17 100644
--- a/sys/arch/powerpc64/dev/xive.c
+++ b/sys/arch/powerpc64/dev/xive.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xive.c,v 1.10 2020/08/23 12:48:53 kettenis Exp $ */
+/* $OpenBSD: xive.c,v 1.11 2020/08/30 19:07:00 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
@@ -379,12 +379,6 @@ xive_hvi(struct trapframe *frame)
while (1) {
ack = xive_read_2(sc, XIVE_TM_SPC_ACK_HV);
- /* Synchronize software state to hardware state. */
- cppr = ack;
- new = xive_ipl(cppr);
- KASSERT(new >= ci->ci_cpl);
- ci->ci_cpl = new;
-
he = (ack & XIVE_TM_SPC_ACK_HE_MASK);
if (he == XIVE_TM_SPC_ACK_HE_NONE)
break;
@@ -392,6 +386,12 @@ xive_hvi(struct trapframe *frame)
eieio();
+ /* Synchronize software state to hardware state. */
+ cppr = ack;
+ new = xive_ipl(cppr);
+ ci->ci_cpl = new;
+ KASSERT(new > old);
+
KASSERT(cppr < XIVE_NUM_PRIORITIES);
eq = &sc->sc_eq[ci->ci_cpuid][cppr];
event = XIVE_DMA_KVA(eq->eq_queue);
@@ -428,10 +428,12 @@ xive_hvi(struct trapframe *frame)
if (eq->eq_idx == 0)
eq->eq_gen ^= XIVE_EQ_GEN_MASK;
}
- }
- ci->ci_cpl = old;
- xive_write_1(sc, XIVE_TM_CPPR_HV, xive_prio(old));
+ ci->ci_cpl = old;
+ xive_write_1(sc, XIVE_TM_CPPR_HV, xive_prio(old));
+
+ eieio();
+ }
}
struct xive_dmamem *