Subject: Re: WARNING: SPL NOT LOWERED ON SYSCALL 0 0 EXIT
To: None <tech-kern@netbsd.org>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 08/14/2007 13:15:15
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.

Andrew