Microcode

From Funtoo
Jump to: navigation, search

What is this "microcode?"

Wikipedia defines microcode as:

A layer of hardware-level instructions or data structures involved in the implementation of higher level machine code instructions in central processing units, and in the implementation of the internal logic of manychannel controllers, disk controllers, network interface controllers, network processors, graphics processing units, and other hardware. It resides in special high-speed memory and translates machine instructions into sequences of detailed circuit-level operations. It helps separate the machine instructions from the underlying electronics so that instructions can be designed and altered more freely. It also makes it feasible to build complex multi-step instructions while still reducing the complexity of the electronic circuitry compared to other methods.

AMD microcode support

Note
Supported CPU families: 10h (Barcelona), 11h (Turion x2 Ultra), 12h (Llano), 14h (Bobcat), 15h (Bulldozer)

Emerging the required package

For microcode to work with AMD, first emerge sys-kernel/linux-firmware (package not on wiki - please add):

# emerge linux-firmware

Kernel configuration

Processor type and features --->
   <*> CPU microcode loading support
   [ ] Intel microcode loading support
   [*] AMD microcode loading support
Device Drivers --->
   Generic Driver Options --->
      (amd-ucode/microcode_amd.bin amd-ucode/microcode_amd_fam15h.bin) External firmware blobs to build into the kernel binary

Now, run:

# reboot

The new microcode will be loaded after the next reboot.


INTEL microcode support

Emerging the required package

For microcode to work with INTEL, first emerge sys-apps/iucode_tool (package not on wiki - please add) and sys-firmware/intel-microcode (package not on wiki - please add):

# emerge sys-apps/iucode_tool sys-firmware/intel-microcode

Identify which microcode is suitable for your processor

# /usr/sbin/iucode_tool -tb -lS /lib/firmware/intel-ucode/*

In my case, the bundle 50 was selected:

microcode bundle 50: /lib/firmware/intel-ucode/06-3d-04

selected microcodes:
  050/001: sig 0x000306d4, pf_mask 0xc0, 2017-01-27, rev 0x0025, size 17408

Kernel configuration

Processor type and features --->
   <*> CPU microcode loading support
   [*] Intel microcode loading support
   [] AMD microcode loading support
Device Drivers --->
   Generic Driver Options --->
      (intel-ucode/06-3d-04) External firmware blobs to build into the kernel binary
      (/lib/firmware) Firmware blobs root directory


Recompile and rebootː

# reboot

After reboot, runː

# dmesg | grep microcode
[    0.000000] microcode: microcode updated early to revision 0x25, date = 2017-01-27
[    0.358096] microcode: sig=0x306d4, pf=0x40, revision=0x25
[    0.358145] microcode: Microcode Update Driver: v2.2.