NetBSD Problem Report #45117

From www@NetBSD.org  Mon Jul  4 20:07:47 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2A16463C9CB
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  4 Jul 2011 20:07:47 +0000 (UTC)
Message-Id: <20110704200746.30F7A63C892@www.NetBSD.org>
Date: Mon,  4 Jul 2011 20:07:46 +0000 (UTC)
From: alnsn@NetBSD.org
Reply-To: alnsn@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: cpuctl nointr 0 freezes my box
X-Send-Pr-Version: www-1.0

>Number:         45117
>Category:       kern
>Synopsis:       cpuctl nointr 0 freezes my box
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 04 20:10:08 +0000 2011
>Closed-Date:    
>Last-Modified:  Thu Oct 08 09:20:01 +0000 2020
>Originator:     Alexander Nasonov
>Release:        5.99.54 amd64
>Organization:
home sweet home
>Environment:
NetBSD nebeda.localdomain 5.99.54 NetBSD 5.99.54 (GENERIC) #0: Sat Jul  2 00:40:02 BST 2011  root@nebeda.localdomain:/home/alnsn/src/netbsd-current/src/sys/arch/amd64/compile/obj/GENERIC amd64
>Description:
sudo cpuctl nointr 0 freezes my box.

[screen pts/2] cpuctl list
Num  HwId Unbound LWPs Interrupts Last change              #Intr
---- ---- ------------ ---------- ------------------------ -----
0    0    online       intr       Mon Jul  4 20:53:02 2011 9
1    1    online       intr       Mon Jul  4 20:53:02 2011 0
2    2    online       intr       Mon Jul  4 20:53:02 2011 0
3    3    online       intr       Mon Jul  4 20:53:02 2011 0

[screen pts/2] sudo cpuctl identify 0
cpu0: AMD Unknown AMD64 CPU (686-class), 2612.08 MHz, id 0x100f52
cpu0: features  0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features  0x178bfbff<PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2>
cpu0: features  0x178bfbff<HTT>
cpu0: features2 0x802009<SSE3,MONITOR,CX16,POPCNT>
cpu0: features3 0xefd3fbff<SYSCALL/SYSRET,NOX,MXX,FFXSR,P1GB,RDTSCP,LONG>
cpu0: features3 0xefd3fbff<3DNOW2,3DNOW>
cpu0: features4 0x37ff<LAHF,CMPLEGACY,SVM,EAPIC,ALTMOVCR0,LZCNT,SSE4A>
cpu0: features4 0x37ff<MISALIGNSSE,3DNOWPREFETCH,OSVW,IBS,SKINIT,WDT>
cpu0: "AMD Athlon(tm) II X4 620 Processor"
cpu0: I-cache 64KB 64B/line 2-way, D-cache 64KB 64B/line 2-way
cpu0: L2 cache 512KB 64B/line 16-way
cpu0: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu0: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu0: Initial APIC ID 0
cpu0: AMD Power Management features: 0x1f9<TS,TTP,HTC,STC,100,HWP,TSC>
cpu0: SVM Rev. 1
cpu0: SVM NASID 64
cpu0: SVM features 0xf<NP,LbrVirt,SVML,NRIPS>
cpu0: family 0f model 05 extfamily 01 extmodel 00
>How-To-Repeat:
sudo cpuctl nointr 0 on SMP system.
>Fix:
Not known

>Release-Note:

>Audit-Trail:
From: Alexander Nasonov <alnsn@yandex.ru>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/45117: cpuctl nointr 0 freezes my box
Date: Mon, 4 Jul 2011 21:35:14 +0100

 alnsn@NetBSD.org wrote:
 > sudo cpuctl nointr 0 freezes my box.
 dmesg

 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     2006, 2007, 2008, 2009, 2010, 2011
     The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

 NetBSD 5.99.54 (GENERIC) #0: Sat Jul  2 00:40:02 BST 2011
 	root@nebeda.localdomain:/home/alnsn/src/netbsd-current/src/sys/arch/amd64/compile/obj/GENERIC
 total memory = 4095 MB
 avail memory = 3961 MB
 timecounter: Timecounters tick every 10.000 msec
 timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
 HP-Pavilion VG249AA-ABU s5210uk ( )
 mainbus0 (root)
 cpu0 at mainbus0 apid 0: AMD Athlon(tm) II X4 620 Processor, id 0x100f52
 cpu0: SVM disabled by the BIOS
 cpu1 at mainbus0 apid 1: AMD Athlon(tm) II X4 620 Processor, id 0x100f52
 cpu2 at mainbus0 apid 2: AMD Athlon(tm) II X4 620 Processor, id 0x100f52
 cpu3 at mainbus0 apid 3: AMD Athlon(tm) II X4 620 Processor, id 0x100f52
 ioapic0 at mainbus0 apid 4: pa 0xfec00000, version 11, 24 pins
 acpi0 at mainbus0: Intel ACPICA 20110623
 acpi0: X/RSDT: OemId <HPQOEM,SLIC-CPC,20090818>, AslId <MSFT,00000097>
 acpi0: SCI interrupting at int 9
 timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
 hpet0 at acpi0: high precision event timer (mem 0xfeff0000-0xfeff0400)
 timecounter: Timecounter "hpet0" frequency 25000000 Hz quality 2000
 attimer1 at acpi0 (TMR, PNP0100): io 0x40-0x43 irq 0
 pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
 midi0 at pcppi1: PC speaker
 sysbeep0 at pcppi1
 SIOR (PNP0C02) at acpi0 not configured
 RMSC (PNP0C02) at acpi0 not configured
 OMSC (PNP0C02) at acpi0 not configured
 PCIE (PNP0C02) at acpi0 not configured
 RMEM (PNP0C01) at acpi0 not configured
 acpibut0 at acpi0 (PWRB, PNP0C0C-170): ACPI Power Button
 attimer1: attached to pcppi1
 pci0 at mainbus0 bus 0: configuration mode 1
 pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
 vendor 0x10de product 0x03ea (RAM memory, revision 0xa1) at pci0 dev 0 function 0 not configured
 pcib0 at pci0 dev 1 function 0: vendor 0x10de product 0x03e0 (rev. 0xa2)
 nfsmbc0 at pci0 dev 1 function 1: vendor 0x10de product 0x03eb (rev. 0xa2)
 nfsmb0 at nfsmbc0 SMBus 1
 iic0 at nfsmb0: I2C bus
 nfsmb1 at nfsmbc0 SMBus 2
 iic1 at nfsmb1: I2C bus
 vendor 0x10de product 0x03f5 (RAM memory, revision 0xa2) at pci0 dev 1 function 2 not configured
 ohci0 at pci0 dev 2 function 0: vendor 0x10de product 0x03f1 (rev. 0xa3)
 LUB0: Picked IRQ 20 with weight 0
 ohci0: interrupting at ioapic0 pin 20
 ohci0: OHCI version 1.0, legacy support
 usb0 at ohci0: USB revision 1.0
 ehci0 at pci0 dev 2 function 1: vendor 0x10de product 0x03f2 (rev. 0xa3)
 LUB2: Picked IRQ 21 with weight 0
 ehci0: interrupting at ioapic0 pin 21
 ehci0: BIOS has given up ownership
 ehci0: EHCI version 1.0
 ehci0: companion controller, 10 ports each: ohci0
 usb1 at ehci0: USB revision 2.0
 ppb0 at pci0 dev 4 function 0: vendor 0x10de product 0x03f3 (rev. 0xa1)
 pci1 at ppb0 bus 1
 pci1: i/o space, memory space enabled
 hdaudio0 at pci0 dev 5 function 0: HD Audio Controller
 LAZA: Picked IRQ 22 with weight 0
 hdaudio0: interrupting at ioapic0 pin 22
 hdafg0 at hdaudio0: Realtek ALC662
 hdafg0: DAC00 2ch: Speaker [Jack], HP Out [Jack]
 hdafg0: ADC01 2ch: Line In [Jack], Mic In [Jack]
 hdafg0: 2ch/2ch 44100Hz 48000Hz 96000Hz 16/16 20/32 24/32
 audio0 at hdafg0: full duplex, playback, capture, independent
 nfe0 at pci0 dev 7 function 0: vendor 0x10de product 0x03ef (rev. 0xa2)
 LMAC: Picked IRQ 23 with weight 0
 nfe0: interrupting at ioapic0 pin 23
 nfe0: Ethernet address 00:26:18:8e:22:9e
 rlphy0 at nfe0 phy 0: RTL8201L 10/100 media interface, rev. 1
 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 viaide0 at pci0 dev 8 function 0: NVIDIA MCP61 Serial ATA Controller (rev. 0xa2)
 viaide0: bus-master DMA support present
 viaide0: primary channel wired to native-PCI mode
 LSA0: Picked IRQ 20 with weight 1
 viaide0: using ioapic0 pin 20 for native-PCI interrupt
 atabus0 at viaide0 channel 0
 viaide0: secondary channel wired to native-PCI mode
 atabus1 at viaide0 channel 1
 viaide1 at pci0 dev 8 function 1: NVIDIA MCP61 Serial ATA Controller (rev. 0xa2)
 viaide1: bus-master DMA support present
 viaide1: primary channel wired to native-PCI mode
 LSA1: Picked IRQ 21 with weight 1
 viaide1: using ioapic0 pin 21 for native-PCI interrupt
 atabus2 at viaide1 channel 0
 viaide1: secondary channel wired to native-PCI mode
 atabus3 at viaide1 channel 1
 ppb1 at pci0 dev 9 function 0: vendor 0x10de product 0x03e8 (rev. 0xa2)
 ppb1: PCI Express 1.0 <Root Port of PCI-E Root Complex>
 pci2 at ppb1 bus 2
 pci2: i/o space, memory space enabled, rd/line, wr/inv ok
 vga0 at pci2 dev 0 function 0: vendor 0x1002 product 0x954f (rev. 0x00)
 wsdisplay0 at vga0 kbdmux 1: console (80x25, vt100 emulation)
 wsmux1: connecting to wsdisplay0
 radeondrm0 at vga0: ATI Radeon HD 4350
 radeondrm0: Initialized radeon 1.29.0 20080613
 hdaudio1 at pci2 dev 0 function 1: HD Audio Controller
 LNEA: Picked IRQ 16 with weight 0
 hdaudio1: interrupting at ioapic0 pin 16
 hdafg1 at hdaudio1: ATI R6xx HDMI
 hdafg1: HDMI00 2ch: Digital Out [Jack]
 hdafg1: 2ch/0ch 32000Hz 44100Hz 48000Hz 16/16
 ppb2 at pci0 dev 11 function 0: vendor 0x10de product 0x03e9 (rev. 0xa2)
 ppb2: PCI Express 1.0 <Root Port of PCI-E Root Complex>
 pci3 at ppb2 bus 3
 pci3: i/o space, memory space enabled, rd/line, wr/inv ok
 ppb3 at pci0 dev 12 function 0: vendor 0x10de product 0x03e9 (rev. 0xa2)
 ppb3: PCI Express 1.0 <Root Port of PCI-E Root Complex>
 pci4 at ppb3 bus 4
 pci4: i/o space, memory space enabled, rd/line, wr/inv ok
 pchb0 at pci0 dev 24 function 0: vendor 0x1022 product 0x1200 (rev. 0x00)
 pchb1 at pci0 dev 24 function 1: vendor 0x1022 product 0x1201 (rev. 0x00)
 pchb2 at pci0 dev 24 function 2: vendor 0x1022 product 0x1202 (rev. 0x00)
 amdtemp0 at pci0 dev 24 function 3: AMD CPU Temperature Sensors (Family10h / Family11h)
 pchb3 at pci0 dev 24 function 4: vendor 0x1022 product 0x1204 (rev. 0x00)
 isa0 at pcib0
 pckbc0 at isa0 port 0x60-0x64
 pckbd0 at pckbc0 (kbd slot)
 pckbc0: using irq 1 for kbd slot
 wskbd0 at pckbd0: console keyboard, using wsdisplay0
 acpicpu0 at cpu0: ACPI CPU
 acpicpu0: C1: HLT, lat   0 us, pow     0 mW
 acpicpu0: P0: FFH, lat   4 us, pow 25437 mW, 2600 MHz
 acpicpu0: P1: FFH, lat   4 us, pow 18742 mW, 1900 MHz
 acpicpu0: P2: FFH, lat   4 us, pow 15745 mW, 1400 MHz
 acpicpu0: P3: FFH, lat   4 us, pow 11220 mW,  800 MHz
 acpicpu1 at cpu1: ACPI CPU
 acpicpu2 at cpu2: ACPI CPU
 acpicpu3 at cpu3: ACPI CPU
 timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
 timecounter: Timecounter "TSC" frequency 2612077800 Hz quality 3000
 uhub0 at usb0: vendor 0x10de OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub0: 10 ports with 10 removable, self powered
 uhub1 at usb1: vendor 0x10de EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
 uhub1: 10 ports with 10 removable, self powered
 viaide0 port 0: device present, speed: 3.0Gb/s
 viaide0 port 1: device present, speed: 1.5Gb/s
 wd0 at atabus0 drive 0
 wd0: <WDC WD6400AAKS-65A7B2>
 wd0: drive supports 16-sector PIO transfers, LBA48 addressing
 wd0: 596 GB, 1240341 cyl, 16 head, 63 sec, 512 bytes/sect x 1250263728 sectors
 wd0: 32-bit data port
 wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
 wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
 atapibus0 at atabus1: 2 targets
 cd0 at atapibus0 drive 0: <hp      DVD-RAM GH40L, B9ICBP4305474, RB0A> cdrom removable
 cd0: 32-bit data port
 cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
 cd0(viaide0:1:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
 uhidev0 at uhub0 port 3 configuration 1 interface 0
 uhidev0: HP HP Wireless Keyboard Kit, rev 2.00/0.02, addr 2, iclass 3/1
 ukbd0 at uhidev0
 rum0 at uhub1 port 5
 rum0: Ralink 802.11 bg WLAN, rev 2.00/0.01, addr 2
 rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:22:5f:eb:9e:4d
 rum0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
 rum0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
 wskbd1 at ukbd0 mux 1
 wskbd1: connecting to wsdisplay0
 uhidev1 at uhub0 port 3 configuration 1 interface 1
 uhidev1: HP HP Wireless Keyboard Kit, rev 2.00/0.02, addr 2, iclass 3/1
 uhidev1: 8 report ids
 ums0 at uhidev1 reportid 1: 3 buttons and Z dir
 wsmouse0 at ums0 mux 0
 uhid0 at uhidev1 reportid 2: input=2, output=0, feature=0
 uhid1 at uhidev1 reportid 3: input=1, output=0, feature=0
 uhid2 at uhidev1 reportid 4: input=2, output=0, feature=0
 uhid3 at uhidev1 reportid 5: input=0, output=0, feature=7
 uhid4 at uhidev1 reportid 6: input=0, output=0, feature=7
 uhid5 at uhidev1 reportid 7: input=0, output=0, feature=7
 uhid6 at uhidev1 reportid 8: input=2, output=0, feature=0
 umass0 at uhub1 port 10 configuration 1 interface 0
 umass0: Generic Mass Storage Device, rev 2.00/1.00, addr 3
 umass0: using SCSI over Bulk-Only
 scsibus0 at umass0: 2 targets, 1 lun per target
 sd0 at scsibus0 target 0 lun 0: <Multi, Flash Reader, 1.00> disk removable
 sd0: drive offline
 sd0(umass0:0:0:0):  Check Condition on CDB: 0x00 00 00 00 00 00
     SENSE KEY:  Not Ready
  COMMAND INFO:  11162944 (0xaa5540)
      ASC/ASCQ:  Medium Not Present

 sd0: unable to open device, error = 19
 Kernelized RAIDframe activated
 pad0: outputs: 44100Hz, 16-bit, stereo
 audio1 at pad0: half duplex, playback, capture
 sd0(umass0:0:0:0):  Check Condition on CDB: 0x00 00 00 00 00 00
     SENSE KEY:  Not Ready
  COMMAND INFO:  11162944 (0xaa5540)
      ASC/ASCQ:  Medium Not Present

 sd0(umass0:0:0:0):  Check Condition on CDB: 0x00 00 00 00 00 00
     SENSE KEY:  Not Ready
  COMMAND INFO:  11162944 (0xaa5540)
      ASC/ASCQ:  Medium Not Present

 sd0(umass0:0:0:0):  Check Condition on CDB: 0x00 00 00 00 00 00
     SENSE KEY:  Not Ready
  COMMAND INFO:  11162944 (0xaa5540)
      ASC/ASCQ:  Medium Not Present

 sd0(umass0:0:0:0):  Check Condition on CDB: 0x00 00 00 00 00 00
     SENSE KEY:  Not Ready
  COMMAND INFO:  11162944 (0xaa5540)
      ASC/ASCQ:  Medium Not Present

 boot device: wd0
 root on wd0a dumps on wd0b
 root file system type: ffs
 wsdisplay0: screen 1 added (80x25, vt100 emulation)
 wsdisplay0: screen 2 added (80x25, vt100 emulation)
 wsdisplay0: screen 3 added (80x25, vt100 emulation)
 wsdisplay0: screen 4 added (80x25, vt100 emulation)

From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/45117: cpuctl nointr 0 freezes my box
Date: Mon, 4 Jul 2011 20:39:01 +0000

 You really can't expect this to work.

From: Alexander Nasonov <alnsn@yandex.ru>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, alnsn@NetBSD.org
Subject: Re: kern/45117: cpuctl nointr 0 freezes my box
Date: Mon, 4 Jul 2011 23:14:41 +0100

 Jonathan A. Kollasch wrote:
 > The following reply was made to PR kern/45117; it has been noted by GNATS.
 > 
 > From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/45117: cpuctl nointr 0 freezes my box
 > Date: Mon, 4 Jul 2011 20:39:01 +0000
 > 
 >  You really can't expect this to work.

 If it's not implemented I'd expect that either this option is not listed
 when you run the program without arguments or that cpus 1-3 have nointr
 by default and an attempt to set intr fails.

 Alex

Responsible-Changed-From-To: kern-bug-people->jruoho
Responsible-Changed-By: jruoho@NetBSD.org
Responsible-Changed-When: Sat, 14 Apr 2012 13:48:16 +0000
Responsible-Changed-Why:
Indeed it shouldn't freeze the system. I will fix this once I touch kern_cpu.c.


Responsible-Changed-From-To: jruoho->kern-bug-people
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sun, 20 Jan 2019 08:02:17 +0000
Responsible-Changed-Why:
Reset responsible field for retired developer.


From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45117 CVS commit: src
Date: Wed, 24 Jun 2020 09:32:41 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Wed Jun 24 09:32:41 UTC 2020

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/etc/mtree: NetBSD.dist.tests
 Added Files:
 	src/tests/usr.sbin/cpuctl: Makefile t_cpuctl.sh

 Log Message:
 Add few basic tests for cpuctl(8). These cover PR kern/45117 and PR bin/54220.
 Though, the former is not explicitly tested as it hangs the system.


 To generate a diff of this commit:
 cvs rdiff -u -r1.845 -r1.846 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.163 -r1.164 src/etc/mtree/NetBSD.dist.tests
 cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/cpuctl/Makefile \
     src/tests/usr.sbin/cpuctl/t_cpuctl.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45117 CVS commit: src
Date: Mon, 13 Jul 2020 13:16:08 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Mon Jul 13 13:16:08 UTC 2020

 Modified Files:
 	src/sys/kern: kern_cpu.c
 	src/tests/usr.sbin/cpuctl: t_cpuctl.sh

 Log Message:
 Do not allow disabling interrupts on the primary CPU. Fixes PR kern/45117.


 To generate a diff of this commit:
 cvs rdiff -u -r1.91 -r1.92 src/sys/kern/kern_cpu.c
 cvs rdiff -u -r1.3 -r1.4 src/tests/usr.sbin/cpuctl/t_cpuctl.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Mon, 13 Jul 2020 13:23:41 +0000
State-Changed-Why:
Finally fixed in -current.


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/45117 (cpuctl nointr 0 freezes my box)
Date: Mon, 13 Jul 2020 15:33:09 +0200

 Why do you sepcial case cpu 0 here?

 Isn't the problem that you disable cpus where interrupts are routed to
 (w/o rerouting those interrupts)?

 This nowdadys is not the same as disabling interrupts on cpu 0 (and also
 is a machine dependent thing).

 We could either add some (more or lesss automatic) rewiring of interrupts
 code to cpuctl - or (much simpler) write this off as pilot error.

 Martin

From: Jukka Ruohonen <jruohonen@iki.fi>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/45117 (cpuctl nointr 0 freezes my box)
Date: Mon, 13 Jul 2020 16:40:28 +0300

 On Mon, Jul 13, 2020 at 01:35:01PM +0000, Martin Husemann wrote:
 >  Isn't the problem that you disable cpus where interrupts are routed to
 >  (w/o rerouting those interrupts)?

 Yes, it could be more intelligent. But "cpuctl nointr 0" still hangs my
 amd64 system -- and even if I've enabled interrupts for the other != 0 CPUs.

 - Jukka

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/45117 (cpuctl nointr 0 freezes my box)
Date: Mon, 13 Jul 2020 16:02:20 +0200

 On Mon, Jul 13, 2020 at 01:45:01PM +0000, Jukka Ruohonen wrote:
 >  Yes, it could be more intelligent. But "cpuctl nointr 0" still hangs my
 >  amd64 system -- and even if I've enabled interrupts for the other != 0 CPUs.

 The point is: depending on your system it could be *any* cpuctl nointr $N
 that hangs it.

 You are just lucky that it is *just* 0 that hangs it for you.

 Martin

State-Changed-From-To: closed->analyzed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Mon, 13 Jul 2020 14:14:25 +0000
State-Changed-Why:
Then I suppose the whole "nointr" code is broken and completely unsafe.


From: "Rin Okuyama" <rin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45117 CVS commit: src/sys/kern
Date: Thu, 8 Oct 2020 09:16:13 +0000

 Module Name:	src
 Committed By:	rin
 Date:		Thu Oct  8 09:16:13 UTC 2020

 Modified Files:
 	src/sys/kern: kern_cpu.c

 Log Message:
 PR kern/45117

 Work around regression introduced in rev 1.92:

 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_cpu.c#rev1.92

 by which ``cpuctl offline n'' became broken on architectures without
 __HAVE_INTR_CONTROL (i.e., everything other than alpha and x86);
 cpu_setintr() always fails on these archs, and we had neglected
 return value from that function until rev 1.91.

 XXX
 As martin pointed out in the PR, I'm not sure whether fix in rev 1.92
 itself is correct or not. Insert XXX comment referring the PR there....


 To generate a diff of this commit:
 cvs rdiff -u -r1.92 -r1.93 src/sys/kern/kern_cpu.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

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.