2008-08-08 16:26:53 +00: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$
|
|
|
|
.\"
|
|
|
|
.Dd August 4, 2008
|
|
|
|
.Dt CPUCONTROL 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm cpucontrol
|
|
|
|
.Nd control utility for the
|
|
|
|
.Xr cpuctl 4
|
|
|
|
device.
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl vh
|
|
|
|
.Fl m Ar msr Ns Op = Ns Ar value
|
|
|
|
.Bk
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
|
|
|
.Nm
|
|
|
|
.Op Fl vh
|
|
|
|
.Fl i Ar level
|
|
|
|
.Bk
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
|
|
|
.Nm
|
|
|
|
.Op Fl vh
|
|
|
|
.Op Fl d Ar datadir
|
|
|
|
.Fl u
|
|
|
|
.Bk
|
|
|
|
.Ar device
|
|
|
|
.Ek
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2008-12-30 20:16:33 +00:00
|
|
|
utility can be used to read and write arbitrary machine-specific
|
|
|
|
CPU registers via the
|
2008-08-08 16:26:53 +00:00
|
|
|
.Xr cpuctl 4
|
2008-12-30 20:16:33 +00:00
|
|
|
special device.
|
|
|
|
It can also be used to apply CPU firmware updates.
|
2008-08-08 16:26:53 +00:00
|
|
|
.Pp
|
|
|
|
The following options are available:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl d Ar datadir
|
2008-12-30 20:16:33 +00:00
|
|
|
Where to look for microcode images.
|
|
|
|
The option can be specified multiple times.
|
2008-08-08 16:26:53 +00:00
|
|
|
.It Fl m Ar msr Ns Op = Ns Ar value
|
2008-12-30 20:16:33 +00:00
|
|
|
Read/write the specified MSR.
|
|
|
|
Both the MSR and the value should be given as a hex number.
|
2008-08-08 16:26:53 +00:00
|
|
|
.It Fl i Ar level
|
2008-12-30 20:16:33 +00:00
|
|
|
Retrieve CPUID info.
|
|
|
|
Level should be given as a hex number.
|
2008-08-08 16:26:53 +00:00
|
|
|
.It Fl u
|
2008-12-30 20:16:33 +00:00
|
|
|
Apply CPU firmware updates.
|
|
|
|
The
|
2008-08-08 16:26:53 +00:00
|
|
|
.Nm
|
|
|
|
utility will walk through the configured data directories
|
2009-01-04 15:49:30 +00:00
|
|
|
and apply all firmware updates available for this CPU.
|
2008-08-08 16:26:53 +00:00
|
|
|
.It Fl v
|
|
|
|
Increase the verbosity level.
|
|
|
|
.It Fl h
|
|
|
|
Show help message.
|
|
|
|
.El
|
|
|
|
.Sh EXIT STATUS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility exits 0 on success, and >0 if an error occurs.
|
|
|
|
.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
|
|
|
|
.Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0"
|
|
|
|
.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 20:16:33 +00:00
|
|
|
To perform firmware updates on CPU 0 from images located at
|
2008-08-08 16:26:53 +00:00
|
|
|
.Pa /usr/local/share/cpuctl/
|
|
|
|
use the following command:
|
|
|
|
.Pp
|
|
|
|
.Dq Li "cpucontrol -d /usr/local/share/cpuctl/ -u /dev/cpuctl0"
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr cpuctl 4
|
2009-01-04 15:49:30 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility first appeared in
|
|
|
|
.Fx 8.0 .
|
2008-08-08 16:26:53 +00:00
|
|
|
.Sh BUGS
|
|
|
|
Yes, probably, report if any.
|
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility and this manual page was written by
|
|
|
|
.An Stanislav Sedov Aq stas@FreeBSD.org .
|