NetBSD Problem Report #60558
From www@netbsd.org Sat Aug 8 12:57:19 2026
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 "YR2" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id B164A1A923B
for <gnats-bugs@gnats.NetBSD.org>; Sat, 8 Aug 2026 12:57:18 +0000 (UTC)
Message-Id: <20260808125717.B8CD41A923C@mollari.NetBSD.org>
Date: Sat, 8 Aug 2026 12:57:17 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: nvmm(4): suspend/resume/detach issues
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>
>Number: 60558
>Category: kern
>Synopsis: nvmm(4): suspend/resume/detach issues
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Aug 08 13:00:00 +0000 2026
>Originator: Taylor R Campbell
>Release: current, 11, 10
>Organization:
The NvmmBSD Suspension, Inc.
>Environment:
>Description:
1. The logic to coordinate suspend/resume around nvmm ioctls
involves taking a global mutex to check whether we're
suspending. This could be a performance bottleneck when
many VMs are running in parallel.
2. nvmm_detach is racy, partly because of PR kern/60547:
fileops(9) can't be safely unloaded in a module. Need to:
(a) mark that we're detaching,
(b) suspend nvmm ioctls and make sure nvmm_enter_sig fails
promptly when detaching,
(c) wait for all concurrent fileops to return, and then
(d) finally we can safely free all the resources.
>How-To-Repeat:
code inspection
>Fix:
1. pserialize(9)/localcount(9)
2. (a) mark that we're detaching,
(b) suspend nvmm ioctls and make sure nvmm_enter_sig fails
promptly when detaching,
(c) wait for all concurrent fileops to return, and then
(d) finally we can safely free all the resources.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.