You are not logged in.

#1 2023-08-26 08:22:03

problembasedpers0n
Member
Registered: 2023-08-26
Posts: 6

Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

Hello, everyone. This is my first post.

I've been using UKIs to load Arch Linux for a while. Since sbupdate is no longer maintained, I've switched to mkinitcpio UKI generation and sbctl signing. That's when I noticed that, apparently, the microcode in my AMD Ryzen 9 5950X is not being loaded (or is non-existent), since the patch_level is reported as 0x00000000:

$ journalctl -k --grep=microcode
ago 26 08:49:50 archlinux kernel: Speculative Return Stack Overflow: IBPB-extending microcode not applied!
ago 26 08:49:50 archlinux kernel: Speculative Return Stack Overflow: Mitigation: safe RET, no microcode
ago 26 08:49:50 archlinux kernel: microcode: CPU1: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU0: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU2: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU4: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU5: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU6: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU3: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU7: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU8: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU9: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU10: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU11: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU12: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU13: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU14: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU15: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU16: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU18: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU17: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU21: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU20: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU23: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU22: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU24: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU25: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU26: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU27: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU28: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU19: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU29: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU30: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: CPU31: patch_level=0x00000000
ago 26 08:49:50 archlinux kernel: microcode: Microcode Update Driver: v2.2.

Is it because something went wrong when loading the microcode, or because there are not updates for my CPU model?

Pertinent info:

$ journalctl -b | grep smpboot
ago 26 08:49:50 archlinux kernel: smpboot: Allowing 32 CPUs, 0 hotplug CPUs
ago 26 08:49:50 archlinux kernel: smpboot: CPU0: AMD Ryzen 9 5950X 16-Core Processor (family: 0x19, model: 0x21, stepping: 0x2)
ago 26 08:49:50 archlinux kernel: smpboot: Max logical packages: 1
ago 26 08:49:50 archlinux kernel: smpboot: Total of 32 processors activated (217189.50 BogoMIPS)

Thanks for any help.

Offline

#2 2023-08-26 08:40:22

3beb6e7c46a615a
Member
Registered: 2021-03-27
Posts: 165

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

Did you include the microcode image in your UKI?

Offline

#3 2023-08-26 09:11:32

problembasedpers0n
Member
Registered: 2023-08-26
Posts: 6

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

lunaryorn wrote:

Did you include the microcode image in your UKI?

Thanks for replying. Yes, I did, within the mkinitcpio preset:

$ cat /etc/mkinitcpio.d/linux.preset
# mkinitcpio preset file for the 'linux' package

#ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
ALL_microcode=(/boot/*-ucode.img)

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
default_uki="/efi/EFI/Arch/arch-linux.efi"
default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
#fallback_uki="/efi/EFI/Linux/arch-linux-fallback.efi"
fallback_options="-S autodetect"
$ ls /boot/*-ucode.img
.rw-r--r-- 82k root  9 ago 22:33 /boot/amd-ucode.img

The mkinitcpio generation process lists the microcode as being included:

# mkinitcpio --preset linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -U /efi/EFI/Arch/arch-linux.efi -g /boot/initramfs-linux.img --splash /usr/share/systemd/bootctl/splash-arch.bmp --mic
rocode /boot/amd-ucode.img
==> Starting build: '6.4.12-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [systemd]
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [autodetect]
  -> Running build hook: [sd-vconsole]
  -> Running build hook: [numlock]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [sd-encrypt]
  -> Running build hook: [btrfs]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux.img'
==> Image generation successful
==> Creating unified kernel image: '/efi/EFI/Arch/arch-linux.efi'
  -> Using UEFI stub: '/usr/lib/systemd/boot/efi/linuxx64.efi.stub'
  -> Using os-release file: '/etc/os-release'
  -> Using cmdline file: '/etc/kernel/cmdline'
  -> Using splash image: '/usr/share/systemd/bootctl/splash-arch.bmp'
  -> Using kernel image: '/boot/vmlinuz-linux'
  -> Using microcode image: '/boot/amd-ucode.img'
==> Unified kernel image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect --microcode /boot/amd-ucode.img
==> Starting build: '6.4.12-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [systemd]
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [sd-vconsole]
  -> Running build hook: [numlock]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'wd719x'
  -> Running build hook: [sd-encrypt]
  -> Running build hook: [btrfs]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-fallback.img'
==> Image generation successful

Regards.

Offline

#4 2023-08-26 14:58:40

3beb6e7c46a615a
Member
Registered: 2021-03-27
Posts: 165

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

Did you have a different patch level at some time in the past, i.e. before you changed your UKI setup?  Try "journalctl --grep=microcode", i.e. omit the "-k" flag, which implies "-b", i.e. only the current boot.

Offline

#5 2023-08-27 10:18:26

problembasedpers0n
Member
Registered: 2023-08-26
Posts: 6

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

lunaryorn wrote:

Did you have a different patch level at some time in the past, i.e. before you changed your UKI setup?  Try "journalctl --grep=microcode", i.e. omit the "-k" flag, which implies "-b", i.e. only the current boot.

My logs rotated a couple of weeks ago, so first one is from 12th August. Patch level is the same:

ago 12 19:33:01 archlinux kernel: Speculative Return Stack Overflow: IBPB-extending microcode not applied!
ago 12 19:33:01 archlinux kernel: Speculative Return Stack Overflow: Mitigation: safe RET, no microcode
ago 12 19:33:01 archlinux kernel: microcode: CPU0: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU1: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU3: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU4: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU2: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU5: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU6: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU7: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU8: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU9: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU10: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU11: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU12: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU13: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU14: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU15: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU16: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU17: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU19: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU20: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU22: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU21: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU23: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU24: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU25: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU26: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU18: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU27: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU28: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU29: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU30: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: CPU31: patch_level=0x00000000
ago 12 19:33:01 archlinux kernel: microcode: Microcode Update Driver: v2.2.

Thanks again.

Offline

#6 2023-08-27 10:38:44

3beb6e7c46a615a
Member
Registered: 2021-03-27
Posts: 165

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

So presumably there's no microcode for your CPU?  Did you check whether your CPU family and model (per eg lscpu) do appear in the list of microcode patches (see https://git.kernel.org/pub/scm/linux/ke … ode/README, though I don't know whether that list is up to date, but it does refer to a script which lets you extract the list from the raw microcode binaries).

Offline

#7 2023-08-27 11:13:34

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,700
Website

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

I have the 5950X and this is what I see booting normally:

% dmesg|grep micro
[  +0.000003] Speculative Return Stack Overflow: IBPB-extending microcode not applied!
[  +0.000001] Speculative Return Stack Overflow: Mitigation: safe RET, no microcode
[  +0.002345] microcode: CPU7: patch_level=0x0a201025
[  +0.000001] microcode: CPU9: patch_level=0x0a201025
...

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2023-08-27 12:14:01

loqs
Member
Registered: 2014-03-06
Posts: 18,351

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

ago 26 08:49:50 archlinux kernel: smpboot: CPU0: AMD Ryzen 9 5950X 16-Core Processor (family: 0x19, model: 0x21, stepping: 0x2)

@graysky is the 5950X you have also stepping 2?

Online

#9 2023-08-27 13:07:53

problembasedpers0n
Member
Registered: 2023-08-26
Posts: 6

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

lunaryorn wrote:

So presumably there's no microcode for your CPU?  Did you check whether your CPU family and model (per eg lscpu) do appear in the list of microcode patches (see https://git.kernel.org/pub/scm/linux/ke … ode/README, though I don't know whether that list is up to date, but it does refer to a script which lets you extract the list from the raw microcode binaries).

I've used the linked script. Apparently, there's not microcode for my CPU:

$ python amd_ucode_info.py /lib/firmware/amd-ucode/microcode_amd_fam19h.bin
Microcode patches in /lib/firmware/amd-ucode/microcode_amd_fam19h.bin:
  Family=0x19 Model=0x11 Stepping=0x01: Patch=0x0a10113e Length=5568 bytes
  Family=0x19 Model=0x11 Stepping=0x02: Patch=0x0a10123e Length=5568 bytes
  Family=0x19 Model=0xa0 Stepping=0x02: Patch=0x0aa00212 Length=5568 bytes
  Family=0x19 Model=0x01 Stepping=0x01: Patch=0x0a0011d1 Length=5568 bytes
  Family=0x19 Model=0x01 Stepping=0x00: Patch=0x0a001079 Length=5568 bytes
  Family=0x19 Model=0x01 Stepping=0x02: Patch=0x0a001234 Length=5568 bytes
  Family=0x19 Model=0xa0 Stepping=0x01: Patch=0x0aa00116 Length=5568 bytes
ago 26 08:49:50 archlinux kernel: smpboot: CPU0: AMD Ryzen 9 5950X 16-Core Processor (family: 0x19, model: 0x21, stepping: 0x2)

Thanks again.

Offline

#10 2023-08-27 16:05:41

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,700
Website

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

No, didn't pay attention to stepping, for the record:

[  +0.108754] smpboot: CPU0: AMD Ryzen 9 5950X 16-Core Processor (family: 0x19, model: 0x21, stepping: 0x0)

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2023-08-28 10:34:35

problembasedpers0n
Member
Registered: 2023-08-26
Posts: 6

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

graysky wrote:

No, didn't pay attention to stepping, for the record:

[  +0.108754] smpboot: CPU0: AMD Ryzen 9 5950X 16-Core Processor (family: 0x19, model: 0x21, stepping: 0x0)

Are you using amd-ucode? Thanks

Offline

#12 2023-09-03 15:42:38

krzysztof1222
Member
Registered: 2023-09-03
Posts: 1

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

So if i have

$ journalctl -k --grep=microcode
Aug 30 17:54:09 45u5 kernel: Zenbleed: please update your microcode for the most optimal fix
Aug 30 17:54:09 45u5 kernel: microcode: CPU2: patch_level=0x08600106
... [ all cpu patch levels are the same ]
Aug 30 17:54:09 45u5 kernel: microcode: CPU14: patch_level=0x08600106
Aug 30 17:54:09 45u5 kernel: microcode: Microcode Update Driver: v2.2.
$ journalctl -b | grep smpboot
CPU0: AMD Ryzen 7 4800H with Radeon Graphics (family: 0x17, model: 0x60, stepping: 0x1)

And this specific model is not present on https://git.kernel.org/pub/scm/linux/ke … ode/README or in the ./amd_ucode_info.py script's output

do you know how could i update my µcode in such situation ?

im using UKI + sbctl too but that seams irrelevant in this situation

Last edited by krzysztof1222 (2023-09-03 15:45:47)

Offline

#13 2023-09-03 16:12:44

loqs
Member
Registered: 2014-03-06
Posts: 18,351

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

Online

#14 2023-09-03 19:17:30

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,700
Website

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

problembasedpers0n wrote:

Are you using amd-ucode? Thanks

Yes.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#15 2023-09-06 16:58:31

problembasedpers0n
Member
Registered: 2023-08-26
Posts: 6

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

This fixed my issue. Had to update motherboard BIOS:

[    0.298489] Speculative Return Stack Overflow: IBPB-extending microcode not applied!
[    0.298490] Speculative Return Stack Overflow: Mitigation: safe RET, no microcode
[    0.716383] microcode: CPU0: patch_level=0x0a20120a
[    0.716384] microcode: CPU1: patch_level=0x0a20120a
[    0.716385] microcode: CPU3: patch_level=0x0a20120a
[    0.716386] microcode: CPU4: patch_level=0x0a20120a
[    0.716387] microcode: CPU5: patch_level=0x0a20120a
[    0.716387] microcode: CPU6: patch_level=0x0a20120a
[    0.716388] microcode: CPU7: patch_level=0x0a20120a
[    0.716390] microcode: CPU8: patch_level=0x0a20120a
[    0.716390] microcode: CPU9: patch_level=0x0a20120a
[    0.716391] microcode: CPU10: patch_level=0x0a20120a
[    0.716392] microcode: CPU11: patch_level=0x0a20120a
[    0.716393] microcode: CPU12: patch_level=0x0a20120a
[    0.716394] microcode: CPU13: patch_level=0x0a20120a
[    0.716395] microcode: CPU14: patch_level=0x0a20120a
[    0.716396] microcode: CPU15: patch_level=0x0a20120a
[    0.716396] microcode: CPU16: patch_level=0x0a20120a
[    0.716397] microcode: CPU17: patch_level=0x0a20120a
[    0.716398] microcode: CPU19: patch_level=0x0a20120a
[    0.716398] microcode: CPU18: patch_level=0x0a20120a
[    0.716399] microcode: CPU20: patch_level=0x0a20120a
[    0.716400] microcode: CPU21: patch_level=0x0a20120a
[    0.716401] microcode: CPU22: patch_level=0x0a20120a
[    0.716402] microcode: CPU23: patch_level=0x0a20120a
[    0.716404] microcode: CPU24: patch_level=0x0a20120a
[    0.716404] microcode: CPU25: patch_level=0x0a20120a
[    0.716405] microcode: CPU26: patch_level=0x0a20120a
[    0.716407] microcode: CPU27: patch_level=0x0a20120a
[    0.716408] microcode: CPU2: patch_level=0x0a20120a
[    0.716408] microcode: CPU28: patch_level=0x0a20120a
[    0.716409] microcode: CPU29: patch_level=0x0a20120a
[    0.716410] microcode: CPU31: patch_level=0x0a20120a
[    0.716409] microcode: CPU30: patch_level=0x0a20120a
[    0.716448] microcode: Microcode Update Driver: v2.2.

Thanks, everyone.

Offline

#16 2023-09-18 19:40:24

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 686

Re: Loading microcode with AMD Ryzen 9 5950X: patch_level=0x00000000

This is how I updated the Inception firmware on my 5950X: https://bbs.archlinux.org/viewtopic.php … 7#p2121607


Excuse my poor English.

Offline

Board footer

Powered by FluxBB