NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-hp700/41369: splraise() needs insn_barrier()



>Number:         41369
>Category:       port-hp700
>Synopsis:       splraise() needs insn_barrier()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-hp700-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 06 18:25:00 +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);  
 }



Home | Main Index | Thread Index | Old Index