From: visa Date: Tue, 23 Jan 2018 14:47:21 +0000 (+0000) Subject: Always lock the kernel lock with non-MP-safe interrupt handlers. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f8189779d1fd253655d560cd1cb59c3c24f51d92;p=openbsd Always lock the kernel lock with non-MP-safe interrupt handlers. Suggested by kettenis@ --- diff --git a/sys/arch/loongson/loongson/loongson3_intr.c b/sys/arch/loongson/loongson/loongson3_intr.c index 445c36d4eb0..a94dd425a69 100644 --- a/sys/arch/loongson/loongson/loongson3_intr.c +++ b/sys/arch/loongson/loongson/loongson3_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loongson3_intr.c,v 1.5 2017/02/19 09:53:37 visa Exp $ */ +/* $OpenBSD: loongson3_intr.c,v 1.6 2018/01/23 14:47:21 visa Exp $ */ /* * Copyright (c) 2016 Visa Hankala @@ -416,7 +416,7 @@ loongson3_intr(uint32_t pending, struct trapframe *frame) if (ih->ih_flags & IH_MPSAFE) need_lock = 0; else - need_lock = ih->ih_level < IPL_CLOCK; + need_lock = 1; if (need_lock) __mp_lock(&kernel_lock); #endif @@ -492,7 +492,7 @@ loongson3_ht_intr(uint32_t pending, struct trapframe *frame) if (ih->ih_flags & IH_MPSAFE) need_lock = 0; else - need_lock = ih->ih_level < IPL_CLOCK; + need_lock = 1; if (need_lock) __mp_lock(&kernel_lock); #endif diff --git a/sys/arch/octeon/dev/octcit.c b/sys/arch/octeon/dev/octcit.c index fef4663414e..785cafa4019 100644 --- a/sys/arch/octeon/dev/octcit.c +++ b/sys/arch/octeon/dev/octcit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octcit.c,v 1.4 2017/12/27 13:16:53 visa Exp $ */ +/* $OpenBSD: octcit.c,v 1.5 2018/01/23 14:47:21 visa Exp $ */ /* * Copyright (c) 2017 Visa Hankala @@ -431,7 +431,7 @@ octcit_intr(uint32_t hwpend, struct trapframe *frame) if (ISSET(ih->ih_flags, IH_MPSAFE)) need_lock = 0; else - need_lock = ih->ih_level < IPL_CLOCK; + need_lock = 1; if (need_lock) __mp_lock(&kernel_lock); #endif diff --git a/sys/arch/octeon/dev/octciu.c b/sys/arch/octeon/dev/octciu.c index 179e21fb0c5..6014d069cd1 100644 --- a/sys/arch/octeon/dev/octciu.c +++ b/sys/arch/octeon/dev/octciu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octciu.c,v 1.8 2017/11/03 16:19:25 visa Exp $ */ +/* $OpenBSD: octciu.c,v 1.9 2018/01/23 14:47:21 visa Exp $ */ /* * Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se) @@ -480,7 +480,7 @@ octciu_intr_bank(struct octciu_softc *sc, struct intrbank *bank, if (ih->ih_flags & IH_MPSAFE) need_lock = 0; else - need_lock = ih->ih_level < IPL_CLOCK; + need_lock = 1; if (need_lock) __mp_lock(&kernel_lock); #endif