Linux update processor microcode CPU microcode
Linux update processor microcode CPU microcode simple record Kernel configuration
In the current Linux kernelmicrocode
The module provides the Intel/amd cpu update interface. You can configure the following parameters to enable this module:
CONFIG_MICROCODE=yCONFIG_MICROCODE_INTEL=yCONFIG_MICROCODE_AMD=yCONFIG_MICROCODE_OLD_INTERFACE=yCONFIG_MICROCODE_INTEL_LIB=y
This module provides three different interfaces:
1./dev/cpu/microcode
, Use a third-party tool (such as microcode_ctl)microcode
Corresponding to the current system cpuucode
Update after writing; kernel3.9
In later versions, the kernel configuration parameters must be enabled to maintain compatibility;
CONFIG_MICROCODE_OLD_INTERFACE=y
- Sysfs interface,
echo 1 > /sys/devices/system/cpu/microcode/reload
The kernel will automatically find/lib/firmware/intel-ucode/
The directory updates the file based on the current CPU (Format: family-model-stepping) and performs the update operation;
EARLY
Method. After the kernel is initialized, the hybrid mode is loaded.microcode
Cpio andinitrdramfs
.3.9
Later versions and enabling configuration parameters:
CONFIG_MICROCODE_INTEL_EARLY=yCONFIG_MICROCODE_AMD_EARLY=yCONFIG_MICROCODE_EARLY=y
Microcode update
Confirm current to be updatedmicrocode
CPU version and step information:
cat /proc/cpuinfo |grep "model\|microcode\|stepping\|family" |head -n 5
cpu family : 6model : 45model name : Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHzstepping : 7microcode : 0x70a
The current CPU ucode file is *06-2d-07
*
Download CPU microcode
AMD's Operating System Research Center.
Intel's download center.
Decompress the package into a single file:microcode.dat
Download [microcode_ctl] (https://fedorahosted.org/microcode_ctl)
Method 1
Use microcode_ctl 1.7microcode_ctl
Directly update:
microcode_ctl -u microcode.dat
Method 2
Use microcode_ctl v2.xintel-microcode2ucode
Conversion Tool.
Cp microcode. dat/lib/firmware/cd/lib/fimware # decode microcode. dat and generate the CPU Update file intel-microcode2ucode microcode Based on the 'intel-ucode' directory under the current directory. dat # notify kernel to automatically update echo 1>/sys/devices/system/cpu/microcode/reload
Method 3
It is known that the current CPU Update file is06-2d-07
, Create a hybrid initrd:
Mkdir initrdcd initrdmkdir-p kernel/x86/microcode # the Intel CPU file name is GenuineIntel. bin; amd cpu file name is AuthenticAMD. bincp/lib/firmware/intel-ucode/06-2d-07 kernel/x86/microcode/GenuineIntel. binfind. | cpio-o-H newc> .. /ucode. cpiocd .. cat ucode. cpio/boot/initrd. img> initrd-ucode.img
Modify the grub configuration parameters and restart to complete the update.
initrd initrd-ucode.img
Update complete
cat /proc/cpuinfo |grep "model\|microcode\|stepping\|family" |head -n 5cpu family : 6model : 45model name : Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHzstepping : 7microcode : 0x710......
Note
RHEL/CentOS 7 automatically updates the current CPU during system installationmicrocode
In the format of 2 & 3, all CPUsmicrocode
Are included inmicrocode_ctl
Medium:
cat /usr/lib/systemd/system/microcode.service[Unit]Description=Load CPU microcode updateAfter=basic.targetConditionVirtualization=false[Service]Type=oneshotRemainAfterExit=noExecStart=/usr/bin/bash -c "echo 1 > /sys/devices/system/cpu/microcode/reload"[Install]WantedBy=basic.target
cpio -t < initramfs-3.10.0-327.el7.x86_64.img.kernelkernel/x86kernel/x86/microcodekernel/x86/microcode/GenuineIntel.binearly_cpio36 blocks
Other Linux releases are not tested. I believe the same is true.