diff options
author | 2020-07-22 19:09:15 +0000 | |
---|---|---|
committer | 2020-07-22 19:09:15 +0000 | |
commit | d162cc446f31c2ec3f1c498a0a2125eb74e82a00 (patch) | |
tree | 4bf2d468fdb6aaeaadb9530e65e338550920238d | |
parent | pstat -t was showing bogus column data on ttys, in modes where (diff) | |
download | wireguard-openbsd-d162cc446f31c2ec3f1c498a0a2125eb74e82a00.tar.xz wireguard-openbsd-d162cc446f31c2ec3f1c498a0a2125eb74e82a00.zip |
Don't grab the kernel lock for mpsafe interrupts.
-rw-r--r-- | sys/arch/powerpc64/dev/xive.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/arch/powerpc64/dev/xive.c b/sys/arch/powerpc64/dev/xive.c index aa48d56c1b6..fc9a632a58d 100644 --- a/sys/arch/powerpc64/dev/xive.c +++ b/sys/arch/powerpc64/dev/xive.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xive.c,v 1.8 2020/07/22 16:49:13 kettenis Exp $ */ +/* $OpenBSD: xive.c,v 1.9 2020/07/22 19:09:15 kettenis Exp $ */ /* * Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org> * @@ -400,15 +400,26 @@ xive_hvi(struct trapframe *frame) KASSERT(lirq < XIVE_NUM_IRQS); ih = sc->sc_handler[lirq]; if (ih != NULL) { - if (ih->ih_ipl != IPL_IPI) +#ifdef MULTIPROCESSOR + int need_lock; + + if (ih->ih_flags & IPL_MPSAFE) + need_lock = 0; + else + need_lock = (ih->ih_ipl < IPL_SCHED); + + if (need_lock) KERNEL_LOCK(); +#endif intr_enable(); handled = ih->ih_func(ih->ih_arg); intr_disable(); if (handled) ih->ih_count.ec_count++; - if (ih->ih_ipl != IPL_IPI) +#ifdef MULTIPROCESSOR + if (need_lock) KERNEL_UNLOCK(); +#endif xive_eoi(sc, ih); } eq->eq_idx = (eq->eq_idx + 1) & XIVE_EQ_IDX_MASK; |