Subject: VAX port needs virtualized interrupt levels
To: None <port-vax@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-vax
Date: 04/12/2001 13:32:05
This is mostly a warning message...

The VAX port is seriously broken :-)

I notices this while working on my splimp purge (there will be a message
posted to tech-kern shortly about this).  But the short version is that
the VAX port was using splimp to block Unibus interrupts when it really
should be using e.g. splnet, splbio, etc. as the symbolic names for the
interrupt levels, and using some other mechanism to map them to the actual
hardware interrupt level.

I.e. this:

#define splbio()        _splraise(IPL_BIO)              /* IPL15 */
#define splnet()        _splraise(IPL_NET)              /* IPL15 */
#define spltty()        _splraise(IPL_TTY)              /* IPL15 */

should be replaced with something like this:

#define splbio()        _splraise(hp300_ipls[HP300_IPL_BIO])
#define splnet()        _splraise(hp300_ipls[HP300_IPL_NET])
#define spltty()        _splraise(hp300_ipls[HP300_IPL_TTY])

(Example from the hp300 port, obviously.)

The values in the hp300_ipls[] array are computed when interrupt handlers
are registered with the interrupt dispatch code.  E.g. you might register
an interrupt handler like:

	sc->sc_ih = uba_intr_establish(ua->ua_uc /* uba "chipset" descriptor */,
	    hardipl /* hardware ipl discovered at attach time (0x17?) */,
	    IPL_BIO /* virtual interrupt "level" */,
	    uda_intr /* interrupt handler */,
	    sc /* argument passed to interrupt handler */);

Then the appropriate hardware level for the virtualized IPL_BIO can be
exactly correct for any system the kernel runs on.

Note, this will become a STRICT REQUIREMENT for the NetBSD kernel soon,
due to requirements of SMP.

"You have been notified."  :-)

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>