From owner-freebsd-arm@freebsd.org Mon Mar 16 04:11:06 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7260258F11 for ; Mon, 16 Mar 2020 04:11:06 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-19.consmr.mail.gq1.yahoo.com (sonic305-19.consmr.mail.gq1.yahoo.com [98.137.64.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48gjXR73Vtz3Lnw for ; Mon, 16 Mar 2020 04:11:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: cgpJKhgVM1lSsHB0fipDLjRIBqhL9pxws.gbma2FpjdOu8G4mY6n_73ZVZ20hNa 9QsQhBoL2nZiLmj0pEK5dhTUztsYlPzAJJO0.qa57NnTVljRnmYuyHFx_g0lpWe9EfLa7wrb2.RR UWcrSbF9gdk4nyMTW2V1hOu88dv.KN3gwMr99YItlFbEs6sVWFjqZ7XVwqWsD4GifVaY7xcHx2oH Tg3.pwZU_F7nURdYu6Vx6NSlS3qyNEh0gxFXAIIX3X0CGrSjYzVj2gOlZaOK24mVfbW2AWcKskpU pYOXhI3QoKhoEorIwmYuf7dPaWpdcmmDoqVT3mBWQ32kOMZ5zm5krgFhsp.LlmpmxlWG1lngHBwK KOHV21r8augO16ODVSYqSTVHB5KORHUKyYmSYR3kfdi4tgbtU3rQB_fewnf6fp9L_D_sJe4F.2AS RIRBBtnskBaii582BL2zYjAljRDCO6qCKcVkwXNTT60T.wOBQnfy5Ig6QX1vi7Bv62Of5Q55OyjY 0OugMg9seuNFdrVZFWEYRv6XJiGuj7kF4K0.BwoiVo1SOcXf3wT3BBp2NcU877Qvt.rXT_b1vx8q FvW7xPyA7S3nrBRCglv_4ZpPTaa.QfF.t8_CKD47J.3aZgOnwHEH9ryhn26A4jEGNqxrjc1VB8mW G4bVoV_6nFzzZmAL28bjO9XwH5P14pQzuXVXQeMmZM6RDNIxgYG6LiiWJ328bC0iwbajNN2z2esO 1R8luXCIV7ng83k1H0R5MO4ZdU8NfTXPim68Sez_4fLwNN9UTdBeqGJBbrHmMuTIiUxadWWWuYrR .OcVUwupp.QilyX7tEp4yb9Ygf88sboy42ty_hwCMrWqYs2SXfF4DQbrH44aqn48E2zyuVygfNoP w44MqwJslN5oZnhOLB88bAz2IIFCwTBakWOFdMfMR44Te9GDDHKJuzqwrJD156MLrJdWXwdUbPvk 0N8UmUa7240INJSNLq2g0fk8BgH_TMEvxQgzRG6tDAaCvydHIFwIk9C5ER2J5mR8AVYA3VPus.AN _9MBIsDFMFhUQ3Dlh7daXQY6lI.07yxkszmqVGqfXrW9mP3oYz0ZYrkX8zqNC1umMpfLGHDof6jC G803LOaJdiia0Ff4IwLOVvMlubeWl0LC_ONaZIH25K2F_jbYgLdbQUWyyGACUInaWj93F1YQMzrc 29j28c.HKA3.MJjxEYhfvZIllKBH.a0QYBRcr_OCYka7oGeUJL1nwg8G5Ebfqt4mDWpO33RmkET1 AuiMNYz.8duVRV6Vgkztq68bXCA2GxJCsCSwQF5Thuq1TD_e71qGfMVhpSnlt4dU9KVzS5YmfUTT N0G60kBWCLv19byF0w4vNKeLM9DvRsjHeo5z1wI9I4nR6WYvXGvVx0R9Fy8JlL9jKLfSVVbedgSK fOFK6wcMVsiQd6Te7mdjiAA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.gq1.yahoo.com with HTTP; Mon, 16 Mar 2020 04:11:01 +0000 Received: by smtp427.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 22cf11f7dc04fca676c9a413a7f4820c; Mon, 16 Mar 2020 04:10:56 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: Panic on Rpi3 at r358976 From: Mark Millard In-Reply-To: Date: Sun, 15 Mar 2020 21:10:55 -0700 Cc: bob prohaska , "freebsd-arm@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <5A11699F-7EDD-4541-82C0-62993C95EE72@yahoo.com> References: <20200315041203.GA55605@www.zefox.net> <90DE70B3-F3A5-4EFE-832C-7C412744D974@yahoo.com> To: Kyle Evans X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Rspamd-Queue-Id: 48gjXR73Vtz3Lnw X-Spamd-Bar: + X-Spamd-Result: default: False [1.26 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (6.10), ipnet: 98.137.64.0/21(0.83), asn: 36647(0.66), country: US(-0.05)]; NEURAL_SPAM_MEDIUM(0.84)[0.836,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.92)[0.924,0]; RCVD_IN_DNSWL_NONE(0.00)[82.64.137.98.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2020 04:11:06 -0000 On 2020-Mar-15, at 19:03, Kyle Evans wrote: > On Sun, Mar 15, 2020 at 8:54 PM Mark Millard = wrote: >>> On 2020-Mar-15, at 17:33, Kyle Evans wrote: >>=20 >>> On Sat, Mar 14, 2020 at 11:12 PM bob prohaska = wrote: >>>>=20 >>>> Tried to boot a kernel built from r358976 on a Pi3 and got a panic: >>>>=20 >>>> [... snip ...] >>>=20 >>> Hi, >>>=20 >>> I've got a patch against sysutils/u-boot-rpi{3,4} based on what I've >>> submitted upstream that I'm test-building again and will soon be >>> submitting to Phabricator; please give it a shot and confirm if it >>> makes life happier or not: >>> https://people.freebsd.org/~kevans/rpi-psci.diff >>=20 >> I grep'd in the area that holds where I did the >> investigative patch that enabled the RPi4 to boot >> and such without the armstub8-gic.bin memory being >> slamed. (I've not done any clean-out of the materials >> in that area.) >>=20 >> The result is not suggestive of CONFIG_RPI_EFI_NR_SPIN_PAGES >> making a difference: >>=20 >> [... snip ...] >=20 > Indeed; note these lines in my patch: >=20 > PATCHFILES+=3D 1245351/raw 1245352/raw >=20 > These pull in the patches I submitted upstream that introduces > CONFIG_RPI_EFI_NR_SPIN_PAGES so that they don't have to accept an > arbitrary bump of the reserved page count, since it's just our PSCI > stub that's larger. Sorry. The day has gone as one where I need to separately validate that I've not omitted something for pretty much whatever I was trying to do. I applied the patch and rebuilt and substituted the new u-boot.bin for my hacked one. The context is head -r358510 that was booting with my hack okay. (I'll soon be updating to -r358966 .) The result did not go well. Using boot -v indicates that the 2nd page is not protected on the RPi4: ---<>--- KDB: debugger backends: ddb KDB: current backend: ddb Type Physical Virtual #Pages Attr Reserved 000000000000 0 00000001 WB=20 ConventionalMemory 000000001000 1000 00007ef1 WB=20 BootServicesData 000007ef2000 7ef2000 0000001c WB=20 ConventionalMemory 000007f0e000 7f0e000 00029f93 WB=20 BootServicesData 000031ea1000 31ea1000 00000001 WB=20 LoaderData 000031ea2000 31ea2000 00008001 WB=20 LoaderCode 000039ea3000 39ea3000 000000a6 WB=20 Reserved 000039f49000 39f49000 00000007 WB=20 BootServicesData 000039f50000 39f50000 00000001 WB=20 Reserved 000039f51000 39f51000 00000002 WB=20 RuntimeServicesData 000039f53000 39f53000 00000001 WB RUNTIME Reserved 000039f54000 39f54000 00000001 WB=20 BootServicesData 000039f55000 39f55000 00000002 WB=20 RuntimeServicesData 000039f57000 39f57000 00000001 WB RUNTIME LoaderData 000039f58000 39f58000 00001408 WB=20 RuntimeServicesCode 00003b360000 3b360000 00000010 WB RUNTIME LoaderData 00003b370000 3b370000 00000090 WB=20 BootServicesData 000040000000 40000000 000bc000 WB=20 MemoryMappedIO 0000fe100000 fe100000 00000001 RUNTIME Physical memory chunk(s): 0x00001000 - 0x39f48fff, 927 MB ( 237384 pages) 0x39f50000 - 0x39f50fff, 0 MB ( 1 pages) 0x39f53000 - 0x39f53fff, 0 MB ( 1 pages) 0x39f55000 - 0x3b35ffff, 20 MB ( 5131 pages) 0x3b370000 - 0x3b3fffff, 0 MB ( 144 pages) 0x40000000 - 0xfbffffff, 3008 MB ( 770048 pages) Excluded memory regions: 0x00000000 - 0x00000fff, 0 MB ( 1 pages) NoAlloc=20 0x32000000 - 0x337a0fff, 23 MB ( 6049 pages) NoAlloc=20 0x39f49000 - 0x39f4ffff, 0 MB ( 7 pages) NoAlloc=20 0x39f51000 - 0x39f54fff, 0 MB ( 4 pages) NoAlloc=20 0x39f57000 - 0x39f57fff, 0 MB ( 1 pages) NoAlloc=20 0x3b360000 - 0x3b36ffff, 0 MB ( 16 pages) NoAlloc=20 0x3e513000 - 0x3ebebfff, 6 MB ( 1753 pages) NoAlloc=20 0xfe100000 - 0xfe100fff, 0 MB ( 1 pages) NoAlloc=20 Found 4 CPUs in the device tree Copyright (c) 1992-2020 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights = reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 13.0-CURRENT #66 r358510M: Sun Mar 1 18:19:04 PST 2020 = markmi@FBSDFHUGE:/usr/obj/cortexA53_clang/arm64.aarch64/usr/src/arm64.aarc= h64/sys/GENERIC-NODBG arm64 FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git = c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) VT(efifb): resolution 1824x984 Preloaded elf kernel "/boot/kernel/kernel" at 0xffff000001573000. Preloaded elf module "/boot/kernel/ucom.ko" at 0xffff00000157c020. Preloaded boot_entropy_cache "/boot/entropy" at 0xffff00000157c7f8. Preloaded elf module "/boot/kernel/umodem.ko" at 0xffff00000157c850. module firmware already present! Starting CPU 1 (1) Failed to start CPU 1 (1) Starting CPU 2 (2) Failed to start CPU 2 (2) Starting CPU 3 (3) Failed to start CPU 3 (3) FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs random: read 4096 bytes from preloaded cache random: unblocking device. VIMAGE (virtualized network stack) enabled ULE: setup cpu 0 . . . psci0: on ofwbus0 psci0: PSCI version number mismatched with DT device_attach: psci0 attach returned 6 psci0: on ofwbus0 psci0: PSCI version number mismatched with DT device_attach: psci0 attach returned 6 . . . sdhci_bcm0-slot0: Controller timeout sdhci_bcm0-slot0: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D REGISTER = DUMP =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D sdhci_bcm0-slot0: Sys addr: 0x000008c8 | Version: 0x00001002 sdhci_bcm0-slot0: Blk size: 0x00000200 | Blk cnt: 0x00000001 sdhci_bcm0-slot0: Argument: 0x0ee2affe | Trn mode: 0x00000012 sdhci_bcm0-slot0: Present: 0x1fff0a06 | Host ctl: 0x00000007 sdhci_bcm0-slot0: Power: 0x0000000f | Blk gap: 0x00000080 sdhci_bcm0-slot0: Wake-up: 0x00000000 | Clock: 0x00000107 sdhci_bcm0-slot0: Timeout: 0x00000003 | Int stat: 0x00000020 sdhci_bcm0-slot0: Int enab: 0x01ff003b | Sig enab: 0x01ff0009 sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2:0x00000000 sdhci_bcm0-slot0: Caps: 0x45ee6432 | Caps2: 0x0000a525 sdhci_bcm0-slot0: Max curr: 0x00080008 | ADMA err: 0x00000000 sdhci_bcm0-slot0: ADMA addr:0x00000000 | Slot int: 0x00000000 sdhci_bcm0-slot0: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D mmcsd0: Error indicated: 1 Timeout . . . Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 10 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 9 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 8 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 7 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 6 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 5 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 4 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 3 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 2 more seconds Mounting from ufs:/dev/label/RPi4root failed with error 2; retrying for = 1 more second Mounting from ufs:/dev/label/RPi4root failed with error 2. Loader variables: vfs.root.mountfrom=3Dufs:/dev/label/RPi4root vfs.root.mountfrom.options=3Drw,noatime Manual root filesystem specification: : [options] Mount using filesystem and with the specified (optional) option list. eg. ufs:/dev/da0s1a zfs:zroot/ROOT/default cd9660:/dev/cd0 ro (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /) ? List valid disk boot devices . Yield 1 second (for background tasks) Abort manual input mountroot> ? List of GEOM managed disk devices: mmcsd0 Variations of the sdhci_bcm0-slot0 sequence repeats over and over but sometimes with a: sdhci_bcm0-slot0: Got data interrupt 0x00600000, but there is no active = command. after the Timeout notice or instead of it. I've not checked if the rpi/rpi.c code still has: efi_add_memory_map(0, 1, EFI_RESERVED_MEMORY_TYPE, 0) or not. But that would be my guess for where the first page being reserved still comes from, as reported in: Type Physical Virtual #Pages Attr Reserved 000000000000 0 00000001 WB=20 . . . Excluded memory regions: 0x00000000 - 0x00000fff, 0 MB ( 1 pages) NoAlloc=20 . . . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)