Subject: Re: WARNING: SPL NOT LOWERED ON SYSCALL 0 0 EXIT
To: None <tech-kern@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-kern
Date: 08/14/2007 16:04:36
On Tue, Aug 14, 2007 at 01:15:15PM +0100, Andrew Doran wrote:
> On Mon, Aug 13, 2007 at 06:34:02PM +0200, Joerg Sonnenberger wrote:
> 
> >  static __inline void
> >  __cpu_simple_lock(__cpu_simple_lock_t *lockp)
> >  {
> > +	int count = 100;
> >  
> >  	while (x86_atomic_testset_b(lockp, __SIMPLELOCK_LOCKED)
> >  	    != __SIMPLELOCK_UNLOCKED) {
> >  		do {
> >  			x86_pause();
> > +			if (--count) {
> > +				mb_memory();
> > +				count = 100;
> > +			}
> >  		} while (*lockp == __SIMPLELOCK_LOCKED);
> >  	}
> >  	__insn_barrier();
> 
> We don't need to do this because NetBSD rarely turns interrupts off. The
> erratum isn't a big problem for us. We do spinlock the ioapic in the
> interrupt stubs and in maybe one or two other places. Those can be handled
> specially.

In x86/isa/clock.h:
- i8254_get_timecout
- gettick
--> where's the enable_intr call?

ioapic_lock is using it, lapic_map

i686_mtrr_reload could be changed to use similiar code to the spinlock,
maybe?

x86/patch.c: why is patchfunc calling disable_intr and where are they
reenabled? I would move it out to x86_patch....

Joerg