Jump to content

Talk:Microcode

From ArchWiki
Latest comment: 3 September 2025 by Hanabishi in topic actual verification?

Which CPUs accept microcode updates

AMD has closed its Operating System Research Center since November 2012: See this Phoronix article

The link to AMD's Operating System Research Center doesn't work any longer.

Maybe the section should be updated by removing the information for AMD users and keep only the information for Intel users ?

—This unsigned comment is by Zzrzlk (talk) 08:53, 1 July 2019‎ (UTC). Please sign your posts with ~~~~!Reply

Grub config file instructs the user not to manually edit it.

It might be worth making some kind of note that grub does not expect users to be editing the config file since the wiki presents manually editing this file as an option.

Benm (talk) 22:43, 27 March 2021 (UTC)Reply

It specifically says that option is for people managing the config file manually instead of using grub-mkconfig. It's a completely different situation from what you're talking about.
Scimmia (talk) 23:08, 27 March 2021 (UTC)Reply


Reverting Unified kernel images section to pre Special:Diff/751285

Reverted the Unified kernel images subsection to before Special:Diff/751285, as it just duplicates content which is already in Unified kernel image#mkinitpcio, whereas Unified kernel image contains guidance for mkinitcpio and other methods.

-- Cvlc (talk) 16:50, 5 October 2022 (UTC)Reply

microcode hook in mkinicpio

/etc/mkinitcpio.conf ships with the hook microcode now. Would be nice to have some information here about what it does or where to find more information. Pavelskipenes (talk) 18:41, 4 March 2024 (UTC)Reply

https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/merge_requests/291 Hanabishi (talk) 19:03, 4 March 2024 (UTC)Reply
I get the impression that I have to
  1. Remove `amd-ucode` or `intel-ucode` from bootloader's initrd.
  2. Add `microcode` to mkinitcpio's hooks.
Is that right? I haven't done anything because I don't want to mess up. I wish the wiki could make it more clear. 4color (talk) 02:44, 6 March 2024 (UTC)Reply
The `microcode` hook is automatically added to `/etc/mkinitcpio.conf` after new initramfs update. So I think we should only remove ucode from bootloader's initrd and nothing else. (Second step you mentioned is already done automatically) Jtag (talk) 11:23, 6 March 2024 (UTC)Reply
It is added automatically, but if the user modified `/etc/mkiniticpio.conf` in the past, the change is only done to the Pacnew file and has to be merged manually. The creation of the Pacnew file is also mentioned in the pacman log. Gregthwuen (talk) 13:22, 9 March 2024 (UTC)Reply
Yes very important note, thanks for mentioning. Jtag (talk) 12:03, 15 March 2024 (UTC)Reply
You also have to run mkinitcpio again to regenerate the images. But I think this isn't enough because with the changes it's not generating /boot/xxx-ucode.img and apparently no microcode is being loaded as I'm seeing warnings on journalctl. Danisztls (talk) 11:13, 15 March 2024 (UTC)Reply
It is working. The warning always existed. Danisztls (talk) 14:55, 29 April 2024 (UTC)Reply
What I'm also wondering is whether the `amd-ucode` and `intel-ucode` packages are still required after this change. At least the `.img` files in `/boot/` shouldn't be necessary anymore, right? Gregthwuen (talk) 13:33, 9 March 2024 (UTC)Reply
Of course. They contain the microcode in /usr/lib/firmware [1], which is used by mkinitcpio.
Hanabishi (talk) 14:15, 9 March 2024 (UTC)Reply
You mean `amd-ucode` and `intel-ucode` packages are still required, or the `.img` files in `/boot/` aren't necessary anymore, or both? 4color (talk) 14:26, 9 March 2024 (UTC)Reply
Both. If you use mkinitcpio with the new microcode hook, you don't need imgs anymore. You could delete them manually, but they will be installed again with the next firmware update anyway, so it is kinda pointless.
Answering ahead of the next question: old images are kept for compatibility [2].
Hanabishi (talk) 14:36, 9 March 2024 (UTC)Reply
Thanks for clarifying. For other hooks mkinitcpio prints out a warning about “possibly missing” files, which does not happen for the `microcode` hook with the `-ucode` packages missing. That's what irritated me a bit. Gregthwuen (talk) 15:33, 9 March 2024 (UTC)Reply
I went down the rabbit hole, yes - and the bit of missing information from the announcement is a step found in the forums after:
  1. Update all packages
  2. Add `microcode` to mkinitcpio's hooks
  3. Regenerate all initrds
    1. mkinitcpio -p linux
    2. mkinitcpio -p linux-lts
  4. Add to `/etc/default/grub`:
    1. GRUB_EARLY_INITRD_LINUX_STOCK=""
  5. Regenerate grub.cfg (keep an old copy! you can rescue boot it)
    1. cp -a /boot/grub/grub.cfg /boot/grub/grub-old.cfg
    2. grub-mkconfig -o /boot/grub/grub.cfg
Under the hood, the intel/amd packages own both the pre-built /boot img files and the unpacked files in /lib/firmware. The new mkinitcpio code runs a CPU detection routine, then takes the unpacked files and builds it's own combined binary ("GenuineIntel.bin" e.g.) which is then added inside the initramfs file. (run mkinitcpio --verbose .... > log.txt to see it all, it's a lot of output)
So for now due to how the packaging is combined for ucode, we have to use that extra setting to tell GRUB to ignore those files on disk as part of it's auto-detection routines. It's documented about 1/2 the way down the manual over here: https://www.gnu.org/software/grub/manual/grub/html_node/Simple-configuration.html TE (talk) 14:26, 9 March 2024 (UTC)Reply
Is using the new microcode hook actually manadatory in all cases going forward, or just for the subset of users that were previously relying on the --microcode flag and the microcode option in the preset files?
If you're using GRUB you can just skip adding the microcode hook and microcode loading is still going to work. In this case there is no need to add GRUB_EARLY_INITRD_LINUX_STOCK="" to /etc/default/grub. That's what I did since it seemed the more straightforward solution given the (lack of) information in the news. Noctavian (talk) 16:10, 12 March 2024 (UTC)Reply
No, not mandatory. You can remove the hook and continue to use separate .img files the old way.
In fact mkinitcpio is very late with this trasnition. E.g. dracut includes microcode into the initrd image already for years.
Hanabishi (