From owner-svn-src-head@freebsd.org Sun Nov 26 09:46:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4E2CDBA9D5; Sun, 26 Nov 2017 09:46:54 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4081B65992; Sun, 26 Nov 2017 09:46:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:84de:169d:1c70:7c3d] (unknown [IPv6:2a02:c7f:1e13:cf00:84de:169d:1c70:7c3d]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 199A24E6DC; Sun, 26 Nov 2017 09:46:47 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r326218 - head/sys/kern From: Andrew Turner In-Reply-To: <201711252341.vAPNf5Qx001464@repo.freebsd.org> Date: Sun, 26 Nov 2017 09:46:46 +0000 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <59383A7D-FC99-4748-9561-53D968C4B150@fubar.geek.nz> References: <201711252341.vAPNf5Qx001464@repo.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Nov 2017 09:46:54 -0000 On 25 Nov 2017, at 23:41, Nathan Whitehorn = wrote: >=20 > Author: nwhitehorn > Date: Sat Nov 25 23:41:05 2017 > New Revision: 326218 > URL: https://svnweb.freebsd.org/changeset/base/326218 >=20 > Log: > Remove some, but not all, assumptions that the BSP is CPU 0 and that = CPUs > are numbered densely from there to n_cpus. >=20 > MFC after: 1 month >=20 > Modified: > head/sys/kern/kern_clock.c > head/sys/kern/kern_clocksource.c > head/sys/kern/kern_shutdown.c > head/sys/kern/kern_timeout.c > head/sys/kern/sched_ule.c > head/sys/kern/subr_pcpu.c >=20 ... > Modified: head/sys/kern/subr_pcpu.c > = =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=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 > --- head/sys/kern/subr_pcpu.c Sat Nov 25 23:23:24 2017 = (r326217) > +++ head/sys/kern/subr_pcpu.c Sat Nov 25 23:41:05 2017 = (r326218) > @@ -279,6 +279,8 @@ pcpu_destroy(struct pcpu *pcpu) > struct pcpu * > pcpu_find(u_int cpuid) > { > + KASSERT(cpuid_to_pcpu[cpuid] !=3D NULL, > + ("Getting uninitialized PCPU %d", cpuid)); >=20 > return (cpuid_to_pcpu[cpuid]); > } This breaks on one arm64 simulator I have where the device tree lists 8 = cpus, but only 2 are enabled in the simulation. The ofw_cpu device nodes = for these are cpu0 and cpu4 so the call to cpu_find in ofw_cpu_attach = will hit this KASSERT when the CPU has not been enabled. Andrew cpu0: on cpulist0 cpu1: on cpulist0 panic: Getting uninitialized PCPU 1 cpuid =3D 0 time =3D 1 KDB: stack backtrace: db_trace_self() at db_trace_self_wrapper+0x28 pc =3D 0xffff0000005f03e8 lr =3D 0xffff000000087048 sp =3D 0xffff0000000105a0 fp =3D 0xffff0000000107b0 db_trace_self_wrapper() at vpanic+0x184 pc =3D 0xffff000000087048 lr =3D 0xffff000000316448 sp =3D 0xffff0000000107c0 fp =3D 0xffff000000010840 vpanic() at kassert_panic+0x158 pc =3D 0xffff000000316448 lr =3D 0xffff0000003162c0 sp =3D 0xffff000000010850 fp =3D 0xffff000000010910 kassert_panic() at pcpu_find+0x3c pc =3D 0xffff0000003162c0 lr =3D 0xffff000000359450 sp =3D 0xffff000000010920 fp =3D 0xffff000000010930 pcpu_find() at ofw_cpu_attach+0x114 pc =3D 0xffff000000359450 lr =3D 0xffff0000001692d4 sp =3D 0xffff000000010940 fp =3D 0xffff000000010970 ofw_cpu_attach() at device_attach+0x40c pc =3D 0xffff0000001692d4 lr =3D 0xffff00000034822c sp =3D 0xffff000000010980 fp =3D 0xffff0000000109d0 device_attach() at bus_generic_attach+0x5c pc =3D 0xffff00000034822c lr =3D 0xffff00000034952c sp =3D 0xffff0000000109e0 fp =3D 0xffff000000010a00 bus_generic_attach() at device_attach+0x40c pc =3D 0xffff00000034952c lr =3D 0xffff00000034822c sp =3D 0xffff000000010a10 fp =3D 0xffff000000010a60 device_attach() at bus_generic_new_pass+0x12c pc =3D 0xffff00000034822c lr =3D 0xffff000000349c0c sp =3D 0xffff000000010a70 fp =3D 0xffff000000010aa0 bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc =3D 0xffff000000349c0c lr =3D 0xffff000000349bc4 sp =3D 0xffff000000010ab0 fp =3D 0xffff000000010ae0 bus_generic_new_pass() at bus_generic_new_pass+0xe4 pc =3D 0xffff000000349bc4 lr =3D 0xffff000000349bc4 sp =3D 0xffff000000010af0 fp =3D 0xffff000000010b20 bus_generic_new_pass() at bus_set_pass+0x8c pc =3D 0xffff000000349bc4 lr =3D 0xffff000000345aec sp =3D 0xffff000000010b30 fp =3D 0xffff000000010b60 bus_set_pass() at mi_startup+0xc8 pc =3D 0xffff000000345aec lr =3D 0xffff0000002b43e8 sp =3D 0xffff000000010b70 fp =3D 0xffff000000010bb0 mi_startup() at virtdone+0x54 pc =3D 0xffff0000002b43e8 lr =3D 0xffff000000001084 sp =3D 0xffff000000010bc0 fp =3D 0x0000000000000000 KDB: enter: panic