NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/57657: NetBSD crashes if the number of CPUs is not of the form N*[1..8]



>Number:         57657
>Category:       kern
>Synopsis:       NetBSD crashes if the number of CPUs is not of the form N*[1..8]
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 14 19:00:01 +0000 2023
>Originator:     Harold Gutch
>Release:        NetBSD current
>Organization:
>Environment:
NetBSD  10.99.10 NetBSD 10.99.10 (GENERIC) #0: Thu Oct 12 23:51:05 UTC 2023  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
Booting NetBSD in KVM (on a RHEL 9.2 host) with 1..40 virtual CPUs succeeds if and only if the number of CPUs is of the form N*[1..8], i.e., only for 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40 CPUs.  For any other number the following panic happens:

Stopped in pid 0.0 (system) at  netbsd:breakpoint+0x5:  leave
breakpoint() at netbsd:breakpoint+0x5
vpanic at netbsd:vpanic+0x173
kern_assert() at netbsd:kern_assert+0x4b
uvm_pagealloc_pgb() at netbsd:uvm_pagealloc_pgb+0x2e
uvm_pagealloc_pgfl() at netbsd:uvm_pagealloc_pgfl+0x63
uvm_pagealloc_strat() at netbsd_uvm_pagealloc_strat+0x130
uvm_km_alloc() at netbsd:uvm_km_alloc+0x17a
cpu_uarea_alloc() at netbsd:cpu_uarea_alloc+0x26
uarea_system_poolpage_alloc() at netbsd:uarea_system_poolpage_alloc+0x16
pool_grow() at netbsd:pool_grow+0x34c
pool_get() at netbsd:pool_get+0xa8
pool_cache_get_slow() at netbsd:pool_cache_get_slow+0x139
pool_cache_get_paddr() at netbsd:pool_cache_get_paddr+0x263
kthread_create() at netbsd:kthread_create+0x4d
config_create_interruptthreads() at netbsd:_config_create_interrptthreads+0x33
main() at netbsd:main+0x3be

oster@ could reproduce this and mentioned that for him Fedora 37 does *not* crash with 9 CPUs, so it does not seem to be a bug in KVM.

The systematic test for all numbers of CPUs from 1 to 40 was with an Ivy Bridge host CPU, but for all other emulated CPUs tested, it booted with 8 but I got exactly the same crash with 9 CPUs.

# objdump --disassemble=uvm_pagealloc_pgb /netbsd
ffffffff80d8591b <uvm_pagealloc_pgb>:
[...]
ffffffff80d85949:       49 83 3a 00             cmq    $0x0,(%r10)
ffffffff80d8594d:       4c 89 55 b8             mov    %r10,-0x48(%rbp)
ffffffff80d85951:       0f 84 80 01 00 00       je     ffffffff80d85ad7 <uvm_pagealloc_pgb+0x1bc>

This seems to be line 1017 in uvm_page.c 1.254.
>How-To-Repeat:
Boot NetBSD on a VM where the number of CPUs is not of the form N*[1..8].
>Fix:



Home | Main Index | Thread Index | Old Index