Re: New pmap status update

Jason Thorpe <[email protected]> Sun, 14 Dec 2025 13:38:56 -0500
Newsgroups gmane.os.netbsd.ports.m68k
Message-ID <[email protected]>
Ok, I am on a cross-USA flight all day today so I=E2=80=99ll have some time t=
o look at this :-)

-- thorpej
Sent from my iPhone.

> On Dec 14, 2025, at 9:26=E2=80=AFAM, Izumi Tsutsui <[email protected]=
p> wrote:
>=20
> =EF=BB=BFHi,
> (sorry for a late trial, now Open Source Conference Hiroshima was over)
>=20
>> 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'd like to pull those change into
>> netbsd-11 possibly, if they work on your 313 / 330 with the old pmap.
>=20
> I've tried SMALL020 kernel (i.e. traditional pmap) around 20251207
> (via netboot) and unfortunately it gets panic() due to another
> TAS instruction in _kernel_lock() (maybe __cpu_simple_lock_try()?):
>=20
> ---
>=20
>>> NetBSD/hp300 Primary Boot, Revision 1.22 (Sat May 31 17:00:41 UTC 2025) (=
from NetBSD 10.99.14)
>>> HP 9000/318/319/330 SPU
>>> Enter "reset" to reset system.
> Boot: [[[le0a:]netbsd][-a][-c][-d][-s][-v][-q]] :- le0a:netbsd.small020 -s=

> WARNING: bad date in battery clock
> boot: client IP address: 192.168.20.74
> root addr=3D192.168.20.1 path=3D/r/export/NetBSD/hp300/root
> 2292116+99012 [211280+198022]=3D0x2abf50
> Start @ 0xff803000 [1=3D0xffa49c58-0x2abf50]...
> Entry point: 0xff803000
> [   1.0000000] bootinfo found at 0xff802000
> [   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 200=
3,
> [   1.0000000]     2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2=
013,
> [   1.0000000]     2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2=
023,
> [   1.0000000]     2024, 2025
> [   1.0000000]     The NetBSD Foundation, Inc.  All rights reserved.
> [   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
> [   1.0000000]     The Regents of the University of California.  All right=
s reserved.
>=20
> [   1.0000000] NetBSD 11.99.4 (SMALL020) #0: Sun Dec  7 14:35:21 JST 2025
> [   1.0000000]    tsutsui@mirage:/s/tsutsui/netbsd/src/sys/arch/hp300/comp=
ile/SMALL020
> [   1.0000000] HP 9000/318/319/330 (16.67MHz MC68020 CPU, MC68851 MMU, 16.=
67MHz MC68881 FPU)
> [   1.0000000] total memory =3D 8180 KB
> [   1.0000000] avail memory =3D 4552 KB
> [   1.0000000] mainbus0 (root)
> [   1.0000000] intio0 at mainbus0
> [   1.0000000] rtc0 at intio0 addr 0x420000
> [   1.0000000] hil0 at intio0 addr 0x428000 ipl 1
> [   1.0000000] nhpib1 at intio0 addr 0x478000 ipl 3: internal HP-IB
> [   1.0000000] hpibbus1 at nhpib1
> [   1.0000000] dma0 at intio0 addr 0x500000 ipl 1: 98620C, 2 channels, 32-=
bit DMA
> [   1.0000000] topcat0 at intio0 addr 0x560000: 1024x768x6 HP98549 catseye=
 frame buffer
> [   1.0000000] wsdisplay0 at topcat0 kbdmux 1
> [   1.0000000] dio0 at mainbus0
> [   1.0000000] com0 at dio0 scode 9 ipl 5: ns8250 or ns16450, no fifo
> [   1.0000000] com0: console
> [   1.0000000] fhpib0 at dio0 scode 14 ipl 4: 98625A/98625B HP-IB
> [   1.0000000] hpibbus2 at fhpib0
> [   1.0000000] le0 at dio0 scode 21 ipl 5: address 08:00:09:02:6a:99
> [   1.0000000] le0: 8 receive buffers, 2 transmit buffers
> [   1.0000000] WARNING: system needs entropy for security; see entropy(7)
> [   2.1739230] hil0: no devices
> [   5.7425910] boot device: le0
> [   5.7625750] root on le0
> [   5.7853590] nfs_boot: trying DHCP/BOOTP
> [   8.8310390] trap type 0, code =3D 0x1d5, v =3D 0x224340
> [   8.8443470] kernel program counter =3D 0x1153bc
> [   8.8563110] kernel: Bus error trap
> [   8.8668830] pid =3D 0, lid =3D 3, pc =3D 001153BC, ps =3D 2500, sfc =3D=
 1, dfc =3D 1
> [   8.8668830] Registers:
> [   8.8668830]              0        1        2        3        4        5=
        6        7
> [   8.8668830] dreg: 00000001 00002104 00002004 00000001 00115DC8 03470170=
 00000000 00115380
> [   8.8668830] areg: 0132A300 03470170 03470368 03470170 0132A300 0012BBA6=
 0302AEA4 FFEFFFFC
>=20
> [   8.8668830] Kernel stack (0302AD14):
> [   8.8668830] 02AD14: 00010882 0302ADEC 00000080 00002004 00000001 00115D=
C8 03470170 00000000
> [   8.8668830] 02AD34: 00115380 03470368 03470170 0132A300 0012BBA6 001332=
B7 001332B3 001332AF
> [   8.8668830] 02AD54: 001332AB 00000001 00000000 00000000 00000000 000000=
00 00000000 00000000
> [   8.8668830] 02AD74: 00000000 00000000 00000000 00000000 00000000 000000=
00 00000000 00000000
> [   8.8668830] 02AD94: 00000000 00000000 00000000 00000000 00000000 000000=
00 00000000 00000000
> [   8.8668830] 02ADB4: 00000000 00000000 00000000 00000000 00000000 000000=
00 00000000 0013322F
> [   8.8668830] 02ADD4: 0302AEA4 00001524 0302ADEC 00000000 000001D5 002243=
40 00000001 00002104
> [   8.8668830] 02ADF4: 00002004 00000001 00115DC8 03470170 00000000 001153=
80 0132A300 03470170
> [   8.8668830] 02AE14: 03470368 03470170 0132A300 0012BBA6 0302AEA4 FFEFFFF=
C 00000000 25000011
> [   8.8668830] 02AE34: 53BCB008 0D6C01D5 67027000 00224340 00224340 000000=
00 4AF94340 001153C6
> [   8.8668830] 02AE54: 001153C4 001153C2 00000070 00800080 000F11A9 000000=
00 0302AEA8 00000080
> [   8.8668830] 02AE74: 00002500 80200000 001153A8 00000000 00000080 001153=
A0 00002004 0011A118
> [   8.8668830] 02AE94: 00115DC8 03470368 03470170 0132A300 0302AF74 000585=
B0 00000001 01317200
> [   8.8668830] 02AEB4: 00002004 0011A118 00115DC8 03470170 00000000 001153=
80 03470368 03470170
> [   8.8668830] 02AED4: 0132A300 0012BBA6 00000000 00115380 01317D80 0132BB=
80 0011A25C 0012BBA6
> [   8.8668830] 02AEF4: 00000001 06708000 FA000000 0302AF18 000116C2 013450=
00 00002004 00225280
> [   8.8804950] panic: Bus error
> [   8.8848070] cpu0: Begin traceback...
> [   8.8974230] ?(?)
> [   9.0010350] db_panic(0,14ecdc,302ad14,14eed4,1eb5c0) at 0
> [   9.1608790] vpanic(1eb5c0,302ad20,302add4,1089e,1eb5c0) + 188
> [   9.4307710] panic(1eb5c0,2004,1,115dc8,3470170) + c
> [   9.6906670] trap(302adec,0,1d5,224340) + 288
> [  10.0405270] _kernel_lock(1,1317200) + 3c
> [  10.2904270] ipintr(0) + 18
> [  10.4503630] softint_thread(3470170) + b8
> [  10.5803110] lwp_trampoline() + e
> [  10.6008030] cpu0: End traceback...
> Stopped in pid 0.3 (system) at  netbsd:cpu_Debugger+0x6:        unlk    a6=

> db>
>=20
> ---
>=20
> 'm68k--netbsdelf-objdump -d netbsd' shows:
>=20
> ---
> 00115380 <_kernel_lock>:
>  115380:       4e56 0000       linkw %fp,#0
>  115384:       48e7 3838       moveml %d2-%d4/%a2-%a4,%sp@-
>  115388:       262e 0008       movel %fp@(8),%d3
>  11538c:       2879 0022 0b2c  moveal 220b2c <curlwp>,%a4
>  115392:       4282            clrl %d2
>  115394:       40c2            movew %sr,%d2
>  115396:       0c42 24ff       cmpiw #9471,%d2
>  11539a:       6204            bhis 1153a0 <_kernel_lock+0x20>
>  11539c:       46fc 2500       movew #9472,%sr
>  1153a0:       2039 0023 0948  movel 230948 <cpu_info_store+0x108>,%d0
>  1153a6:       6712            beqs 1153ba <_kernel_lock+0x3a>
>  1153a8:       d083            addl %d3,%d0
>  1153aa:       23c0 0023 0948  movel %d0,230948 <cpu_info_store+0x108>
>  1153b0:       d76c 01f6       addw %d3,%a4@(502)
>  1153b4:       46c2            movew %d2,%sr
>  1153b6:       6000 00a4       braw 11545c <_kernel_lock+0xdc>
>  1153ba:       7001            moveq #1,%d0
>  1153bc:       4af9 0022 4340  tas 224340 <kernel_lock>
>                                ^^^ pc =3D 001153BC is here
>  1153c2:       6702            beqs 1153c6 <_kernel_lock+0x46>
>  1153c4:       7000            moveq #0,%d0
>  1153c6:       4a80            tstl %d0
>  1153c8:       6710            beqs 1153da <_kernel_lock+0x5a>
> ---
>=20
> Thanks,
> ---
> Izumi Tsutsui