1 .\" Copyright (c) 2006, 2008 Stanislav Sedov <stas@FreeBSD.org>.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
25 .\" $FreeBSD: head/usr.sbin/cpucontrol/cpucontrol.8 267668 2014-06-20 09:57:27Z bapt $
32 .Nd control utility for the
44 .Fl m Ar msr Ns = Ns Ar value
50 .Fl m Ar msr Ns &= Ns Ar mask
56 .Fl m Ar msr Ns |= Ns Ar mask
68 .Fl i Ar level,level_type
82 utility can be used to read and write arbitrary machine-specific
86 It can also be used to apply CPU firmware updates.
88 The following options are available:
89 .Bl -tag -width indent
91 Where to look for microcode images.
92 The option can be specified multiple times.
93 .It Fl m Ar msr Ns Op = Ns Ar value
94 Show value of the specified MSR.
95 MSR register number should be given as a hexadecimal number.
96 .It Fl m Ar msr Ns = Ns Ar value
99 in the specified MSR register.
102 argument can be prefixed with ~ operator.
103 In this case the inverted value of argument will be stored in the register.
104 .It Fl m Ar msr Ns &= Ns Ar mask
105 Store the result of bitwise AND operation between
107 and the current MSR value in the MSR register.
110 argument can be prefixed with ~ operator.
111 In this case the inverted value of mask will be used.
112 .It Fl m Ar msr Ns |= Ns Ar mask
113 Store the result of bitwise OR operation between
115 and the current MSR value in the MSR register.
118 argument can be prefixed with ~ operator.
119 In this case the inverted value of mask will be used.
122 Level should be given as a hex number.
123 .It Fl i Ar level,level_type
125 Level and level_type should be given as hex numbers.
127 Apply CPU firmware updates.
130 utility will walk through the configured data directories
131 and apply all firmware updates available for this CPU.
133 Increase the verbosity level.
142 .Dq Li "cpucontrol -m 0x10 /dev/cpuctl0"
144 will read the contents of TSC MSR from CPU 0.
146 To set the CPU 0 TSC MSR register value to 0x1 issue
148 .Dq Li "cpucontrol -m 0x10=0x1 /dev/cpuctl0" .
150 The following command will clear the second bit of TSC register:
152 .Dq Li "cpucontrol -m 0x10&=~0x02 /dev/cpuctl0" .
154 The following command will set the forth and second bit of TSC register:
156 .Dq Li "cpucontrol -m 0x10|=0x0a /dev/cpuctl0" .
160 .Dq Li "cpucontrol -i 0x1 /dev/cpuctl1"
162 will retrieve the CPUID level 0x1 from CPU 1.
164 To perform firmware updates on CPU 0 from images located at
165 .Pa /usr/local/share/cpuctl/
166 use the following command:
168 .Dq Li "cpucontrol -d /usr/local/share/cpuctl/ -u /dev/cpuctl0"
174 utility first appeared in
179 utility and this manual page was written by
180 .An Stanislav Sedov Aq Mt stas@FreeBSD.org .
182 Yes, probably, report if any.