Subject: port-sh3/24007: sh3 cpu_exit() is volatile
To: None <email@example.com>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
Date: 01/06/2004 21:09:23
>Synopsis: sh3 cpu_exit() is volatile
>Arrival-Date: Tue Jan 06 20:09:00 UTC 2004
>Originator: Jaromir Dolecek
>Release: NetBSD 1.6ZG
System: NetBSD s102-n054.tele2.cz 1.6ZG NetBSD 1.6ZG (SARUMAN.MP) #10: Sun Jan 4 12:48:32 CET 2004 firstname.lastname@example.org:/usr/home/dolecek/soft/netbsd/sys/arch/i386/compile/SARUMAN.MP i386
sh3 cpu_exit() uses lwp0 stack and memory after it's reclaimed
('l' pointer after lwp_exit2() call, where the lwp is freed).
This only works due to the initial excessive interrupt blocking
via splsched, and feels as somewhat of a hack.
It would be safer to follow practice of other ports, which
switch to idle context, call lwp_exit2() from that context,
and then use special code path to schedule another lwp
instead of the one which exitted. I also believe this
would be necessary for MP, tho I'm not sure if Super-H 3
supports MP at all.
Sorry, no patch.