Re: Kernel crash before login prompt

From: <andrew_at_fubar.geek.nz>
Date: Thu, 29 Jun 2023 14:47:41 UTC
Can you find out which function 0xffff0000002244dc is from (i.e. the 
caller of __mtx_lock_spin_flags)? It looks like it is in sched_pickcpu, 
but it also looks like sched_pickcpu should return before calling 
__mtx_lock_spin_flags based on the boot log.

Andrew

On 2023-06-29 14:26, Sha Faisal wrote:
> Below are the values you asked for
> 
> Just after dpcpu_init() in initarm()
> 
> --------In initarm and pcpup->pc_dynamic = 0x2886480
> 
> --------In initarm and dpcpu_off[0] = 0x2886480
> 
> --------In initarm and DPCPU_START = 0xffff000000681b80
> 
> --------In initarm and DPCPU_STOP = 0xffff000000687300
> 
> --------In initarm and DPCPU_BYTES = 0x5780
> 
> --------In initarm and DPCPU_SIZE = 0x6000
> 
> --------In initarm and PAGE_SIZE = 0x1000
> 
> --------In initarm and pcpu = 0xffff00000095bd80
> 
> --------In initarm and pcpu_entry_timerstate is 0xffff00000068ac80----
> 
> 
> --------In initarm and __start_set_pcpu is 0----
> 
> --------In initarm and pcpu_entry_tdq is 0xffff00000068ac80----
> 
> ---<<BOOT>>---
> 
> Below are after it crashes on db prompt:
> 
> db> p __start_set_pcpu
> ffff000000681b80
> db> p __stop_set_pcpu
> ffff000000687300
> db>  show dpcpu_off
> dpcpu_off[ 0] = 0x2886480 (+ DPCPU_START = 0xffff000002f08000)
> 
> db> p pcpu_entry_tdq
> 
> ffff000000681c80
> 
> Regards
> 
> Faisal
> 
>  Juniper Business Use Only
>  From: owner-freebsd-arm@freebsd.org <owner-freebsd-arm@freebsd.org>
> on behalf of Andrew Turner <andrew@fubar.geek.nz>
> Date: Thursday, 29 June 2023 at 15:27
> To: Sha Faisal <sfaisal@juniper.net>
> Cc: freebsd-arm@FreeBSD.org <freebsd-arm@FreeBSD.org>, Steve Kiernan
> <stevek@juniper.net>, Mahesh Vardhamanaiah <maheshmv@juniper.net>
> Subject: Re: Kernel crash before login prompt
> 
> [External Email. Be cautious of content]
> 
> It looks like that exception is due to DPCPU_ID_PTR calculating an
> invalid pointer.
> 
> Can you print the contents of the dpcpu_off array, and the addresses
> of __start_set_pcpu and pcpu_entry_tdq.
> 
> Andrew
> 
>> On 28 Jun 2023, at 19:45, Sha Faisal <sfaisal@juniper.net> wrote:
>> 
>> Hello Andrew,
>> 
>> Attached is the boot log,  also at the end I have pasted the remote
>> gdb backtrace
>> 
>> Regards
>> 
>> faisal
>> 
>> Juniper Business Use Only
>> 
>> From: Andrew Turner <andrew@fubar.geek.nz>
>> Date: Wednesday, 28 June 2023 at 20:47
>> To: Sha Faisal <sfaisal@juniper.net>
>> Cc: freebsd-arm@FreeBSD.org <freebsd-arm@FreeBSD.org>, Steve Kiernan
>> <stevek@juniper.net>, Mahesh Vardhamanaiah <maheshmv@juniper.net>
>> Subject: Re: Kernel crash before login prompt
>> 
>> [External Email. Be cautious of content]
>> 
>>> On 28 Jun 2023, at 13:18, Sha Faisal <sfaisal@juniper.net> wrote:
>>> 
>>> Hello FreeBSD team,
>>> 
>>> We have upgraded our FreeBSD kernel from 12 to main branch and
>>> with latest main branch one of our boxes with
>>> 
>>> Broadcom iProc Northstar2 BCM5871X SoC (Quad-core ARM Cortex-A57
>>> 64-bit 2GHz ARMv8-A CPU architecture) is crashing at
>>> mtx_spin_lock_flags(), with data_abort exception.
>>> 
>>> Sometimes the exception is raised at DPCPCU_PTR() functions.
>>> 
>>> Has anyone tried to boot freeBSD14 on the above mentioned BCM SoC?
>>> 
>>> 
>>> Please share your inputs and comment
>> 
>> I don’t know of any issues with either of these, and don’t know
>> of anyone running FreeBSD on this SoC.
>> 
>> Can you provide more details on what is failing, e.g. the boot log?
>> 
>> Andrew