Bug 237234 - EFIRT panic on Ampere eMAG
Summary: EFIRT panic on Ampere eMAG
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Only Me
Assignee: Andrew Turner
URL:
Keywords:
Depends on:
Blocks: 237055
  Show dependency treegraph
 
Reported: 2019-04-12 20:51 UTC by Ed Maste
Modified: 2019-09-16 19:23 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2019-04-12 20:51:35 UTC
Boot log excerpt:

EFI Runtime entry 234 mapping attributes unsupported
MAP 10540000 mode 1 pages 16
nfslock: pseudo-device
crypto: <crypto core>
kbd0 at kbdmux0
mem: <memory>
null: <full device, null device, zero device>
openfirm: <Open Firmware control device>
ACPI: RSDP 0x000000BFF3870000 000024 (v02 ALASKA)
ACPI: XSDT 0x000000BFF3870028 00009C (v01 ALASKA A M I    01072009 AMI  00010013)
ACPI: FACP 0x000000BFF38700C8 000114 (v06 Ampere eMAG     00000003 INTL 20171215)
ACPI: DSDT 0x000000BFF38701E0 007648 (v05 ALASKA A M I    00000001 INTL 20171215)
ACPI: FIDT 0x000000BFF3877828 00009C (v01 ALASKA A M I    01072009 AMI  00010013)
ACPI: DBG2 0x000000BFF38778C8 000061 (v00 Ampere eMAG     00000000 INTL 20171215)
ACPI: GTDT 0x000000BFF3877930 000108 (v02 Ampere eMAG     00000001 INTL 20171215)
ACPI: IORT 0x000000BFF3877A38 000ABC (v00 Ampere eMAG     00000000 INTL 20171215)
ACPI: MCFG 0x000000BFF38784F8 0000AC (v01 Ampere eMAG     00000001 INTL 20171215)
ACPI: SSDT 0x000000BFF38785A8 00002D (v02 Ampere eMAG     00000001 INTL 20171215)
ACPI: SPMI 0x000000BFF38785D8 000041 (v05 ALASKA A M I    00000000 AMI. 00000000)
ACPI: APIC 0x000000BFF3878620 000A68 (v04 Ampere eMAG     00000004      01000013)
ACPI: PCCT 0x000000BFF3879088 0005D0 (v01 Ampere eMAG     00000003      01000013)
ACPI: BERT 0x000000BFF3879658 000030 (v01 Ampere eMAG     00000003 INTL 20171215)
ACPI: HEST 0x000000BFF3879688 000328 (v01 Ampere eMAG     00000003 INTL 20171215)
ACPI: SPCR 0x000000BFF38799B0 000050 (v02 A M I  APTIO V  01072009 AMI. 0005000D)
ACPI: PPTT 0x000000BFF3879A00 000CB8 (v01 Ampere eMAG     00000003      01000013)
ACPI: BGRT 0x000000BFF387A6B8 000038 (v01 ALASKA A M I    01072009 AMI  00010013)
  x0:                0
  x1:               35
  x2:             464e
  x3:          18b7b70
  x4:           b88ef0
  x5:             1b45
  x6:                0
  x7:             1b45
  x8:                0
  x9:          18b7b70
 x10:                0
 x11:          18b7b93
 x12:                0
 x13:             1b45
 x14:                0
 x15: c38eba145d633e8e
 x16:            8861d
 x17: c38eba145d633e8e
 x18: ffff0000000108f0
 x19: ffff000000010938
 x20:                0
 x21: ffff00000077dbfc
 x22: fffffd0010d55b70
 x23: ffff000000cde000
 x24: fffffd0010e71e80
 x25: fffffd0010d50a80
 x26: fffffd0010e71ed8
 x27:                0
 x28: fffffd0010d5b800
 x29: ffff000000010910
  sp: ffff0000000108f0
  lr: ffff000000140c34
 elr: ffff0000006c151c
spsr:         200001c5
 far:            8861d
 esr:         96000006
panic: data abort in critical section or under mutex
cpuid = 0
time = 1
KDB: stack backtrace:
db_trace_self() at db_trace_self_wrapper+0x28
         pc = 0xffff0000006bf8a0  lr = 0xffff0000000fd788
         sp = 0xffff0000000102e0  fp = 0xffff0000000104f0

db_trace_self_wrapper() at vpanic+0x18c
         pc = 0xffff0000000fd788  lr = 0xffff0000003af598
         sp = 0xffff000000010500  fp = 0xffff0000000105b0

vpanic() at panic+0x44
         pc = 0xffff0000003af598  lr = 0xffff0000003af360
         sp = 0xffff0000000105c0  fp = 0xffff000000010640

panic() at data_abort+0x290
         pc = 0xffff0000003af360  lr =
         sp = 0xffff00  fp = 0xffff000000010700

data_abort() at do_el1h_sync+0x128
         pc = 0xffff0000006daee8  lr = 0xffff0000006dab54
         sp = 0xffff000000010710  fp = 0xffff000000010740

do_el1h_sync() at handle_el1h_sync+0x74
         pc = 0xffff0000006dab54  lr = 0xffff0000006c2074
         sp = 0xffff000000010750  fp = 0xffff000000010860

handle_el1h_sync() at efi_call+0x144
         pc = 0xffff0000006c2074  lr = 0xffff000000140c30
         sp = 0xffff000000010870  fp = 0xffff000000010910

efi_call() at efi_get_time+0x50
         pc = 0xffff000000140c30  lr = 0xffff0000001409f4
         sp = 0xffff000000010920  fp = 0xffff000000010980

efi_get_time() at efirtc_probe+0x18
         pc = 0xffff0000001409f4  lr = 0xffff000000141268
         sp = 0xffff000000010990  fp = 0xffff0000000109b0

efirtc_probe() at device_probe_child+0x118
         pc = 0xffff000000141268  lr = 0xffff0000003e1754
         sp = 0xffff0000000109c0  fp = 0xffff000000010a20

device_probe_child() at device_probe+0xa4
         pc = 0xffff0000003e1754  lr = 0xffff0000003e24f0
         sp = 0xffff000000010a30  fp = 0xffff000000010a50

device_probe() at device_probe_and_attach+0x34
         pc = 0xffff0000003e24f0  lr = 0xffff0000003e25bc
         sp = 0xffff000000010a60  fp = 0xffff000000010a80

device_probe_and_attach() at bus_generic_new_pass+0xec
         pc = 0xffff0000003e25bc  lr = 0xffff0000003e4380
         sp = 0xffff000000010a90  fp = 0xffff000000010ac0

bus_generic_new_pass() at bus_generic_new_pass+0xd0
         pc = 0xffff0000003e4380  lr = 0xffff0000003e4364
         sp = 0xffff000000010ad0  fp = 0xffff000000010b00

bus_generic_new_pass() at bus_set_pass+0x8c
         pc = 0xffff0000003e4364  lr = 0xffff0000003e01d8
         sp = 0xffff000000010b10  fp = 0xffff000000010b40

bus_set_pass() at mi_startup+0x238
         pc = 0xffff0000003e01d8  lr = 0xffff00000034a8ec
         sp = 0xffff000000010b50  fp = 0xffff000000010bb0

mi_startup() at virtdone+0x54
         pc = 0xffff00000034a8ec  lr = 0xffff000000001084
         sp = 0xffff000000010bc0  fp = 0x0000000000000000

KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at      efi_arch_leave: ldr     x8, [x18]
db> reset
cpu_reset failed~. [terminated ipmitool]
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-05-01 17:13:30 UTC
A commit references this bug:

Author: andrew
Date: Wed May  1 17:12:50 UTC 2019
New revision: 346996
URL: https://svnweb.freebsd.org/changeset/base/346996

Log:
  Restore x18 in efi_arch_leave.

  Some UEFI implementations trash this register and, as we use it as a
  platform register, the kernel doesn't save it before calling into the UEFI
  runtime services. As we have a copy in tpidr_el1 restore from there when
  exiting the EFI environment.

  PR:		237234, 237055
  Reviewed by:	manu
  Tested On:	Ampere eMAG
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL
  Sponsored by:	Ampere Computing (hardware)
  Differential Revision:	https://reviews.freebsd.org/D20127

Changes:
  head/sys/arm64/arm64/efirt_machdep.c
Comment 2 Ed Maste freebsd_committer freebsd_triage 2019-09-13 20:25:54 UTC
Andy will you MFC this change?
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-09-16 13:46:04 UTC
A commit references this bug:

Author: andrew
Date: Mon Sep 16 13:45:32 UTC 2019
New revision: 352395
URL: https://svnweb.freebsd.org/changeset/base/352395

Log:
  MFC r346996:

  Restore x18 in efi_arch_leave.

  Some UEFI implementations trash this register and, as we use it as a
  platform register, the kernel doesn't save it before calling into the UEFI
  runtime services. As we have a copy in tpidr_el1 restore from there when
  exiting the EFI environment.

  PR:		237234, 237055
  Reviewed by:	manu
  Tested On:	Ampere eMAG
  Sponsored by:	DARPA, AFRL
  Sponsored by:	Ampere Computing (hardware)
  Differential Revision:	https://reviews.freebsd.org/D20127

Changes:
_U  stable/12/
  stable/12/sys/arm64/arm64/efirt_machdep.c