Difference between revisions of "Microcode"

From Funtoo
Jump to: navigation, search
(Created page with "== What is this "microcode?" == ''Wikipedia defines microcode as:'' "a layer of hardware-level instructions or data structures involved in the implementation of higher level m...")
 
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
== What is this "microcode?" ==
 
== 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. " [http://en.wikipedia.org/wiki/Microcode]
+
''[http://en.wikipedia.org/wiki/Microcode Wikipedia] defines microcode as:''  
 +
 
 +
<blockquote>
 +
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.
 +
</blockquote>
  
 
== AMD microcode support ==
 
== AMD microcode support ==
{{fancynote| Supported CPU families: 10h (Barcelona), 11h (Turion x2), 12h (Llano), 14h (Bobcat), 15h (Bulldozer)}}
+
{{fancynote| Supported CPU families: 10h (Barcelona), 11h (Turion x2 Ultra), 12h (Llano), 14h (Bobcat), 15h (Bulldozer)}}
  
 
=== Emerging the required package ===
 
=== Emerging the required package ===
Line 14: Line 18:
 
=== Kernel configuration ===
 
=== Kernel configuration ===
  
{{kernelop
+
{{kernelop|desc=
| <br> |<pre>
 
 
Processor type and features --->
 
Processor type and features --->
 
   <*> CPU microcode loading support
 
   <*> CPU microcode loading support
Line 23: Line 26:
 
   Generic Driver Options --->
 
   Generic Driver Options --->
 
       (amd-ucode/microcode_amd.bin amd-ucode/microcode_amd_fam15h.bin) External firmware blobs to build into the kernel binary
 
       (amd-ucode/microcode_amd.bin amd-ucode/microcode_amd_fam15h.bin) External firmware blobs to build into the kernel binary
</pre>}}
+
}}
  
 
Now, run:
 
Now, run:
Line 31: Line 34:
  
 
The new microcode will be loaded after the next 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 {{Package|sys-apps/iucode_tool}} and {{Package|sys-firmware/intel-microcode}}:
 +
 +
<console>###i## emerge sys-apps/iucode_tool sys-firmware/intel-microcode
 +
</console>
 +
 +
=== Identify which microcode is suitable for your processor ===
 +
 +
<console>###i## /usr/sbin/iucode_tool -tb -lS /lib/firmware/intel-ucode/*
 +
</console>
 +
 +
In my case, the bundle 50 was selected:
 +
 +
<pre>
 +
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
 +
</pre>
 +
 +
=== Kernel configuration ===
 +
 +
{{kernelop|desc=
 +
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ː
 +
 +
<console>###i## reboot
 +
</console>
 +
 +
After reboot, runː
 +
 +
<console>###i## dmesg | grep microcode
 +
</console>
 +
 +
<pre>
 +
[    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.
 +
</pre>
 +
 
[[Category:Hardware]]
 
[[Category:Hardware]]

Latest revision as of 12:20, January 4, 2018

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:

root # 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:

root # 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 and sys-firmware/intel-microcode:

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

Identify which microcode is suitable for your processor

root # /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ː

root # reboot

After reboot, runː

root # 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.