Re: Kernel crash before login prompt

From: <andrew_at_fubar.geek.nz>
Date: Fri, 30 Jun 2023 10:55:47 UTC
On 2023-06-30 10:48, Mahesh Vardhamanaiah wrote:
> Hi Andrew,
> 
> We are observing that self is getting -65536 at line 1329 in
> sched_pickcpu() before panic.

What is the disassembly around reading the cpuid? It looks like it is 
getting 0xffff0000 when it should be zero.

> 
> From the code flow
> 
> sched_add [1](struct thread [2] *td [3], int flags [4])->
> sched_pickcpu()->PCPU_GET
> 
> as below
> 
> static int
> 
>  1321 [5] sched_pickcpu [6](struct thread [2] *td [3], int flags [4])
> 
>  1322 [7] {
> 
>  1323 [8]         struct cpu_group [9] *cg [10], *ccg;
> 
>  1324 [11]         struct td_sched [12] *ts [13];
> 
>  1325 [14]         struct tdq [15] *tdq [15];
> 
>  1326 [16]         cpuset_t [17] *mask [18];
> 
>  1327 [19]         int cpu [20], pri, r [21], self [22], intr;
> 
>  1328 [23]
> 
>  1329 [24]         self [22] = PCPU_GET [25](cpuid [26]);
> 
> PCPU_GET is defined differently in Freebsd14 compared to Freebsd12 but
> I am  unable to dump the pcpup in db> prompt is it proper ?
> 
> Is it expected to be a global ?

You can print all pcpu structs with "show allpcpu".

Andrew