Subject: Re: build aborts in regress/lib/libpthread/sem
To: Pat Wendorf <mlist@beholder.homeunix.net>
From: Christian Groessler <cpg@aladdin.de>
List: port-dreamcast
Date: 02/12/2003 00:48:34
Hi,

On 02/09/2003 01:01:44 PM EST Pat Wendorf wrote:
>
>On February 8, 2003 08:17 pm, Christian Groessler wrote:
>>
>> Hmm, this doesn't happen here. All I get is a message
>>
>> "WARNING: mclpool limit reached; increase NMBCLUSTERS"
>>
>> The DC still works.
>>
>> On which system did you run the ping?
>>
>> regards,
>> chris
>
>If I run the ping from the dreamcast, pinging any other machine it will do
>that.  My cvs source was updated about a week ago, has there been major
>changes since?  I know I already have the mbe0 patch you guys did, as the nfs
>boot is now very stable.

I didn't try to run the ping on the dreamcast, I thought pinging at it
will give the problem.

I can reproduce it here, I don't even need the -f parameter, a
"ping -s 8192 host" is sufficient.

With the following change the reboot doesn't happen for me:

---------------------
Index: g2bus_bus_mem.c
===================================================================
RCS file: /net/swamp/zeug/netbsd-rsync/main/src/sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c,v
retrieving revision 1.6
diff -u -p -r1.6 g2bus_bus_mem.c
--- g2bus_bus_mem.c	2002/12/27 11:34:05	1.6
+++ g2bus_bus_mem.c	2003/02/11 23:21:06
@@ -417,11 +417,16 @@ g2bus_sparse_bus_mem_write_multi_1(void 
     bus_size_t off, const u_int8_t *addr, bus_size_t len)
 {
 	__volatile u_int8_t *baddr = (u_int8_t *)(sh + (off * 4));
+	u_int8_t data;
 
-	G2_LOCK;
+	/*G2_LOCK;*/
 
-	while (len--)
-		*baddr = *addr++;
+	while (len--) {
+		data = *addr++;
+		G2_LOCK;
+		*baddr = data;
+		G2_UNLOCK;
+	}
 
-	G2_UNLOCK;
+	/*G2_UNLOCK;*/
 }
---------------------

This might be a more general problem of the g2 bus space routines:
The G2_LOCK macro seems to disable exceptions. But what happens if the
page addressed by *addr is not available, and the exception is needed?

Or what else would explain, that above change fixes the problem?

regards,
chris