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.
Modified files: Index: src/sys/kern/kern_cpu.c diff -u src/sys/kern/kern_cpu.c:1.92 src/sys/kern/kern_cpu.c:1.93 --- src/sys/kern/kern_cpu.c:1.92 Mon Jul 13 13:16:07 2020 +++ src/sys/kern/kern_cpu.c Thu Oct 8 09:16:13 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.92 2020/07/13 13:16:07 jruoho Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.93 2020/10/08 09:16:13 rin Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.92 2020/07/13 13:16:07 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.93 2020/10/08 09:16:13 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_cpu_ucode.h" @@ -212,9 +212,7 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void error = ESRCH; break; } - error = cpu_setintr(ci, cs->cs_intr); - if (error) - break; + cpu_setintr(ci, cs->cs_intr); /* XXX neglect errors */ error = cpu_setstate(ci, cs->cs_online); break; @@ -492,7 +490,7 @@ cpu_setintr(struct cpu_info *ci, bool in return 0; func = (xcfunc_t)cpu_xc_intr; } else { - if (CPU_IS_PRIMARY(ci)) + if (CPU_IS_PRIMARY(ci)) /* XXX kern/45117 */ return EINVAL; if ((spc->spc_flags & SPCF_NOINTR) != 0) return 0;