When looking at your system's logs, maybe you have noticed the following advice in Linux's dmesg output:
perf_event_intel: PEBS disabled due to CPU errata, please upgrade microcode
If you are running Debian, you just have to install two packages to fix the problem: intel-microcode and iucode-tool. With these packages installed, the Linux kernel will automagically upgrade the microcode during its boot sequence.
microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23 platform microcode: firmware: agent loaded intel-ucode/06-2a-07 into memory microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x23 microcode: CPU0 updated to revision 0x28, date = 2012-04-24
Now that the CPU microcode is up-to-date on your computer, let's see what microcode is and why it matters.
What is microcode?
Software has bugs. Hardware has bugs too. However, it is easier to fix a software bug than a hardware design defect in a CPU because software can be updated whereas a CPU must be replaced.
Intel documents its design defects and errors as errata. Some of these problems can be fixed by upgrading the CPU's microcode.
Microcode is a very low-level construct: it is a program that defines the control logic of the CPU. As such, microprogramming is lower-level than assembly programming. You can consider the assembly language instruction set as the CPU's API which is publicly documented whereas the microcode defines the implementation of an instruction for a specific CPU. Moreover, Intel's microcode is mostly a black box and only Intel's engineers have enough knowledge to write it.
The job of updating the CPU microcode is devoted to the BIOS or EFI firmware. But for many computers, vendors do not supply new firmware. Fortunately the operating system can update the microcode itself. It has to apply the update at every boot because the new microcode is lost after a CPU hard reset.
For more information about Intel's microcode, you can read:
- iucode's README
- Section 9.11 "microcode update facilities" of the Intel® 64 and IA-32 Architectures Software Developer’s Manual