Bug 249250 - 12.2-BETA1 panics at boot on powerpc64
Summary: 12.2-BETA1 panics at boot on powerpc64
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-STABLE
Hardware: powerpc Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-11 10:46 UTC by Piotr Kubaj
Modified: 2020-09-11 15:31 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2020-09-11 10:46:13 UTC
Full boot log:
[ 6838.073526] kexec_core: Starting new kernel
---<<BOOT>>---
Copyright (c) 1992-2020 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.2-BETA1 r365622 GENERIC powerpc
gcc version 4.2.1 20070831 patched [FreeBSD]
VT: init without driver.
cpu0: IBM POWER9 revision 2.2, 2700.00 MHz
cpu0: Features dc007182<PPC32,PPC64,ALTIVEC,FPU,MMU,SMT,ISNOOP,ARCH205,ARCH206,VSX,TRUELE>
cpu0: Features2 eee00000<ARCH207,HTM,DSCR,ISEL,TAR,VCRYPTO,ARCH300,IEEE128,DARN>
real memory  = 68354945024 (65188 MB)
avail memory = 65621626880 (62581 MB)
FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs
arc4random: no preloaded entropy cache
panic: Duplicate children in 0xc000000003a2ee90.  mask (ffff,0,0,0) child (f,0,0,0)
cpuid = 0
time = 1
KDB: stack backtrace:
#0 0xc000000002a293cc at .kdb_backtrace+0x88
#1 0xc0000000029c0cb8 at .vpanic+0x1b4
#2 0xc0000000029c0d84 at .panic+0x38
#3 0xc000000002a3e3b4 at .topo_init_root+0x1d0
#4 0xc000000002a3e67c at .smp_topo_1level+0x8c
#5 0xc000000002df7704 at .opal_call+0x414
#6 0xc000000002e0af58 at .cpu_topo+0x6c
#7 0xc000000002a3e7f8 at .smp_topo+0x11c
#8 0xc000000002a05504 at .sched_exit+0x64
#9 0xc00000000293af24 at .mi_startup+0x118
#10 0xc000000002402454 at .__start+0xc4
Uptime: 1s
Automatic reboot in 15 seconds - press a key on the console to abort
Comment 1 Piotr Kubaj freebsd_committer 2020-09-11 13:28:15 UTC
Regression happened in r354073, which is a commit by mav@:
MFC r342771 (by cem): Expose threads-per-core and physical core count information

With new sysctls (to the best of our ability do detect them).  Restructured
smp.4 slightly for clarity (keep relevant stuff closer to the top) while
documenting.
Comment 2 Leandro Lupori freebsd_committer 2020-09-11 13:40:23 UTC
r342852 should fix the problem:

powerpc: Fix regression introduced in r342771
Comment 3 Alexander Motin freebsd_committer 2020-09-11 13:56:11 UTC
Thanks for the report.  I've found that commit I've merged was broken for powerpc and was later fixed at r342852.  I am going to merge it now into stable/12.  Unfortunately I have no way to test it, so please try it and let me know whether it works, so that I could ask re@ for merge to release branch.
Comment 4 commit-hook freebsd_committer 2020-09-11 14:00:23 UTC
A commit references this bug:

Author: mav
Date: Fri Sep 11 14:00:12 UTC 2020
New revision: 365632
URL: https://svnweb.freebsd.org/changeset/base/365632

Log:
  MFC r342852 (by cem): powerpc: Fix regression introduced in r342771

  In r342771, I introduced a regression in Power by abusing the platform
  smp_topo() method as a shortcut for providing the MI information needed for
  the stated sysctls.  The smp_topo() method was already called later by
  sched_ule (under the name cpu_topo()), and initializes a static array of
  scheduler topology information.  I had skimmed the smp_topo_foo() functions
  and assumed they were idempotent; empirically, they are not (or at least,
  detect re-initialization and panic).

  Do the cleaner thing I should have done in the first place and add a
  platform method specifically for core- and thread-count probing.

  PR:		249250

Changes:
_U  stable/12/
  stable/12/sys/powerpc/include/platform.h
  stable/12/sys/powerpc/powernv/platform_powernv.c
  stable/12/sys/powerpc/powerpc/mp_machdep.c
  stable/12/sys/powerpc/powerpc/platform.c
  stable/12/sys/powerpc/powerpc/platform_if.m
  stable/12/sys/powerpc/ps3/platform_ps3.c
  stable/12/sys/powerpc/pseries/platform_chrp.c
Comment 5 Piotr Kubaj freebsd_committer 2020-09-11 14:22:07 UTC
(In reply to Alexander Motin from comment #3)
Thank you, merging that commit fixes booting.
Comment 6 Alexander Motin freebsd_committer 2020-09-11 15:31:15 UTC
Merged to releng/12.2.
Comment 7 commit-hook freebsd_committer 2020-09-11 15:31:45 UTC
A commit references this bug:

Author: mav
Date: Fri Sep 11 15:30:48 UTC 2020
New revision: 365634
URL: https://svnweb.freebsd.org/changeset/base/365634

Log:
  MFC r342852 (by cem): powerpc: Fix regression introduced in r342771

  In r342771, I introduced a regression in Power by abusing the platform
  smp_topo() method as a shortcut for providing the MI information needed for
  the stated sysctls.  The smp_topo() method was already called later by
  sched_ule (under the name cpu_topo()), and initializes a static array of
  scheduler topology information.  I had skimmed the smp_topo_foo() functions
  and assumed they were idempotent; empirically, they are not (or at least,
  detect re-initialization and panic).

  Do the cleaner thing I should have done in the first place and add a
  platform method specifically for core- and thread-count probing.

  PR:		249250
  Approved by:	re (gjb)

Changes:
_U  releng/12.2/
  releng/12.2/sys/powerpc/include/platform.h
  releng/12.2/sys/powerpc/powernv/platform_powernv.c
  releng/12.2/sys/powerpc/powerpc/mp_machdep.c
  releng/12.2/sys/powerpc/powerpc/platform.c
  releng/12.2/sys/powerpc/powerpc/platform_if.m
  releng/12.2/sys/powerpc/ps3/platform_ps3.c
  releng/12.2/sys/powerpc/pseries/platform_chrp.c