NetBSD Problem Report #59682

From www@netbsd.org  Thu Oct  2 12:46:01 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8393E1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  2 Oct 2025 12:46:01 +0000 (UTC)
Message-Id: <20251002124600.62BB21A923C@mollari.NetBSD.org>
Date: Thu,  2 Oct 2025 12:46:00 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: qemu idles CPUs by spinning them at 100%
X-Send-Pr-Version: www-1.0

>Number:         59682
>Category:       port-sparc
>Synopsis:       qemu idles CPUs by spinning them at 100%
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jdc
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 02 12:50:00 +0000 2025
>Last-Modified:  Sun Oct 05 18:54:08 +0000 2025
>Originator:     Taylor R Campbell
>Release:        9, 10
>Organization:
The SparcBSD Qemu Excitation
>Environment:
>Description:

	Before this change, qemu would only idle one CPU, not all CPUs,
	when the system is idle, and instead spin the other CPUs at
	100% capacity:

Module Name:    src
Committed By:   jdc
Date:           Sat May 31 15:14:40 UTC 2025

Modified Files:
        src/sys/arch/sparc/dev: apc.c

Log Message:
Set the idle bit for all the CPU's on a multi-processor system.  QEMU uses
this to idle all of the emulated CPU's, otherwise only one CPU is idled.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/dev/apc.c

https://mail-index.netbsd.org/source-changes/2025/05/31/msg157080.html


>How-To-Repeat:

	1. boot multiprocessor NetBSD/sparc under qemu
	2. do nothing
	3. watch top(1) in the host and see 100% CPU usage


>Fix:

	1. pull up the patch above
	2. consider nixing #ifdef MULTIPROCESSOR -- the iteration over
	   CPUs should compile away into the same thing


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-sparc-maintainer->jdc
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Sun, 05 Oct 2025 18:54:08 +0000
Responsible-Changed-Why:
Can I trouble you to pull this up?


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.