From 5a571b9eb7f276474a95f9ee94430d99e9813e6b Mon Sep 17 00:00:00 2001 From: dlg Date: Thu, 17 Jul 2014 12:56:07 +0000 Subject: [PATCH] interrupt handlers established via the ioapic didnt get their ih_flags set. ih_flags are used by the intr_handler() code to determine if the kernel lock should be taken or not. because the flags werent set, random memory was used instead which in turn meant you sometimes didnt have the biglock when running interrupt handlers which relied on it. races ahoy. this was found by jmatthew@ while helping me try to figure out why bnx was blowing up and causing double frees and use after frees. turns out bnx was the smoke for this fire. sorry it took so long. ok kettenis@ sthen@ sthen@ seems happy to have the i386 ports build machine working again. --- sys/arch/i386/i386/ioapic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arch/i386/i386/ioapic.c b/sys/arch/i386/i386/ioapic.c index ab58bbf2319..784933b42b7 100644 --- a/sys/arch/i386/i386/ioapic.c +++ b/sys/arch/i386/i386/ioapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioapic.c,v 1.31 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: ioapic.c,v 1.32 2014/07/17 12:56:07 dlg Exp $ */ /* $NetBSD: ioapic.c,v 1.7 2003/07/14 22:32:40 lukem Exp $ */ /*- @@ -736,6 +736,7 @@ apic_intr_establish(int irq, int type, int level, int (*ih_fun)(void *), ih->ih_arg = ih_arg; ih->ih_next = NULL; ih->ih_level = level; + ih->ih_flags = flags; ih->ih_irq = irq; evcount_attach(&ih->ih_count, ih_what, &pin->ip_vector); -- 2.20.1