NetBSD Problem Report #55721

From gson@gson.org  Mon Oct 12 07:38:34 2020
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C0EC31A921F
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 12 Oct 2020 07:38:33 +0000 (UTC)
Message-Id: <20201012073828.59F71253EDE@guava.gson.org>
Date: Mon, 12 Oct 2020 10:38:28 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: usr.sbin/cpuctl/t_cpuctl:nointr, offline tests fail
X-Send-Pr-Version: 3.95

>Number:         55721
>Category:       bin
>Synopsis:       usr.sbin/cpuctl/t_cpuctl:nointr, offline tests fail
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 12 07:40:00 +0000 2020
>Last-Modified:  Mon Oct 12 08:25:01 +0000 2020
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current
>Organization:
>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

The "nointr" and "offline" test cases of the usr.sbin/cpuctl/t_cpuctl
test program now fail on real amd64 hardware:

  http://www.gson.org/netbsd/bugs/build/amd64-baremetal/2020/2020.10.11.19.39.22/test.html#usr.sbin_cpuctl_t_cpuctl_nointr

The problem started some time between source dates 2020.10.03.18.54.18
and 2020.10.11.07.07.32.

>How-To-Repeat:

>Fix:

>Audit-Trail:
From: Rin Okuyama <rokuyama.rk@gmail.com>
To: Andreas Gustafsson <gson@gson.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/55721: usr.sbin/cpuctl/t_cpuctl:nointr, offline tests fail
Date: Mon, 12 Oct 2020 17:24:37 +0900

 This is due to mine:

 http://www.nerv.org/netbsd/?q=id:20201008T091613Z.7bca1a7879657c09b2d6976a827a557446ab4627

 I doubt whether these tests are correct.

 As wrote in the commit log, we had ignored any errors when enabling or
 disabling interrupts for a CPU core by IOC_CPU_SETSTATE ioctl, until
 kern_cpu.c rev 1.91. This behavior was changed in rev 1.92; if
 enabling/disabling interrupts fails, the ioctl breaks there, and does
 not try to make that core online/offline. The newly failing tests
 depend on this behavior. However, this change resulted in regression
 described in the commit log.

 Yes, the current behavior of the ioctl is unclear. However, IMO, this
 is limitation of design of IOC_CPU_SETSTATE ioctl itself; both of
 whether intr/nointr and online/offline should be specified to a CPU
 core, and you cannot set one of them.

 Also, comment in the test says:

 https://nxr.netbsd.org/xref/src/tests/usr.sbin/cpuctl/t_cpuctl.sh#184
      184 	# Additional check that the boot processor cannot be
      185 	# set offline, as noted in the cpuctl(8) manual page.

 But there's no such explanation in cpuctl(8).

 Thanks,
 rin

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.