Re: reboot broken on RPi4 on main [breaks at git: e6cf1a0826c9 - main - physmem: add ram0 pseudo-driver]

From: Mike Karels <mike_at_karels.net>
Date: Sat, 25 Feb 2023 16:09:43 UTC
Top posting to make this easier to find:

I verified that the current kernel can reboot if it was booted
with hint.ram.0.disabled=“1” in /boot/device.hints.

		Mike

On 25 Feb 2023, at 3:58, Mark Millard wrote:

> [I probably should have also shown related output from
> earlier in the boot log.]
>
> On Feb 25, 2023, at 01:23, Mark Millard <marklmi@yahoo.com> wrote:
>
>> On Feb 24, 2023, at 22:16, Mark Millard <marklmi@yahoo.com> wrote:
>>
>>> [The first main version to not reboot RPi4B's is:
>>> git: e6cf1a0826c9 - main - physmem: add ram0 pseudo-driver Mitchell Horne
>>> ]
>>>
>>> On Feb 24, 2023, at 17:45, Mark Millard <marklmi@yahoo.com> wrote:
>>>
>>>> On Feb 24, 2023, at 15:18, Mark Millard <marklmi@yahoo.com> wrote:
>>>>
>>>>> On Feb 23, 2023, at 14:01, Mike Karels <mike@karels.net> wrote:
>>>>>
>>>>>> Reboot (shutdown -r) is hanging on RPi4 on main as of today’s snapshot.
>>>>>> It hangs after printing the Uptime.  The initial bootstrap and boot from
>>>>>> power-up work.  I haven’t tested a snapshot since Jan 1, so I’m not sure
>>>>>> when it stopped working.  Any ideas what might have broken it?  I can bisect
>>>>>> the recent snapshots if nothing else.
>>>>>>
>>>>>> 13.2-BETA2 works, however.
>>>>>
>>>>> For reference . . .
>>>>>
>>>>> While it is a personal build instead of a snapshot,
>>>>> I see the "shutdown -r now" hang problem for my build
>>>>> based on:
>>>>>
>>>>> # ~/fbsd-based-on-what-commit.sh -C /usr/main-src/
>>>>> d04c86717c8c (HEAD -> main, freebsd/main, freebsd/HEAD) bsd.sys.mk: Add NO_WSTRICT_PROTOTYPES like in kernel
>>>>> branch: main
>>>>> merge-base: d04c86717c8ca3aa1bd9d8927a37a1f5443925b5
>>>>> merge-base: CommitDate: 2023-02-19 07:02:12 +0000
>>>>> n261026 (--first-parent --count for merge-base)
>>>>>
>>>>> The context has a "B0T" 8 GiByte RPi4B.
>>>>
>>>> For the artifact builds available for arm64, testing
>>>> the kernels:
>>>>
>>>> The last that has "shutdown -r now" working on the RPi4B I'm using:
>>>>
>>>>  • git: 8b418c83d175 - main - cp: Adjust the sparse file tests. Dag-Erling Smørgrav
>>>> ( https://artifact.ci.freebsd.org/snapshot/main/8b418c83d175fde3b1f65210509ddcf2ac248d9f/arm64/aarch64/kernel.txz )
>>>>
>>>> No arm64 artifacts after that until . . .
>>>>
>>>> The first that has "shutdown -r now" failing on the same RPi4B:
>>>>
>>>>  • git: ded5f2954e1a - main - nfsd: Fix handling of the error case for nfsvno_open Rick Macklem
>>>> ( https://artifact.ci.freebsd.org/snapshot/main/ded5f2954e1a1bb7748646888938af767ee6257a/arm64/aarch64/kernel.txz )
>>>>
>>>> So the range is limited to (including those end points):
>>>> (All are 2023-Feb-08 artifact builds.)
>>>>
>>>>  • git: 8b418c83d175 - main - cp: Adjust the sparse file tests. Dag-Erling Smørgrav
>>>>  • git: 87d405eab911 - main - iommu_gas: initialize start_gap as first node Doug Moore
>>>>  • git: 8c784bb8cf36 - main - lua: Update to 5.4.4 Warner Losh
>>>>  • git: 5fff09660e06 - main - geli: split the initalization of HMAC Gordon Tetlow
>>>>  • git: 81ad626541db - main - Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787 Dimitry Andric
>>>>  • git: 753f127f3ace - main - Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f Dimitry Andric
>>>>  • git: fcaf7f8644a9 - main - Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b Dimitry Andric
>>>>  • git: 972a253a57b6 - main - Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4 Dimitry Andric
>>>>  • git: 61cfbce3347e - main - Merge llvm-project release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0d Dimitry Andric
>>>>  • git: a4a491e2238b - main - Merge llvm-project release/15.x llvmorg-15.0.0-9-g1c73596d3454 Dimitry Andric
>>>>  • git: 6246ae0b85d8 - main - Merge llvm-project release/15.x llvmorg-15.0.2-10-gf3c5289e7846 Dimitry Andric
>>>>  • git: f3fd488f1e19 - main - Merge llvm-project release/15.x llvmorg-15.0.6-0-g088f33605d8a Dimitry Andric
>>>>  • git: 50d7464c3fe6 - main - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Dimitry Andric
>>>>  • git: 3264f6b88fce - main - Bump __FreeBSD_version for llvm 15.0.7 merge Dimitry Andric
>>>>  • git: 89a072d11cd2 - main - Makefile.amd64: remove construct that serves no purpose Warner Losh
>>>>  • git: ae1dca798e0f - main - e1000: fix I219 hang on reset Kevin Bowling
>>>>  • git: 647f2d2bc0cb - main - e1000: bump driver version Kevin Bowling
>>>>  • git: 48bfd3597654 - main - Add nproc(1) Mateusz Guzik
>>>>  • git: 1d03c3578d05 - main - arm: add an interrupt rman to nexus Mitchell Horne
>>>
>>> My build of the above version works for "shutdown -r now".
>>>
>>>>  • git: f9bdaab95ec4 - main - ofwbus: remove handling of resources from ofwbus Mitchell Horne
>>>
>>> My build of the above version works for "shutdown -r now".
>>> It is the last version to do so.
>>>
>>>>  • git: e6cf1a0826c9 - main - physmem: add ram0 pseudo-driver Mitchell Horne
>>>
>>> My build of the above version fails for "shutdown -r now":
>>> hang-up just after Uptime: . . . message.
>>>
>>>>  • git: fa3f6655421f - main - netmap: drop redundant if_mtu assignment Vincenzo Maffione
>>>>  • git: ded5f2954e1a - main - nfsd: Fix handling of the error case for nfsvno_open Rick Macklem
>>>>
>>>> . . .
>>>
>>>
>>
>> The following from boot -v looks somewhat odd:
>>
>> ram0: reserving memory region:   2000-7ef0000
>> ram0: reserving memory region:   7f10000-31c00000
>> ram0: reserving memory region:   331d7000-39c2a000
>> ram0: reserving memory region:   39c2b000-39c2e000
>> ram0: reserving memory region:   39c2f000-39c30000
>> ram0: reserving memory region:   39c32000-39c33000
>> ram0: reserving memory region:   39c37000-3b050000
>> ram0: reserving memory region:   3b060000-3b300000
>> ram0: reserving memory region:   40000000-fc000000
>> ram0: reserving excluded region: 0-1fff
>> ram0: reserving excluded region: 7ef0000-7f0ffff
>> ram0: reserving excluded region: 31c00000-331d6fff
>> ram0: reserving excluded region: 39c2a000-39c2afff
>> ram0: reserving excluded region: 39c2e000-39c2efff
>> ram0: reserving excluded region: 39c30000-39c31fff
>> ram0: reserving excluded region: 39c33000-39c36fff
>> ram0: reserving excluded region: 3b050000-3b05ffff
>> ram0: reserving excluded region: 3ee5c000-3ee5cfff
>> ram0: reserving excluded region: 3ee5c000-3ee5cfff
>> ram0: failed to reserve region
>> ram0: reserving excluded region: fe100000-fe100fff
>>
>> Possible oddities (4 GiByte RPi4B example):
>>
>> Nothing covers any part of [3b300000,3ee5c000) .
>> Exclusion [3ee5c000-3ee5cfff] is repeated. (Related to the above?)
>> The "failed to reserve region" notice. (Related to repetition?)
>> Nothing covers any part of [fc000000,fe100000) .
>> Nothing covers any part of [fe101000,ffffffff] .
>>
>> (The 2 different styles of specifying high bounds
>> reads oddly.)
>
> Related boot log material:
>
>                    Type     Physical      Virtual   #Pages Attr
>                Reserved 000000000000 000000000000 00000002 WB
>      ConventionalMemory 000000002000 000000002000 00007eee WB
>       ACPIReclaimMemory 000007ef0000 000007ef0000 00000020 WB
>      ConventionalMemory 000007f10000 000007f10000 00029c43 WB
>              LoaderData 000031b53000 000031b53000 00000001 WB
>              LoaderCode 000031b54000 000031b54000 00004000 WB
>              LoaderData 000035b54000 000035b54000 00004000 WB
>              LoaderCode 000039b54000 000039b54000 000000ce WB
>        BootServicesData 000039c22000 000039c22000 00000008 WB
>     RuntimeServicesData 000039c2a000 000039c2a000 00000001 WB RUNTIME
>        BootServicesData 000039c2b000 000039c2b000 00000003 WB
>     RuntimeServicesData 000039c2e000 000039c2e000 00000001 WB RUNTIME
>        BootServicesData 000039c2f000 000039c2f000 00000001 WB
>     RuntimeServicesData 000039c30000 000039c30000 00000002 WB RUNTIME
>        BootServicesData 000039c32000 000039c32000 00000001 WB
>     RuntimeServicesData 000039c33000 000039c33000 00000004 WB RUNTIME
>        BootServicesData 000039c37000 000039c37000 00000009 WB
>        BootServicesCode 000039c40000 000039c40000 00001410 WB
>     RuntimeServicesCode 00003b050000 00003b050000 00000010 WB RUNTIME
>        BootServicesCode 00003b060000 00003b060000 000000a0 WB
>        BootServicesData 00003b100000 00003b100000 00000200 WB
>                Reserved 00003ee5c000 00003ee5c000 00000001 WB
>        BootServicesData 000040000000 000040000000 000bc000 WB
>          MemoryMappedIO 0000fe100000 0000fe100000 00000001 RUNTIME
> Physical memory chunk(s):
>   0x00002000 - 0x3b2fffff,   946 MB ( 242430 pages)
>   0x40000000 - 0xfbffffff,  3008 MB ( 770048 pages)
> Excluded memory regions:
>   0x00000000 - 0x00001fff,     0 MB (      2 pages) NoAlloc
>   0x07ef0000 - 0x07f0ffff,     0 MB (     32 pages) NoAlloc
>   0x31c00000 - 0x331d6fff,    21 MB (   5591 pages) NoAlloc
>   0x39c2a000 - 0x39c2afff,     0 MB (      1 pages) NoAlloc
>   0x39c2e000 - 0x39c2efff,     0 MB (      1 pages) NoAlloc
>   0x39c30000 - 0x39c31fff,     0 MB (      2 pages) NoAlloc
>   0x39c33000 - 0x39c36fff,     0 MB (      4 pages) NoAlloc
>   0x3b050000 - 0x3b05ffff,     0 MB (     16 pages) NoAlloc
>   0x3ee5c000 - 0x3ee5cfff,     0 MB (      1 pages) NoAlloc NoDump
>   0x3ee5c000 - 0x3ee5cfff,     0 MB (      1 pages) NoAlloc
>   0xfe100000 - 0xfe100fff,     0 MB (      1 pages) NoAlloc
>
> and:
>
> Physical memory chunk(s):
> 0x00000000002000 - 0x00000007eeffff, 133095424 bytes (32494 pages)
> 0x00000007f10000 - 0x00000031bfffff, 701431808 bytes (171248 pages)
> 0x000000331d7000 - 0x00000039c29fff, 111489024 bytes (27219 pages)
> 0x00000039c2b000 - 0x00000039c2dfff, 12288 bytes (3 pages)
> 0x00000039c2f000 - 0x00000039c2ffff, 4096 bytes (1 pages)
> 0x00000039c32000 - 0x00000039c32fff, 4096 bytes (1 pages)
> 0x00000039c37000 - 0x0000003b04ffff, 21073920 bytes (5145 pages)
> 0x0000003b060000 - 0x0000003b2fffff, 2752512 bytes (672 pages)
> 0x00000040000000 - 0x000000f5e2ffff, 3051552768 bytes (745008 pages)
>
> So: Some of the oddities go back to some of this earlier
> material. For example, somehow:
>
>                Reserved 00003ee5c000 00003ee5c000 00000001 WB
>
> turned into:
>
>   0x3ee5c000 - 0x3ee5cfff,     0 MB (      1 pages) NoAlloc NoDump
>   0x3ee5c000 - 0x3ee5cfff,     0 MB (      1 pages) NoAlloc
>
>
>
> ===
> Mark Millard
> marklmi at yahoo.com