WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: early loading microcode for kernel 5.19+  (Read 135 times)

Offline nick65go

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 909
early loading microcode for kernel 5.19+
« on: August 01, 2025, 12:56:22 PM »
Maybe was not enough discussed, but it seams important: https://wiki.archlinux.org/title/Microcode#Late_loading
"Warning: Late microcode loading is considered dangerous, using it on Linux 5.19 and later will taint the kernel", I would say near useless to be in a tcz extension.

Latest TC16 has kernel 6.x, so microcode for Intel / AMD should be EARLY loaded. And this can be done only by an early initialRAM. So basically you BUILD a very small core1 (ex: with files from /usr/lib/firmware/intel-ucode) and concatenate it with original TC core2, core1 being before core2 in final cpio file.

FYI: some bloated distro could do this automatically for you
Code: [Select]
❯ sudo journalctl -k --grep='microcode:'
[sudo] password for abc:
Jul 29 19:44:00 cachyos-HP17 kernel: microcode: Current revision: 0x00004128
Jul 29 19:44:00 cachyos-HP17 kernel: microcode: Updated early from: 0x00004119
~
❯ grep microcode /proc/cpuinfo
microcode       : 0x4128
« Last Edit: August 01, 2025, 12:57:56 PM by nick65go »

Offline nick65go

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 909
Re: early loading microcode for kernel 5.19+
« Reply #1 on: August 01, 2025, 01:30:59 PM »
and here is how to do it manually: https://docs.kernel.org/arch/x86/microcode.html#early-load-microcode
PS: if you know which file you need then you do not need to concatenate ALL files from  /lib/firmware/intel-ucode/* (10+MB) but just ~200 KB.Even the CPU identification can be obtained and then using triplet (X-Y-Z ) to just select your specific binary.ex:
Code: [Select]
❯ lscpu
Architecture:                x86_64
  CPU op-mode(s):            32-bit, 64-bit
  Address sizes:             39 bits physical, 48 bits virtual
  Byte Order:                Little Endian
CPU(s):                      12
  On-line CPU(s) list:       0-11
Vendor ID:                   GenuineIntel
  Model name:                13th Gen Intel(R) Core(TM) i5-1335U
    CPU family:              6   <=== X
   Model:                   186  <=== Y
    Thread(s) per core:      2
    Core(s) per socket:      10
    Socket(s):               1
   Stepping:                3  <=== Z
So CPU-family=6, Model=186 (aka 0x/ba in hexadecimal) and Stepping=3 so I need just the file 06-ba-03 of 224 kb
Code: [Select]
❯ ls /lib/firmware/intel-ucode/06-ba-03
.rw-r--r-- 224k root 12 Mai 19:56 󰡯 /lib/firmware/intel-ucode/06-ba-03

« Last Edit: August 01, 2025, 01:48:18 PM by nick65go »