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