xref: /freebsd/usr.sbin/cpucontrol/cpucontrol.8 (revision e085f869d5c6ce0f8ea4ada858eac4b7ec2176ea)
1e085f869SStanislav Sedov.\" Copyright (c) 2006, 2008 Stanislav Sedov <stas@FreeBSD.org>.
2e085f869SStanislav Sedov.\" All rights reserved.
3e085f869SStanislav Sedov.\"
4e085f869SStanislav Sedov.\" Redistribution and use in source and binary forms, with or without
5e085f869SStanislav Sedov.\" modification, are permitted provided that the following conditions
6e085f869SStanislav Sedov.\" are met:
7e085f869SStanislav Sedov.\" 1. Redistributions of source code must retain the above copyright
8e085f869SStanislav Sedov.\"    notice, this list of conditions and the following disclaimer.
9e085f869SStanislav Sedov.\" 2. Redistributions in binary form must reproduce the above copyright
10e085f869SStanislav Sedov.\"    notice, this list of conditions and the following disclaimer in the
11e085f869SStanislav Sedov.\"    documentation and/or other materials provided with the distribution.
12e085f869SStanislav Sedov.\"
13e085f869SStanislav Sedov.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14e085f869SStanislav Sedov.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15e085f869SStanislav Sedov.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16e085f869SStanislav Sedov.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17e085f869SStanislav Sedov.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18e085f869SStanislav Sedov.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19e085f869SStanislav Sedov.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20e085f869SStanislav Sedov.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21e085f869SStanislav Sedov.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22e085f869SStanislav Sedov.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23e085f869SStanislav Sedov.\" SUCH DAMAGE.
24e085f869SStanislav Sedov.\"
25e085f869SStanislav Sedov.\" $FreeBSD$
26e085f869SStanislav Sedov.\"
27e085f869SStanislav Sedov.Dd August 4, 2008
28e085f869SStanislav Sedov.Dt CPUCONTROL 8
29e085f869SStanislav Sedov.Os
30e085f869SStanislav Sedov.Sh NAME
31e085f869SStanislav Sedov.Nm cpucontrol
32e085f869SStanislav Sedov.Nd control utility for the
33e085f869SStanislav Sedov.Xr cpuctl 4
34e085f869SStanislav Sedovdevice.
35e085f869SStanislav Sedov.Sh SYNOPSIS
36e085f869SStanislav Sedov.Nm
37e085f869SStanislav Sedov.Op Fl vh
38e085f869SStanislav Sedov.Fl m Ar msr Ns Op = Ns Ar value
39e085f869SStanislav Sedov.Bk
40e085f869SStanislav Sedov.Ar device
41e085f869SStanislav Sedov.Ek
42e085f869SStanislav Sedov.Nm
43e085f869SStanislav Sedov.Op Fl vh
44e085f869SStanislav Sedov.Fl i Ar level
45e085f869SStanislav Sedov.Bk
46e085f869SStanislav Sedov.Ar device
47e085f869SStanislav Sedov.Ek
48e085f869SStanislav Sedov.Nm
49e085f869SStanislav Sedov.Op Fl vh
50e085f869SStanislav Sedov.Op Fl d Ar datadir
51e085f869SStanislav Sedov.Fl u
52e085f869SStanislav Sedov.Bk
53e085f869SStanislav Sedov.Ar device
54e085f869SStanislav Sedov.Ek
55e085f869SStanislav Sedov.Sh DESCRIPTION
56e085f869SStanislav SedovThe
57e085f869SStanislav Sedov.Nm
58e085f869SStanislav Sedovutility can be used to read and write an arbitrary machine-specific
59e085f869SStanislav SedovCPU registers via
60e085f869SStanislav Sedov.Xr cpuctl 4
61e085f869SStanislav Sedovcontrolled special device and apply the CPU firmware updates.
62e085f869SStanislav Sedov.Pp
63e085f869SStanislav SedovThe following options are available:
64e085f869SStanislav Sedov.Bl -tag -width indent
65e085f869SStanislav Sedov.It Fl d Ar datadir
66e085f869SStanislav SedovWhere to look for microcode images. The option can be specified multiple times.
67e085f869SStanislav Sedov.It Fl m Ar msr Ns Op = Ns Ar value
68e085f869SStanislav SedovRead/write the specified MSR. Both the MSR and the value should be given as a hex number.
69e085f869SStanislav Sedov.It Fl i Ar level
70e085f869SStanislav SedovRetrieve CPUID info. Level should be given as a hex number.
71e085f869SStanislav Sedov.It Fl u
72e085f869SStanislav SedovApply CPU firmware updates. The
73e085f869SStanislav Sedov.Nm
74e085f869SStanislav Sedovutility will walk through the configured data directories
75e085f869SStanislav Sedovand will apply all firmware patches available for this CPU.
76e085f869SStanislav Sedov.It Fl v
77e085f869SStanislav SedovIncrease the verbosity level.
78e085f869SStanislav Sedov.It Fl h
79e085f869SStanislav SedovShow help message.
80e085f869SStanislav Sedov.El
81e085f869SStanislav Sedov.Sh EXIT STATUS
82e085f869SStanislav SedovThe
83e085f869SStanislav Sedov.Nm
84e085f869SStanislav Sedovutility exits 0 on success, and >0 if an error occurs.
85e085f869SStanislav Sedov.Sh EXAMPLES
86e085f869SStanislav SedovThe command
87e085f869SStanislav Sedov.Pp
88e085f869SStanislav Sedov.Dq Li "cpucontrol -m 0x10 /dev/cpuctl0"
89e085f869SStanislav Sedov.Pp
90e085f869SStanislav Sedovwill read the contents of TSC MSR from CPU 0.
91e085f869SStanislav Sedov.Pp
92e085f869SStanislav SedovTo set the CPU 0 TSC MSR register value to 0x1 issue
93e085f869SStanislav Sedov.Pp
94e085f869SStanislav Sedov.Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0"
95e085f869SStanislav Sedov.Pp
96e085f869SStanislav Sedov.Pp
97e085f869SStanislav SedovThe command
98e085f869SStanislav Sedov.Pp
99e085f869SStanislav Sedov.Dq Li "cpucontrol -i 0x1 /dev/cpuctl1"
100e085f869SStanislav Sedov.Pp
101e085f869SStanislav Sedovwill retrieve the CPUID level 0x1 from CPU 1.
102e085f869SStanislav Sedov.Pp
103e085f869SStanislav SedovTo perform firmware updated on CPU 0 from images located at
104e085f869SStanislav Sedov.Pa /usr/local/share/cpuctl/
105e085f869SStanislav Sedovuse the following command:
106e085f869SStanislav Sedov.Pp
107e085f869SStanislav Sedov.Dq Li "cpucontrol -d /usr/local/share/cpuctl/ -u /dev/cpuctl0"
108e085f869SStanislav Sedov.Sh SEE ALSO
109e085f869SStanislav Sedov.Xr cpuctl 4
110e085f869SStanislav Sedov.Sh BUGS
111e085f869SStanislav SedovYes, probably, report if any.
112e085f869SStanislav Sedov.Sh AUTHORS
113e085f869SStanislav SedovThe
114e085f869SStanislav Sedov.Nm
115e085f869SStanislav Sedovutility and this manual page was written by
116e085f869SStanislav Sedov.An Stanislav Sedov Aq stas@FreeBSD.org .
117