1IUCODE_TOOL(8) iucode_tool manual IUCODE_TOOL(8)
2
3
4
6 iucode_tool - Tool to manipulate Intel® IA‐32/X86‐64 microcode bundles
7
9 iucode_tool [options] [[-ttype] filename|dirname] ...
10
12 iucode_tool is an utility that can load Intel® processor microcode data
13 from files in both text and binary microcode bundle formats.
14
15 It can output a list of the microcodes in these files, merge them,
16 upload them to the kernel (to upgrade the microcode in the system pro‐
17 cessor cores) or write some of them out to a file in binary format for
18 later use.
19
20 iucode_tool will load all microcodes in the specified files and direc‐
21 tories to memory, in order to process them. Duplicated and outdated
22 microcodes will be discarded. It can read microcode data from standard
23 input (stdin), by specifying a file name of “-” (minus sign).
24
25 Microcode data files are assumed to be in .dat text format if they have
26 a .dat suffix, and to be in binary format otherwise. Standard input
27 (stdin) is assumed to be in .dat text format. The -t option can be
28 used to change the type of the files specified after it, including for
29 stdin.
30
31 If a directory is specified, all files whose names do not begin with a
32 dot will be loaded, in unspecified order. Nested directories are
33 skipped.
34
35 Empty files and directories are ignored, and will be skipped.
36
37 You can select which microcodes should be written out, listed or
38 uploaded to the kernel using the -S, -s, --date-before and --date-after
39 options. Should none of those options be specified, all microcodes
40 will be selected.
41
42 You can upload the selected microcodes to the kernel, write them out to
43 a file (in binary format), to a Linux early initramfs archive, to per‐
44 processor‐signature files in a directory, or to per‐microcode files in
45 a directory using the -w, --write-earlyfw, -k, -K, and -W options.
46
47 iucode_tool will identify microcodes in its output and error messages
48 using a “n/k” notation, where “n” is the bundle number, and “k” is the
49 microcode number within that bundle. The output of the --list-all
50 option when processing multiple input files is the best example of how
51 it works.
52
53
54 For more information about Intel processor microcodes, please read the
55 included documentation and the Intel manuals listed in the SEE ALSO
56 section.
57
58
60 iucode_tool accepts the following options:
61
62
63 -q, --quiet
64 Inhibit usual output.
65
66 -v, --verbose
67 Print more information. Use more than once for added verbosity.
68
69 -h, -?, --help
70 List all available options and their meanings.
71
72 --usage
73 Show summary of options.
74
75 -V, --version
76 Show version of program.
77
78
79 -t type
80 Sets the file type of the following files. type can be:
81
82 b binary format. This is the same format used by the ker‐
83 nel driver and the BIOS/EFI, which is described in detail
84 by the Intel 64 and IA‐32 Architectures Software Devel‐
85 oper's Manual, Volume 3A, section 9.11.
86
87 d Intel microcode .dat text format. This is the format
88 normally used by Intel to distribute microcode data
89 files.
90
91 r recover microcode in binary format. Search uncompressed
92 generic binary files for microcodes in Intel microcode
93 binary format to recover. Note: It can find microcode
94 that will not pass strict checks, and thus cause
95 iucode_tool to exit if the --no-strict-checks or
96 --ignore-broken options are not in effect.
97
98 a (default) iucode_tool will use the suffix of the file
99 name to select the file type: .dat text format for files
100 that have a .dat suffix, and binary type otherwise. Note
101 that for stdin, .dat text format is assumed.
102
103
104 --downgrade
105 When multiple versions of the microcode for a specific processor
106 are available from different files, keep the one from the file
107 loaded last, regardless of revision levels. Files are always
108 loaded in the order they were specified in the command line.
109 This option has no effect when just one file has been loaded.
110
111
112 --no-downgrade
113 When multiple versions of the microcode for a specific processor
114 are available from different files, keep the one with the high‐
115 est revision level. This is the default mode of operation.
116
117
118 --strict-checks
119 Perform strict checks on the microcode data. It will refuse to
120 load microcodes and microcode data files with unexpected size
121 and metadata. It will also refuse to load microcode entries
122 that have the same metadata, but different payload. This is the
123 default mode of operation.
124
125
126 --no-strict-checks
127 Perform less strict checks on the microcode data. Use only if
128 you happen to come across a microcode data file that has
129 microcodes with weird sizes or incorrect non‐critical metadata
130 (such as invalid dates), which you want to retain. If you just
131 want to skip those, use the --ignore-broken option.
132
133
134 --ignore-broken
135 Skip broken microcode entries when loading a microcode data
136 file, instead of aborting program execution. If the microcode
137 entry has an unsupported format or had its header severely cor‐
138 rupted, all remaining data in the file will have to be ignored.
139 In that case, using a file type of recover microcode in binary
140 format (-tr option) is recommended, as it can skip over badly
141 mangled microcode data.
142
143
144 --no-ignore-broken
145 Abort program execution if a broken microcode is found while
146 loading a microcode data file. This is the default mode of
147 operation.
148
149
150
151 -s ! | [!]signature[,pf_mask]
152 Select microcodes by the specified signature and processor flags
153 mask (pf_mask). If the processor flags mask is specified, it
154 will select only microcodes that are suitable for at least one
155 of the processor flag combinations present in the mask.
156
157 Specify more than once to select more microcodes. This option
158 can be combined with the --scan-system option to select more
159 microcodes. If signature is prefixed with a “!” (exclamation
160 mark), it will deselect microcodes instead. Ordering matters,
161 with later -s options overriding earlier ones, including
162 --scan-system.
163
164 When specifying signature and pf_mask, hexadecimal numbers must
165 be prefixed with “0x”, and octal numbers with “0”. Decimal num‐
166 bers must not have leading zeros, otherwise they would be inter‐
167 preted as octal numbers.
168
169 The special notation -s! (with no signature parameter) instructs
170 iucode_tool to require explicit inclusion of microcode signa‐
171 tures (using the non-negated form of -s, or using --scan-sys‐
172 tem).
173
174
175 -S, --scan-system
176 Select microcodes by scanning online processors on this system
177 for their signatures.
178
179 This option can be used only once, and it can be combined with
180 the -s option to select more microcodes. The microcodes
181 selected by --scan-system can also be deselected by a later
182 -s !signature option.
183
184 Should the signature scan fail, the program will print a warning
185 to the user and continue as if --scan-system had not been speci‐
186 fied. This is a fail‐safe condition when iucode_tool is used to
187 install microcode updates for the next boot.
188
189
190 --date-before=YYYY-MM-DD and --date-after=YYYY-MM-DD
191 Limit the selected microcodes by a date range. The date must be
192 given in ISO format, with four digits for the year and two dig‐
193 its for the month and day and “-” (minus sign) for the separa‐
194 tor. Dates are not range‐checked, so you can use
195 --date-after=2000-00-00 to select all microcodes dated since
196 January 1st, 2000.
197
198
199 --loose-date-filtering
200 When a date range is specified, all revisions of the microcode
201 will be considered for selection (ignoring just the date range,
202 all other filters still apply) should any of the microcode's
203 revisions be within the date range.
204
205
206 --strict-date-filtering
207 When a date range is specified, select only microcodes which are
208 within the date range. This is the default mode of operation.
209
210
211 -l, --list
212 List selected microcode signatures to standard output (stdout).
213
214 -L, --list-all
215 List all microcode signatures while they're being processed to
216 standard output (stdout).
217
218
219 -k[device], --kernel[=device]
220 Upload selected microcodes to the kernel. Optionally, the
221 device path can be specified (default: /dev/cpu/microcode).
222 This update method is deprecated: it will be removed eventually
223 from the kernel and from iucode_tool.
224
225 -K[directory], --write-firmware[=directory]
226 Write selected microcodes with the file names expected by the
227 Linux kernel firmware loader. Optionally, the destination
228 directory can be specified (default: /lib/firmware/intel‐ucode).
229
230
231 -wfile, --write-to=file
232 Write selected microcodes to a file in binary format.
233
234
235 --write-earlyfw=file
236 Write selected microcodes to an early initramfs archive, which
237 should be prepended to the regular initramfs to allow the kernel
238 to update processor microcode very early during system boot.
239
240
241 -Wdirectory, --write-named-to=directory
242 Write selected microcodes to the specified directory, one
243 microcode per file, in binary format. The file names reflect
244 the microcode signature, processor flags mask and revision.
245
246
247 --write-all-named-to=directory
248 Write every microcode to the specified directory, one microcode
249 per file, in binary format. The file names reflect the
250 microcode signature, processor flags mask and revision. This is
251 the only way to write out every revision of the same microcode.
252
253
254 --overwrite
255 Remove the destination file before writing, if it exists and is
256 not a directory. The destination file is not overwritten in‐
257 place. Hardlinks will be severed, and any existing access per‐
258 missions, ACLs and other extended attributes of the old destina‐
259 tion file will be lost.
260
261
262 --no-overwrite
263 Abort if the destination file already exists. This is the
264 default mode of operation. Do note that iucode_tool does not
265 follow non‐directory symlinks when writing files.
266
267
268 --mini-earlyfw
269 Optimize the early initramfs cpio container for minimal size.
270 It will change the cpio block size to 16 bytes, and remove
271 header entries for the parent directories of the microcode data
272 file. As a result, the microcode data file will not be avail‐
273 able to the regular initramfs, and tools might complain about
274 the non‐standard cpio block size.
275
276 This will typically reduce the early initramfs size by 736
277 bytes.
278
279
280 --normal-earlyfw
281 Optimize the early initramfs size for tool compatibility. This
282 is the default mode of operation. The microcode data file will
283 be available inside the regular initramfs as well.
284
285
287 iucode_tool reads all data to memory before doing any processing. It
288 enforces a sanity limit of a maximum of 1GiB worth of binary microcode
289 data per microcode data file.
290
291
292 All informational and error messages are sent to standard error
293 (stderr), while user‐requested output (such as output generated by the
294 list options) is sent to standard output (stdout).
295
296
297 iucode_tool creates files with permissions 0644 (rw-r--r--), modified
298 by the current umask.
299
300
301 iucode_tool's selected microcode listing and microcode output files are
302 sorted first by processor signature (in ascending order), and then by
303 processor flags mask (in descending order).
304
305
306 When multiple revisions of a microcode are selected, the older ones
307 will be skipped. Only the newest selected revision of a microcode (or
308 the last one in load order when the --downgrade option is active) will
309 be written to a file or uploaded to the kernel.
310
311
312 Intel microcode data files, both in binary and text formats, can be
313 concatenated to generate a bigger and still valid microcode data file.
314
315
316 iucode_tool does not follow symlinks when writing microcode data files.
317 It will either refuse to write the file and abort (default mode of
318 operation), or (when the --overwrite option is active) it will remove
319 the target symlink or file (and therefore breaking hardlinks) before
320 writing the new file.
321
322
323 iucode_tool does follow directory symlinks to locate the directory to
324 write files into.
325
326
327 Linux Notes
328 Before Linux v4.4, the microcode update driver was split in two parts:
329 the early microcode update driver (which gets microcode data from the
330 initramfs) and the late microcode update driver, which could be a mod‐
331 ule and got microcode data from the firmware subsystem. The two driv‐
332 ers were unified in Linux v4.4.
333
334 The microcode update driver needs to be present in the system at all
335 times to ensure microcode updates are reapplied on resume from suspend
336 and CPU hotplug. Do not unload the microcode module, unless you really
337 know better. Since Linux v4.4, the late microcode driver cannot be a
338 module anymore and will always be present in the system when enabled.
339
340 Updating microcode early is safer. It can only be done at boot and it
341 requires an initramfs, but it is strongly recommended: late microcode
342 updates (which read microcode data from /lib/firmware) cannot safely
343 change visible processor features.
344
345 Early microcode updates are available since Linux v3.9. They can
346 safely change visible processor features (such as the microcode updates
347 that disabled Intel TSX instructions on Intel Haswell cores do). They
348 require an uncompressed initramfs image with the microcode update data
349 in /kernel/x86/microcode/GenuineIntel.bin. This uncompressed initramfs
350 image must come before any compressed initramfs image(s), and it has an
351 special name: early initramfs.
352
353 The microcode update data inside the early initramfs image must be
354 aligned to a 16‐byte boundary due to a bug in several versions of the
355 Linux kernel early microcode update driver. This requires special
356 steps when creating the initramfs archive with the microcode data, and
357 will be handled automatically by the iucode_tool --write-earlyfw
358 option.
359
360 Since Linux v4.2, it is also possible to build a kernel with the
361 microcode update data as built‐in firmware, using the CON‐
362 FIG_FIRMWARE_IN_KERNEL facility. This feature is not yet mature as of
363 Linux v4.2.8, v4.4.11, v4.5.5 and v4.6, and might not work in every
364 case.
365
366 The /dev/cpu/microcode update interface has been deprecated and should
367 not be used. It has one special requirement: each write syscall must
368 contain whole microcode(s). It can be accessed through iucode_tool
369 --kernel.
370
371 Up to Linux v3.5, late microcode updates were required to be triggered
372 per‐core, by writing the number 1 to /sys/devices/sys‐
373 tem/cpu/*/microcode/reload for every cpu. Depending on kernel version,
374 you must either trigger it on every core to avoid a dangerous situation
375 where some cores are using outdated microcode, or the kernel will
376 accept the request only for the boot processor and use it to trigger an
377 update on all system processor cores.
378
379 Since Linux v3.6, the late microcode update driver has a new interface
380 that explicitly triggers an update for every core at once when the num‐
381 ber 1 is written to /sys/devices/system/cpu/microcode/reload.
382
383
385 Updating files in /lib/firmware/intel‐ucode:
386 iucode_tool -K/lib/firmware/intel‐ucode \
387 /lib/firmware/intel‐ucode \
388 /tmp/file-with-new-microcodes.bin
389
390 Processing several compressed files at once:
391 zcat intel-microcode*.dat.gz | iucode_tool -l -
392
393 zcat intel-microcode*.bin.gz | iucode_tool -l -tb -
394
395 Selecting microcodes and creating an early initramfs:
396 iucode_tool --scan-system \
397 --write-earlyfw=/tmp/early.cpio \
398 /lib/firmware/intel-ucode
399
400 iucode_tool -s 0x106a5 -s 0x106a4 -l /lib/firmware/intel-ucode
401
402 Using the recovery loader to load and to update microcode in an early
403 initramfs:
404 iucode_tool -L -tr /boot/intel-ucode.img
405
406 iucode_tool -Ll -S --write-earlyfw=/boot/intel-ucode.img.new \
407 -tr /boot/intel-ucode.img -tb /lib/firmware/intel-ucode &&
408 \
409 mv /boot/intel-ucode.img.new /boot/intel-ucode.img
410
411
413 Microcode with negative revision numbers is not special‐cased, and will
414 not be preferred over regular microcode.
415
416
417 The downgrade mode should be used only for microcodes with the same
418 processor flags mask. It cannot handle the corner cases where modify‐
419 ing a processor flags mask would be required to force the kernel to
420 load a lower revision of a microcode, and iucode_tool will issue an
421 warning when that happens. So far, this has not proved to be a rele‐
422 vant limitation as changes to the processor flags mask of post‐launch,
423 production microcode updates are very rare.
424
425
426 The loader version microcode metadata field is ignored by iucode_tool.
427 This shouldn't cause problems as long as the same signature never needs
428 more than a single type of loader.
429
430
431 Files are not replaced atomically: if iucode_tool is interrupted while
432 writing to a file, that file will be corrupted.
433
434
436 The Intel 64 and IA‐32 Architectures Software Developer's Manual, Vol‐
437 ume 3A: System Programming Guide, Part 1 (order number 253668), section
438 9.11.
439
441 Henrique de Moraes Holschuh <hmh@hmh.eng.br>
442
443
444
445IUCODE_TOOL 2.2 2016‐11‐10 IUCODE_TOOL(8)