NetBSD Problem Report #41369
From bouyer@antioche.eu.org Wed May 6 18:22:01 2009
Return-Path: <bouyer@antioche.eu.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id DC8D463B8DF
for <gnats-bugs@gnats.NetBSD.org>; Wed, 6 May 2009 18:22:00 +0000 (UTC)
Message-Id: <200905061821.n46ILu6a003354@rochebonne.antioche.eu.org>
Date: Wed, 6 May 2009 20:21:56 +0200 (CEST)
From: Manuel Bouyer <bouyer@antioche.eu.org>
Reply-To: bouyer@antioche.eu.org
To: gnats-bugs@gnats.NetBSD.org
Subject: splraise() needs insn_barrier()
X-Send-Pr-Version: 3.95
>Number: 41369
>Category: port-hp700
>Synopsis: splraise() needs insn_barrier()
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-hp700-maintainer
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed May 06 18:25:00 +0000 2009
>Closed-Date: Mon May 11 05:54:46 +0000 2009
>Last-Modified: Mon May 11 05:54:46 +0000 2009
>Originator: Manuel Bouyer
>Release: NetBSD 5.0
>Organization:
>Environment:
5.0_STABLE sources
Architecture: hp700
Machine: hp700
>Description:
if splhigh() is an inline or macro, the compiler may optimise things
wrongly around it. An example is softint_schedule(), where the
second check for SOFTINT_PENDING is optimised out. See PR kern/38637
for details.
To avoid this, splraise() should be a barrier for the compiler;
in the case of hp700 an __insn_barrier() is needed before
return (ocpl)
>How-To-Repeat:
code inspection
>Fix:
Index: include/intr.h
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/include/intr.h,v
retrieving revision 1.13
diff -u -p -u -r1.13 intr.h
--- include/intr.h 7 Jul 2008 12:29:30 -0000 1.13
+++ include/intr.h 6 May 2009 18:21:16 -0000
@@ -74,6 +74,7 @@ splraise(register int ncpl)
register int ocpl = cpl;
cpl = ocpl | ncpl;
+ __insn_barrier();
return (ocpl);
}
>Release-Note:
>Audit-Trail:
From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/41369 CVS commit: src/sys/arch/hp700/include
Date: Thu, 7 May 2009 08:16:50 +0000
Module Name: src
Committed By: skrll
Date: Thu May 7 08:16:50 UTC 2009
Modified Files:
src/sys/arch/hp700/include: intr.h
Log Message:
Add __insn_barrier after updating cpl in splraise. PR/41369.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp700/include/intr.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Thu, 07 May 2009 09:13:30 +0000
State-Changed-Why:
Committed. Thanks.
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: port-hp700-maintainer@NetBSD.org, netbsd-bugs@NetBSD.org,
gnats-admin@NetBSD.org, skrll@NetBSD.org
Subject: Re: port-hp700/41369 (splraise() needs insn_barrier())
Date: Thu, 7 May 2009 11:59:25 +0200
On Thu, May 07, 2009 at 09:13:31AM +0000, skrll@NetBSD.org wrote:
> Synopsis: splraise() needs insn_barrier()
>
> State-Changed-From-To: open->closed
> State-Changed-By: skrll@NetBSD.org
> State-Changed-When: Thu, 07 May 2009 09:13:30 +0000
> State-Changed-Why:
> Committed. Thanks.
Could you look at getting this pulled up to netbsd-5 ?
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
NetBSD: 26 ans d'experience feront toujours la difference
--
State-Changed-From-To: closed->pending-pullups
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Thu, 07 May 2009 10:06:34 +0000
State-Changed-Why:
pending pullup-5 #741
From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/41369 CVS commit: [netbsd-5] src/sys/arch/hp700/include
Date: Sun, 10 May 2009 20:32:36 +0000
Module Name: src
Committed By: snj
Date: Sun May 10 20:32:36 UTC 2009
Modified Files:
src/sys/arch/hp700/include [netbsd-5]: intr.h
Log Message:
Pull up following revision(s) (requested by skrll in ticket #741):
sys/arch/hp700/include/intr.h: revision 1.14
Add __insn_barrier after updating cpl in splraise. PR/41369.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.6.1 src/sys/arch/hp700/include/intr.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/41369 CVS commit: [netbsd-5-0] src/sys/arch/hp700/include
Date: Sun, 10 May 2009 20:34:07 +0000
Module Name: src
Committed By: snj
Date: Sun May 10 20:34:07 UTC 2009
Modified Files:
src/sys/arch/hp700/include [netbsd-5-0]: intr.h
Log Message:
Pull up following revision(s) (requested by skrll in ticket #741):
sys/arch/hp700/include/intr.h: revision 1.14
Add __insn_barrier after updating cpl in splraise. PR/41369.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.12.1 src/sys/arch/hp700/include/intr.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Mon, 11 May 2009 05:54:46 +0000
State-Changed-Why:
pullups processed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.