Linux update processor microcode CPU microcode

Source: Internet
Author: User

Linux update processor microcode CPU microcode
Linux update processor microcode CPU microcode simple record Kernel configuration

In the current Linux kernelmicrocodeThe 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)microcodeCorresponding to the current system cpuucodeUpdate after writing; kernel3.9In later versions, the kernel configuration parameters must be enabled to maintain compatibility;

CONFIG_MICROCODE_OLD_INTERFACE=y
  1. Sysfs interface,echo 1 > /sys/devices/system/cpu/microcode/reloadThe 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;
  2. EARLYMethod. After the kernel is initialized, the hybrid mode is loaded.microcodeCpio andinitrdramfs.3.9Later versions and enabling configuration parameters:
CONFIG_MICROCODE_INTEL_EARLY=yCONFIG_MICROCODE_AMD_EARLY=yCONFIG_MICROCODE_EARLY=y
Microcode update

Confirm current to be updatedmicrocodeCPU 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_ctlDirectly update:

microcode_ctl -u microcode.dat
Method 2

Use microcode_ctl v2.xintel-microcode2ucodeConversion 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 installationmicrocodeIn the format of 2 & 3, all CPUsmicrocodeAre included inmicrocode_ctlMedium:

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.