Re: New pmap status update

Jason Thorpe <[email protected]> Sat, 29 Nov 2025 14:52:19 -0800
Newsgroups gmane.os.netbsd.ports.m68k
Message-ID <[email protected]>
> On Nov 29, 2025, at 1:17=E2=80=AFPM, Jason Thorpe <[email protected]> =
wrote:
>=20
>=20
>=20
>> On Nov 29, 2025, at 9:46=E2=80=AFAM, Izumi Tsutsui =
<[email protected]> wrote:
>>=20
>> - On HP9000/319C (68020+68851) and 330 NEWPMAP with RAS patch kernel
>>  boots (i.e. shows kernel messages), but even 10.1 GENERIC (i.e. with
>>  traditional pmap_motorola.c) cannot start /bin/sh:
>>  (maybe more CAS instruction issue?)
>=20
> The problem is that other atomic_*() functions use the CAS =
instruction, as well, because CAS is the only one that provides the =
intended atomicity.  Some rework of libkern=E2=80=99s atomics is needed.

Ok, I have pushed a modified version of your NO_CAS patch and also made =
a tweak to pmap_motorola.c to avoid the atomic functions that use CAS =
under the covers.  I=E2=80=99d like to pull those change into netbsd-11 =
possibly, if they work on your 313 / 330 with the old pmap.

I=E2=80=99ve also made changes to the new pmap to avoid CAS-using =
atomics as well, except for the one place where atomic_cas_uint() is =
used, because on hp300 that will now use the restartable atomic sequence =
implementation per your NO_CAS patch.  I prefer to keep using =
atomic_cas_uint() there because the 68030 and 68040 manuals clearly =
state that both of those CPUs also use the indivisible R-M-W cycles =
during MMU table walks (to update the U and M bits).

-- thorpej