We can't call kstat_create(9) when bringing up the secondary CPUs as it
authorkettenis <kettenis@openbsd.org>
Mon, 15 Jan 2024 11:58:45 +0000 (11:58 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 15 Jan 2024 11:58:45 +0000 (11:58 +0000)
commita84df9b37262efbb7d8f3e5df3f9d1427c0d50b4
tree1656a30de253479d96c3e336ff1992dbd648166d
parenta62144a242043873ba717dac4eb4f4c19655954a
We can't call kstat_create(9) when bringing up the secondary CPUs as it
uses an rwlock and curproc isn't initialized yet for these CPUs at this
point.  As a result we hit a "locking against myself" panic if there is
any lock contention.

Fix this by adding a new ci_midr member to struct cpu_info which gets
initialized when we identify the CPUs and use that to attach the kstat
stuff.

ok tobhe@, dlg@
sys/arch/arm64/arm64/cpu.c
sys/arch/arm64/include/cpu.h