CPU Microcode: Difference between revisions

From Alpine Linux
(Quick and dirty article on how to install the microcode update packages)
 
m (Verifying results)
Line 16: Line 16:


If you are using syslinux or grub in a typical setup, the packages will automatically append your extlinux.conf or grub.conf file and merely a reboot will be required to run the new microcode. Users using UEFI's built-in boot manager will have to use efibootmgr to add a second initrd line.
If you are using syslinux or grub in a typical setup, the packages will automatically append your extlinux.conf or grub.conf file and merely a reboot will be required to run the new microcode. Users using UEFI's built-in boot manager will have to use efibootmgr to add a second initrd line.
== Verifying that the microcode image has loaded ==
Run the command:
{{cmd|dmesg | grep microcode}}
If the microcode initrd image was loaded, the microcode update driver version will appear in the dmesg output
{{codeline|[    0.624507] microcode: Microcode Update Driver: v2.2.}}

Revision as of 11:07, 6 August 2023

CPU microcode is a form of firmware that controls the processor's internals.

In modern processors, the microcode handles execution of complex and highly specialized instructions. Parts of the microcode also act as firmware for the processor's embedded controllers, and it is even used to fix or to mitigate processor design/implementation errata/bugs. Given the complexity of modern processors, a CPU may have over a hundred such errata.

Recently, microcode updates have become mandatory for security due to side-channel attacks against CPUs.

Obtaining microcode updates on Alpine

On Alpine Linux, CPU microcode is loaded early via initrd images, premade images are available from packages:

To obtain the microcode update package for AMD processors:

apk add amd-ucode

To obtain the microcode update package for Intel processors:

apk add intel-ucode

If you are using syslinux or grub in a typical setup, the packages will automatically append your extlinux.conf or grub.conf file and merely a reboot will be required to run the new microcode. Users using UEFI's built-in boot manager will have to use efibootmgr to add a second initrd line.

Verifying that the microcode image has loaded

Run the command:

dmesg | grep microcode

If the microcode initrd image was loaded, the microcode update driver version will appear in the dmesg output [ 0.624507] microcode: Microcode Update Driver: v2.2.