xref: /freebsd/usr.sbin/cpucontrol/cpucontrol.8 (revision 13014ca04aad1931d41958b56f71a2c65b9a7a2c)
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 an arbitrary machine-specific
59CPU registers via
60.Xr cpuctl 4
61controlled special device and apply the CPU firmware updates.
62.Pp
63The following options are available:
64.Bl -tag -width indent
65.It Fl d Ar datadir
66Where to look for microcode images. The option can be specified multiple times.
67.It Fl m Ar msr Ns Op = Ns Ar value
68Read/write the specified MSR. Both the MSR and the value should be given as a hex number.
69.It Fl i Ar level
70Retrieve CPUID info. Level should be given as a hex number.
71.It Fl u
72Apply CPU firmware updates. The
73.Nm
74utility will walk through the configured data directories
75and will apply all firmware patches available for this CPU.
76.It Fl v
77Increase the verbosity level.
78.It Fl h
79Show help message.
80.El
81.Sh EXIT STATUS
82The
83.Nm
84utility exits 0 on success, and >0 if an error occurs.
85.Sh EXAMPLES
86The command
87.Pp
88.Dq Li "cpucontrol -m 0x10 /dev/cpuctl0"
89.Pp
90will read the contents of TSC MSR from CPU 0.
91.Pp
92To set the CPU 0 TSC MSR register value to 0x1 issue
93.Pp
94.Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0"
95.Pp
96.Pp
97The command
98.Pp
99.Dq Li "cpucontrol -i 0x1 /dev/cpuctl1"
100.Pp
101will retrieve the CPUID level 0x1 from CPU 1.
102.Pp
103To perform firmware updated on CPU 0 from images located at
104.Pa /usr/local/share/cpuctl/
105use the following command:
106.Pp
107.Dq Li "cpucontrol -d /usr/local/share/cpuctl/ -u /dev/cpuctl0"
108.Sh SEE ALSO
109.Xr cpuctl 4
110.Sh BUGS
111Yes, probably, report if any.
112.Sh AUTHORS
113The
114.Nm
115utility and this manual page was written by
116.An Stanislav Sedov Aq stas@FreeBSD.org .
117