2008-08-08 18:26:53 +02:00
|
|
|
.\" Copyright (c) 2006, 2008 Stanislav Sedov <stas@FreeBSD.org>.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2018-01-05 22:06:19 +01:00
|
|
|
.Dd January 5, 2018
|
2008-08-08 18:26:53 +02:00
|
|
|
.Dt CPUCONTROL 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm cpucontrol
|
|
|
|
.Nd control utility for the
|
|
|
|
.Xr cpuctl 4
|
2012-05-24 04:24:03 +02:00
|
|
|
device
|
2008-08-08 18:26:53 +02:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2018-01-05 22:06:19 +01:00
|
|
|
.Bk
|
2017-09-30 12:03:42 +02:00
|
|
|
.Op Fl v
|
2009-06-30 14:35:47 +02:00
|
|
|
.Fl m Ar msr
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
2018-01-05 22:06:19 +01:00
|
|
|
.Bk
|
2009-06-30 14:35:47 +02:00
|
|
|
.Nm
|
2017-09-30 12:03:42 +02:00
|
|
|
.Op Fl v
|
2009-06-30 14:35:47 +02:00
|
|
|
.Fl m Ar msr Ns = Ns Ar value
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
2018-01-05 22:06:19 +01:00
|
|
|
.Bk
|
2009-06-30 14:35:47 +02:00
|
|
|
.Nm
|
2017-09-30 12:03:42 +02:00
|
|
|
.Op Fl v
|
2009-06-30 14:35:47 +02:00
|
|
|
.Fl m Ar msr Ns &= Ns Ar mask
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
2018-01-05 22:06:19 +01:00
|
|
|
.Bk
|
2009-06-30 14:35:47 +02:00
|
|
|
.Nm
|
2017-09-30 12:03:42 +02:00
|
|
|
.Op Fl v
|
2009-06-30 14:35:47 +02:00
|
|
|
.Fl m Ar msr Ns |= Ns Ar mask
|
2008-08-08 18:26:53 +02:00
|
|
|
.Ar device
|
|
|
|
.Ek
|
2018-01-05 22:06:19 +01:00
|
|
|
.Bk
|
2008-08-08 18:26:53 +02:00
|
|
|
.Nm
|
2017-09-30 12:03:42 +02:00
|
|
|
.Op Fl v
|
2008-08-08 18:26:53 +02:00
|
|
|
.Fl i Ar level
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
2018-01-05 22:06:19 +01:00
|
|
|
.Bk
|
2008-08-08 18:26:53 +02:00
|
|
|
.Nm
|
2017-09-30 12:03:42 +02:00
|
|
|
.Op Fl v
|
2014-06-19 23:54:41 +02:00
|
|
|
.Fl i Ar level,level_type
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
2018-01-05 22:06:19 +01:00
|
|
|
.Bk
|
2014-06-19 23:54:41 +02:00
|
|
|
.Nm
|
2017-09-30 12:03:42 +02:00
|
|
|
.Op Fl vn
|
2008-08-08 18:26:53 +02:00
|
|
|
.Op Fl d Ar datadir
|
|
|
|
.Fl u
|
2018-01-05 22:06:19 +01:00
|
|
|
.Ar device
|
|
|
|
.Ek
|
2008-08-08 18:26:53 +02:00
|
|
|
.Bk
|
2018-01-05 22:06:19 +01:00
|
|
|
.Nm
|
|
|
|
.Fl e
|
2008-08-08 18:26:53 +02:00
|
|
|
.Ar device
|
|
|
|
.Ek
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2008-12-30 21:16:33 +01:00
|
|
|
utility can be used to read and write arbitrary machine-specific
|
|
|
|
CPU registers via the
|
2008-08-08 18:26:53 +02:00
|
|
|
.Xr cpuctl 4
|
2008-12-30 21:16:33 +01:00
|
|
|
special device.
|
|
|
|
It can also be used to apply CPU firmware updates.
|
2008-08-08 18:26:53 +02:00
|
|
|
.Pp
|
|
|
|
The following options are available:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl d Ar datadir
|
2017-09-30 12:03:42 +02:00
|
|
|
Directory paths where to look for microcode images.
|
2008-12-30 21:16:33 +01:00
|
|
|
The option can be specified multiple times.
|
2017-09-30 12:03:42 +02:00
|
|
|
The paths are added in order of the options appearance on the command
|
|
|
|
line, default directories are appended after the user-supplied paths.
|
|
|
|
.It Fl n
|
|
|
|
Do not look for the microcode images in the standard directories.
|
|
|
|
Currently standard directory to look for the microcode update files is
|
|
|
|
.Pa /usr/local/share/cpucontrol .
|
2017-08-14 13:19:31 +02:00
|
|
|
.It Fl m Ar msr
|
2009-06-30 14:35:47 +02:00
|
|
|
Show value of the specified MSR.
|
|
|
|
MSR register number should be given as a hexadecimal number.
|
2017-08-14 13:19:31 +02:00
|
|
|
The high word is printed first, then the low word is printed second.
|
2009-06-30 14:35:47 +02:00
|
|
|
.It Fl m Ar msr Ns = Ns Ar value
|
|
|
|
Store the
|
|
|
|
.Ar value
|
|
|
|
in the specified MSR register.
|
|
|
|
The
|
|
|
|
.Ar value
|
|
|
|
argument can be prefixed with ~ operator.
|
|
|
|
In this case the inverted value of argument will be stored in the register.
|
|
|
|
.It Fl m Ar msr Ns &= Ns Ar mask
|
|
|
|
Store the result of bitwise AND operation between
|
|
|
|
.Ar mask
|
|
|
|
and the current MSR value in the MSR register.
|
|
|
|
The
|
|
|
|
.Ar mask
|
|
|
|
argument can be prefixed with ~ operator.
|
|
|
|
In this case the inverted value of mask will be used.
|
|
|
|
.It Fl m Ar msr Ns |= Ns Ar mask
|
|
|
|
Store the result of bitwise OR operation between
|
|
|
|
.Ar mask
|
|
|
|
and the current MSR value in the MSR register.
|
|
|
|
The
|
|
|
|
.Ar mask
|
|
|
|
argument can be prefixed with ~ operator.
|
|
|
|
In this case the inverted value of mask will be used.
|
2008-08-08 18:26:53 +02:00
|
|
|
.It Fl i Ar level
|
2008-12-30 21:16:33 +01:00
|
|
|
Retrieve CPUID info.
|
|
|
|
Level should be given as a hex number.
|
2014-06-19 23:54:41 +02:00
|
|
|
.It Fl i Ar level,level_type
|
|
|
|
Retrieve CPUID info.
|
|
|
|
Level and level_type should be given as hex numbers.
|
2008-08-08 18:26:53 +02:00
|
|
|
.It Fl u
|
2008-12-30 21:16:33 +01:00
|
|
|
Apply CPU firmware updates.
|
|
|
|
The
|
2008-08-08 18:26:53 +02:00
|
|
|
.Nm
|
|
|
|
utility will walk through the configured data directories
|
2009-01-04 16:49:30 +01:00
|
|
|
and apply all firmware updates available for this CPU.
|
2018-01-05 22:06:19 +01:00
|
|
|
.It Fl e
|
|
|
|
Re-evaluate the kernel flags indicating the present CPU features.
|
|
|
|
This command is typically executed after a firmware update was applied
|
|
|
|
which changes information reported by the
|
|
|
|
.Dv CPUID
|
|
|
|
instruction.
|
|
|
|
.Pp
|
|
|
|
.Bf -symbolic
|
|
|
|
Only execute the
|
|
|
|
.Fl e
|
|
|
|
command after the microcode update was applied to all CPUs in the system.
|
|
|
|
The kernel does not operate correctly if the features of processors are
|
|
|
|
not identical.
|
|
|
|
.Ef
|
2008-08-08 18:26:53 +02:00
|
|
|
.It Fl v
|
|
|
|
Increase the verbosity level.
|
|
|
|
.It Fl h
|
|
|
|
Show help message.
|
|
|
|
.El
|
|
|
|
.Sh EXIT STATUS
|
2009-01-07 02:31:09 +01:00
|
|
|
.Ex -std
|
2008-08-08 18:26:53 +02:00
|
|
|
.Sh EXAMPLES
|
|
|
|
The command
|
|
|
|
.Pp
|
|
|
|
.Dq Li "cpucontrol -m 0x10 /dev/cpuctl0"
|
|
|
|
.Pp
|
|
|
|
will read the contents of TSC MSR from CPU 0.
|
|
|
|
.Pp
|
|
|
|
To set the CPU 0 TSC MSR register value to 0x1 issue
|
|
|
|
.Pp
|
2009-06-30 14:35:47 +02:00
|
|
|
.Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0" .
|
|
|
|
.Pp
|
|
|
|
The following command will clear the second bit of TSC register:
|
|
|
|
.Pp
|
|
|
|
.Dq Li "cpucontrol -m 0x10&=~0x02 /dev/cpuctl0" .
|
|
|
|
.Pp
|
|
|
|
The following command will set the forth and second bit of TSC register:
|
|
|
|
.Pp
|
|
|
|
.Dq Li "cpucontrol -m 0x10|=0x0a /dev/cpuctl0" .
|
2008-08-08 18:26:53 +02:00
|
|
|
.Pp
|
|
|
|
The command
|
|
|
|
.Pp
|
|
|
|
.Dq Li "cpucontrol -i 0x1 /dev/cpuctl1"
|
|
|
|
.Pp
|
|
|
|
will retrieve the CPUID level 0x1 from CPU 1.
|
|
|
|
.Pp
|
2008-12-30 21:16:33 +01:00
|
|
|
To perform firmware updates on CPU 0 from images located at
|
2017-09-30 12:03:42 +02:00
|
|
|
.Pa /usr/local/share/cpuctl
|
2008-08-08 18:26:53 +02:00
|
|
|
use the following command:
|
|
|
|
.Pp
|
2017-09-30 12:03:42 +02:00
|
|
|
.Dq Li "cpucontrol -nd /usr/local/share/cpuctl -u /dev/cpuctl0"
|
2008-08-08 18:26:53 +02:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr cpuctl 4
|
2009-01-04 16:49:30 +01:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility first appeared in
|
2009-04-23 10:37:56 +02:00
|
|
|
.Fx 7.2 .
|
2008-08-08 18:26:53 +02:00
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility and this manual page was written by
|
2014-06-20 11:57:27 +02:00
|
|
|
.An Stanislav Sedov Aq Mt stas@FreeBSD.org .
|