Module Name:    src
Committed By:   kre
Date:           Mon Mar  6 01:28:54 UTC 2023

Modified Files:
        src/usr.sbin/cpuctl: cpuctl.8 cpuctl.c

Log Message:
Unless -v is given, ignore EEXIST errors from the IOC_CPU_UCODE_APPLY ioctl()
used to implement "cpuctl ucode N",  which indicates that the microcode
to be loaded already exists in the CPU, and as such, isn't really a
very interesting "error".


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/cpuctl/cpuctl.8
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/cpuctl/cpuctl.c

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

Modified files:

Index: src/usr.sbin/cpuctl/cpuctl.8
diff -u src/usr.sbin/cpuctl/cpuctl.8:1.20 src/usr.sbin/cpuctl/cpuctl.8:1.21
--- src/usr.sbin/cpuctl/cpuctl.8:1.20	Fri May 17 23:51:35 2019
+++ src/usr.sbin/cpuctl/cpuctl.8	Mon Mar  6 01:28:54 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: cpuctl.8,v 1.20 2019/05/17 23:51:35 gutteridge Exp $
+.\"	$NetBSD: cpuctl.8,v 1.21 2023/03/06 01:28:54 kre Exp $
 .\"
 .\" Copyright (c) 2007, 2008, 2012, 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -72,6 +72,10 @@ Set the specified CPUs on line, making t
 .Op Ar file
 .Xc
 This applies the microcode patch to CPUs.
+Unless
+.Fl v
+was given, errors indicating that the microcode
+already exists on the CPU in question are ignored.
 If
 .Ar cpu
 is not specified or \-1, all CPUs are updated.

Index: src/usr.sbin/cpuctl/cpuctl.c
diff -u src/usr.sbin/cpuctl/cpuctl.c:1.32 src/usr.sbin/cpuctl/cpuctl.c:1.33
--- src/usr.sbin/cpuctl/cpuctl.c:1.32	Tue Feb  1 10:45:02 2022
+++ src/usr.sbin/cpuctl/cpuctl.c	Mon Mar  6 01:28:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuctl.c,v 1.32 2022/02/01 10:45:02 mrg Exp $	*/
+/*	$NetBSD: cpuctl.c,v 1.33 2023/03/06 01:28:54 kre Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2012, 2015 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #ifndef lint
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cpuctl.c,v 1.32 2022/02/01 10:45:02 mrg Exp $");
+__RCSID("$NetBSD: cpuctl.c,v 1.33 2023/03/06 01:28:54 kre Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -247,7 +247,7 @@ cpu_ucode(char **argv)
 		cpuset_destroy(cpuset);
 	}
 	error = ioctl(fd, IOC_CPU_UCODE_APPLY, &uc);
-	if (error < 0) {
+	if (error < 0 && (verbose || errno != EEXIST)) {
 		if (uc.fwname[0])
 			err(EXIT_FAILURE, "%s", uc.fwname);
 		else

Reply via email to