Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Mar 2018 12:02:18 +0000
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Michael Tuexen <tuexen@freebsd.org>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: arm64 panics on boot on a RPi3
Message-ID:  <AE5CA729-3026-4649-9651-B3A2A64AF9B3@fubar.geek.nz>
In-Reply-To: <7D7EAF74-95E3-4B48-BC57-C3CE4D13501B@freebsd.org>
References:  <7D7EAF74-95E3-4B48-BC57-C3CE4D13501B@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
You need to update loader.efi. A recent change to the kernel means we =
can now enable the EFI runtime services when booting from U-Boot. There =
is however an issue where if you try to read the time before calling =
SetVirtualAddressMap it will try to call into a function out side of the =
runtime map. As this isn=E2=80=99t a valid address we don=E2=80=99t =
include it in the memory map so you get the panic below.

It doesn=E2=80=99t seem to be an issue on UEFI implementations derived =
from EDK2.

Andrew

> On 17 Mar 2018, at 10:20, Michael Tuexen <tuexen@freebsd.org> wrote:
>=20
> Dear all,
>=20
> FreeBSD head of today panics when booting the arm64 code on a RPi3:
>=20
>>> FreeBSD EFI boot block
>   Loader path: /boot/loader.efi
>=20
>   Initializing modules: UFS
>   Probing 3 block devices.....* done
>    UFS found 1 partition
> Consoles: EFI console =20
> Command line arguments: loader.efi
> Image base: 0x39ab8008
> EFI version: 2.05
> EFI Firmware: Das U-boot (rev 0.00)
>=20
> FreeBSD/arm64 EFI loader, Revision 1.1
> (Wed Dec  6 19:13:14 CET 2017 root@bsd18.fh-muenster.de)
> EFI boot environment
> Loading /boot/defaults/loader.conf
> /boot/kernel/kernel text=3D0x8482a0 data=3D0x137018+0x71f83c =
syms=3D[0x8+0x1148a0+0x8+0x106675]
> /boot/entropy size=3D0x1000
> /boot/kernel/geom_label.ko text=3D0x2b40 text=3D0x2610 =
data=3D0x10120+0xfee4 syms=3D[0x8+0x15a8+0x8+0xf73]
>=20
> Hit [Enter] to boot immediately, or any other key for command prompt.
> Booting [/boot/kernel/kernel]...              =20
> Using DTB provided by EFI at 0x8004000.
> KDB: debugger backends: ddb
> KDB: current backend: ddb
> Copyright (c) 1992-2018 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 12.0-CURRENT #65 r331093: Sat Mar 17 11:05:06 CET 2018
>    =
tuexen@bsd10.fh-muenster.de:/usr/home/tuexen/head/sys/arm64/compile/TCP =
arm64
> FreeBSD clang version 5.0.1 (branches/release_50 319231) (based on =
LLVM 5.0.1)
> VT: init without driver.
> sysctl_warn_reuse: can't re-use a leaf (kern.features.geom_label)!
> module_register: cannot register g_label from kernel; already loaded =
from geom_label.ko
> Module g_label failed to register: 17
> Starting CPU 1 (1)
> Starting CPU 2 (2)
> Starting CPU 3 (3)
> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
> random: unblocking device.
> MAP 39b1b000 mode 2 pages 1
> MAP 3af86000 mode 2 pages 2
> MAP 3f100000 mode 1 pages 1
> random: entropy device external interface
> kbd0 at kbdmux0
> ofwbus0: <Open Firmware Device Tree>
> simplebus0: <Flattened device tree simple bus> on ofwbus0
> ofw_clkbus0: <OFW clocks bus> on ofwbus0
> clk_fixed0: <Fixed clock> on ofw_clkbus0
> clk_fixed1: <Fixed clock> on ofw_clkbus0
> regfix0: <Fixed Regulator> on ofwbus0
> regfix1: <Fixed Regulator> on ofwbus0
> psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
> local_intc0: <BCM2836 Interrupt Controller> mem 0x40000000-0x400000ff =
on simplebus0
> intc0: <BCM2835 Interrupt Controller> mem 0x7e00b200-0x7e00b3ff irq 16 =
on simplebus0
> generic_timer0: <ARMv7 Generic Timer> irq 47,48,49,50 on simplebus0
> Timecounter "ARM MPCore Timecounter" frequency 19200000 Hz quality =
1000
> Event timer "ARM MPCore Eventtimer" frequency 19200000 Hz quality 1000
>  x0: ffff0000000109e0
>  x1: ffff0000000109b0
>  x2:                4
>  x3: ffff00000043e638
>  x4: ffff00000076eb28
>  x5:              110
>  x6: ffff000000010808
>  x7: ffff000000010638
>  x8:         3af61fd0
>  x9:                0
> x10: ffff000000993f20
> x11:                0
> x12: ffff0000003b3ab4
> x13: ffff00000043e2f0
> x14:                a
> x15:                0
> x16:                7
> x17: ffff00000043e2f0
> x18: ffff0000000109b0
> x19: ffff0000000109e0
> x20: ffff000000993000
> x21: ffff000000b89000
> x22: fffffd00012d9070
> x23:                0
> x24: fffffd00011c1d00
> x25: fffffd00011c1c80
> x26: fffffd00011c1cd8
> x27:                0
> x28: fffffd00011d0080
> x29: ffff0000000109d0
>  sp: ffff0000000109b0
>  lr: ffff0000000fee88
> elr:         3af61fd0
> spsr:         a00001c5
> far:         3af61fd0
> esr:         86000007
> panic: data abort in critical section or under mutex
> cpuid =3D 0
> time =3D 1
> KDB: stack backtrace:
> db_trace_self() at db_trace_self_wrapper+0x28
> 	 pc =3D 0xffff00000066ead0  lr =3D 0xffff0000000ba870
> 	 sp =3D 0xffff0000000103a0  fp =3D 0xffff0000000105b0
>=20
> db_trace_self_wrapper() at vpanic+0x19c
> 	 pc =3D 0xffff0000000ba870  lr =3D 0xffff000000362fb0
> 	 sp =3D 0xffff0000000105c0  fp =3D 0xffff000000010670
>=20
> vpanic() at panic+0x44
> 	 pc =3D 0xffff000000362fb0  lr =3D 0xffff000000362e10
> 	 sp =3D 0xffff000000010680  fp =3D 0xffff000000010700
>=20
> panic() at data_abort+0x21c
> 	 pc =3D 0xffff000000362e10  lr =3D 0xffff0000006868b8
> 	 sp =3D 0xffff000000010710  fp =3D 0xffff0000000107c0
>=20
> data_abort() at do_el1h_sync+0x11c
> 	 pc =3D 0xffff0000006868b8  lr =3D 0xffff000000686598
> 	 sp =3D 0xffff0000000107d0  fp =3D 0xffff000000010800
>=20
> do_el1h_sync() at handle_el1h_sync+0x74
> 	 pc =3D 0xffff000000686598  lr =3D 0xffff000000671074
> 	 sp =3D 0xffff000000010810  fp =3D 0xffff000000010920
>=20
> handle_el1h_sync() at efi_get_time+0x38
> 	 pc =3D 0xffff000000671074  lr =3D 0xffff0000000fee84
> 	 sp =3D 0xffff000000010930  fp =3D 0xffff0000000109d0
>=20
> efi_get_time() at efirtc_probe+0x18
> 	 pc =3D 0xffff0000000fee84  lr =3D 0xffff0000000ff5b8
> 	 sp =3D 0xffff0000000109e0  fp =3D 0xffff000000010a00
>=20
> efirtc_probe() at device_probe_child+0x150
> 	 pc =3D 0xffff0000000ff5b8  lr =3D 0xffff000000397c1c
> 	 sp =3D 0xffff000000010a10  fp =3D 0xffff000000010a70
>=20
> device_probe_child() at device_probe+0x88
> 	 pc =3D 0xffff000000397c1c  lr =3D 0xffff0000003988ac
> 	 sp =3D 0xffff000000010a80  fp =3D 0xffff000000010aa0
>=20
> device_probe() at bus_generic_new_pass+0xec
> 	 pc =3D 0xffff0000003988ac  lr =3D 0xffff00000039a78c
> 	 sp =3D 0xffff000000010ab0  fp =3D 0xffff000000010ae0
>=20
> bus_generic_new_pass() at bus_generic_new_pass+0xd0
> 	 pc =3D 0xffff00000039a78c  lr =3D 0xffff00000039a770
> 	 sp =3D 0xffff000000010af0  fp =3D 0xffff000000010b20
>=20
> bus_generic_new_pass() at root_bus_configure+0x78
> 	 pc =3D 0xffff00000039a770  lr =3D 0xffff00000039c700
> 	 sp =3D 0xffff000000010b30  fp =3D 0xffff000000010b60
>=20
> root_bus_configure() at mi_startup+0xc8
> 	 pc =3D 0xffff00000039c700  lr =3D 0xffff0000002fbbcc
> 	 sp =3D 0xffff000000010b70  fp =3D 0xffff000000010bb0
>=20
> mi_startup() at virtdone+0x54
> 	 pc =3D 0xffff0000002fbbcc  lr =3D 0xffff000000001084
> 	 sp =3D 0xffff000000010bc0  fp =3D 0x0000000000000000
>=20
> KDB: enter: panic
> [ thread pid 0 tid 100000 ]
> Stopped at      0x3af61fd0:KDB: reentering
> KDB: stack backtrace:
>     db_trace_self() at db_trace_self_wrapper+0x28
>         pc =3D 0xffff00000066ead0  lr =3D 0xffff0000000ba870
>         sp =3D 0xffff00000000f990  fp =3D 0xffff00000000fba0
>=20
> db_trace_self_wrapper() at kdb_reenter+0x38
>         pc =3D 0xffff0000000ba870  lr =3D 0xffff0000003a778c
>         sp =3D 0xffff00000000fbb0  fp =3D 0xffff00000000fbc0
>=20
> kdb_reenter() at do_el1h_sync+0x11c
>         pc =3D 0xffff0000003a778c  lr =3D 0xffff000000686598
>         sp =3D 0xffff00000000fbd0  fp =3D 0xffff00000000fc00
>=20
> do_el1h_sync() at handle_el1h_sync+0x74
>         pc =3D 0xffff000000686598  lr =3D 0xffff000000671074
>         sp =3D 0xffff00000000fc10  fp =3D 0xffff00000000fd20
>=20
> handle_el1h_sync() at db_read_bytes+0x34
>         pc =3D 0xffff000000671074  lr =3D 0xffff00000066e878
>         sp =3D 0xffff00000000fd30  fp =3D 0xffff00000000ffe0
>=20
> db_read_bytes() at db_get_value+0x38
>         pc =3D 0xffff00000066e878  lr =3D 0xffff0000000b69fc
>         sp =3D 0xffff00000000fff0  fp =3D 0xffff000000010020
>=20
> db_get_value() at db_disasm_read_word+0x10
>         pc =3D 0xffff0000000b69fc  lr =3D 0xffff00000066e7f4
>         sp =3D 0xffff000000010030  fp =3D 0xffff000000010030
>=20
> db_disasm_read_word() at disasm+0x40
>         pc =3D 0xffff00000066e7f4  lr =3D 0xffff00000066f6a0
>         sp =3D 0xffff000000010040  fp =3D 0xffff0000000100a0
>=20
> disasm() at db_print_loc_and_inst+0x40
>         pc =3D 0xffff00000066f6a0  lr =3D 0xffff0000000b8adc
>         sp =3D 0xffff0000000100b0  fp =3D 0xffff0000000100c0
>=20
> db_print_loc_and_inst() at db_trap+0xd4
>         pc =3D 0xffff0000000b8adc  lr =3D 0xffff0000000ba9b8
>         sp =3D 0xffff0000000100d0  fp =3D 0xffff0000000102f0
>=20
> db_trap() at kdb_trap+0x1c8
>         pc =3D 0xffff0000000ba9b8  lr =3D 0xffff0000003a7bdc
>         sp =3D 0xffff000000010300  fp =3D 0xffff0000000103b0
>=20
> kdb_trap() at do_el1h_sync+0xf0
>         pc =3D 0xffff0000003a7bdc  lr =3D 0xffff00000068656c
>         sp =3D 0xffff0000000103c0  fp =3D 0xffff0000000103f0
>=20
> do_el1h_sync() at handle_el1h_sync+0x74
>         pc =3D 0xffff00000068656c  lr =3D 0xffff000000671074
>         sp =3D 0xffff000000010400  fp =3D 0xffff000000010510
>=20
> handle_el1h_sync() at kdb_enter+0x34
>         pc =3D 0xffff000000671074  lr =3D 0xffff0000003a7280
>         sp =3D 0xffff000000010520  fp =3D 0xffff0000000105b0
>=20
> kdb_enter() at vpanic+0x1b8
>         pc =3D 0xffff0000003a7280  lr =3D 0xffff000000362fcc
>         sp =3D 0xffff0000000105c0  fp =3D 0xffff000000010670
>=20
> vpanic() at panic+0x44
>         pc =3D 0xffff000000362fcc  lr =3D 0xffff000000362e10
>         sp =3D 0xffff000000010680  fp =3D 0xffff000000010700
>=20
> panic() at data_abort+0x21c
>         pc =3D 0xffff000000362e10  lr =3D 0xffff0000006868b8
>         sp =3D 0xffff000000010710  fp =3D 0xffff0000000107c0
>=20
> data_abort() at do_el1h_sync+0x11c
>         pc =3D 0xffff0000006868b8  lr =3D 0xffff000000686598
>         sp =3D 0xffff0000000107d0  fp =3D 0xffff000000010800
>=20
> do_el1h_sync() at handle_el1h_sync+0x74
>         pc =3D 0xffff000000686598  lr =3D 0xffff000000671074
>         sp =3D 0xffff000000010810  fp =3D 0xffff000000010920
>=20
> handle_el1h_sync() at efi_get_time+0x38
>         pc =3D 0xffff000000671074  lr =3D 0xffff0000000fee84
>         sp =3D 0xffff000000010930  fp =3D 0xffff0000000109d0
>=20
> efi_get_time() at efirtc_probe+0x18
>         pc =3D 0xffff0000000fee84  lr =3D 0xffff0000000ff5b8
>         sp =3D 0xffff0000000109e0  fp =3D 0xffff000000010a00
>=20
> efirtc_probe() at device_probe_child+0x150
>         pc =3D 0xffff0000000ff5b8  lr =3D 0xffff000000397c1c
>         sp =3D 0xffff000000010a10  fp =3D 0xffff000000010a70
>=20
> device_probe_child() at device_probe+0x88
>         pc =3D 0xffff000000397c1c  lr =3D 0xffff0000003988ac
>         sp =3D 0xffff000000010a80  fp =3D 0xffff000000010aa0
>=20
> device_probe() at bus_generic_new_pass+0xec
>         pc =3D 0xffff0000003988ac  lr =3D 0xffff00000039a78c
>         sp =3D 0xffff000000010ab0  fp =3D 0xffff000000010ae0
>=20
> bus_generic_new_pass() at bus_generic_new_pass+0xd0
>         pc =3D 0xffff00000039a78c  lr =3D 0xffff00000039a770
>         sp =3D 0xffff000000010af0  fp =3D 0xffff000000010b20
>=20
> bus_generic_new_pass() at root_bus_configure+0x78
>         pc =3D 0xffff00000039a770  lr =3D 0xffff00000039c700
>         sp =3D 0xffff000000010b30  fp =3D 0xffff000000010b60
>=20
> root_bus_configure() at mi_startup+0xc8
>         pc =3D 0xffff00000039c700  lr =3D 0xffff0000002fbbcc
>         sp =3D 0xffff000000010b70  fp =3D 0xffff000000010bb0
>=20
> mi_startup() at virtdone+0x54
>         pc =3D 0xffff0000002fbbcc  lr =3D 0xffff000000001084
>         sp =3D 0xffff000000010bc0  fp =3D 0x0000000000000000
>=20
> *** error reading from address 3af61fd0 ***
> KDB: reentering
> KDB: stack backtrace:
> db_trace_self() at db_trace_self_wrapper+0x28
>         pc =3D 0xffff00000066ead0  lr =3D 0xffff0000000ba870
>         sp =3D 0xffff00000000fdb0  fp =3D 0xffff00000000ffc0
>=20
> db_trace_self_wrapper() at kdb_reenter+0x38
>         pc =3D 0xffff0000000ba870  lr =3D 0xffff0000003a778c
>         sp =3D 0xffff00000000ffd0  fp =3D 0xffff00000000ffe0
>=20
> kdb_reenter() at db_get_value+0x50
>         pc =3D 0xffff0000003a778c  lr =3D 0xffff0000000b6a14
>         sp =3D 0xffff00000000fff0  fp =3D 0xffff000000010020
>=20
> db_get_value() at db_disasm_read_word+0x10
>         pc =3D 0xffff0000000b6a14  lr =3D 0xffff00000066e7f4
>         sp =3D 0xffff000000010030  fp =3D 0xffff000000010030
>=20
> db_disasm_read_word() at disasm+0x40
>         pc =3D 0xffff00000066e7f4  lr =3D 0xffff00000066f6a0
>         sp =3D 0xffff000000010040  fp =3D 0xffff0000000100a0
>=20
> disasm() at db_print_loc_and_inst+0x40
>         pc =3D 0xffff00000066f6a0  lr =3D 0xffff0000000b8adc
>         sp =3D 0xffff0000000100b0  fp =3D 0xffff0000000100c0
>=20
> db_print_loc_and_inst() at db_trap+0xd4
>         pc =3D 0xffff0000000b8adc  lr =3D 0xffff0000000ba9b8
>         sp =3D 0xffff0000000100d0  fp =3D 0xffff0000000102f0
>=20
> db_trap() at kdb_trap+0x1c8
>         pc =3D 0xffff0000000ba9b8  lr =3D 0xffff0000003a7bdc
>         sp =3D 0xffff000000010300  fp =3D 0xffff0000000103b0
>=20
> kdb_trap() at do_el1h_sync+0xf0
>         pc =3D 0xffff0000003a7bdc  lr =3D 0xffff00000068656c
>         sp =3D 0xffff0000000103c0  fp =3D 0xffff0000000103f0
>=20
> do_el1h_sync() at handle_el1h_sync+0x74
>         pc =3D 0xffff00000068656c  lr =3D 0xffff000000671074
>         sp =3D 0xffff000000010400  fp =3D 0xffff000000010510
>=20
> handle_el1h_sync() at kdb_enter+0x34
>         pc =3D 0xffff000000671074  lr =3D 0xffff0000003a7280
>         sp =3D 0xffff000000010520  fp =3D 0xffff0000000105b0
>=20
> kdb_enter() at vpanic+0x1b8
>         pc =3D 0xffff0000003a7280  lr =3D 0xffff000000362fcc
>         sp =3D 0xffff0000000105c0  fp =3D 0xffff000000010670
>=20
> vpanic() at panic+0x44
>         pc =3D 0xffff000000362fcc  lr =3D 0xffff000000362e10
>         sp =3D 0xffff000000010680  fp =3D 0xffff000000010700
>=20
> panic() at data_abort+0x21c
>         pc =3D 0xffff000000362e10  lr =3D 0xffff0000006868b8
>         sp =3D 0xffff000000010710  fp =3D 0xffff0000000107c0
>=20
> data_abort() at do_el1h_sync+0x11c
>         pc =3D 0xffff0000006868b8  lr =3D 0xffff000000686598
>         sp =3D 0xffff0000000107d0  fp =3D 0xffff000000010800
>=20
> do_el1h_sync() at handle_el1h_sync+0x74
>         pc =3D 0xffff000000686598  lr =3D 0xffff000000671074
>         sp =3D 0xffff000000010810  fp =3D 0xffff000000010920
>=20
> handle_el1h_sync() at efi_get_time+0x38
>         pc =3D 0xffff000000671074  lr =3D 0xffff0000000fee84
>         sp =3D 0xffff000000010930  fp =3D 0xffff0000000109d0
>=20
> efi_get_time() at efirtc_probe+0x18
>         pc =3D 0xffff0000000fee84  lr =3D 0xffff0000000ff5b8
>         sp =3D 0xffff0000000109e0  fp =3D 0xffff000000010a00
>=20
> efirtc_probe() at device_probe_child+0x150
>         pc =3D 0xffff0000000ff5b8  lr =3D 0xffff000000397c1c
>         sp =3D 0xffff000000010a10  fp =3D 0xffff000000010a70
>=20
> device_probe_child() at device_probe+0x88
>         pc =3D 0xffff000000397c1c  lr =3D 0xffff0000003988ac
>         sp =3D 0xffff000000010a80  fp =3D 0xffff000000010aa0
>=20
> device_probe() at bus_generic_new_pass+0xec
>         pc =3D 0xffff0000003988ac  lr =3D 0xffff00000039a78c
>         sp =3D 0xffff000000010ab0  fp =3D 0xffff000000010ae0
>=20
> bus_generic_new_pass() at bus_generic_new_pass+0xd0
>         pc =3D 0xffff00000039a78c  lr =3D 0xffff00000039a770
>         sp =3D 0xffff000000010af0  fp =3D 0xffff000000010b20
>=20
> bus_generic_new_pass() at root_bus_configure+0x78
>         pc =3D 0xffff00000039a770  lr =3D 0xffff00000039c700
>         sp =3D 0xffff000000010b30  fp =3D 0xffff000000010b60
>=20
> root_bus_configure() at mi_startup+0xc8
>         pc =3D 0xffff00000039c700  lr =3D 0xffff0000002fbbcc
>         sp =3D 0xffff000000010b70  fp =3D 0xffff000000010bb0
>=20
> mi_startup() at virtdone+0x54
>         pc =3D 0xffff0000002fbbcc  lr =3D 0xffff000000001084
>         sp =3D 0xffff000000010bc0  fp =3D 0x0000000000000000
>=20
> db>=20
>=20
> Any idea what goes wrong?
>=20
> Best regards
> Michael
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AE5CA729-3026-4649-9651-B3A2A64AF9B3>