LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-13-2020, 10:57 AM   #1
obobskivich
Member
 
Registered: Jun 2020
Distribution: Xubuntu / Slackware
Posts: 68

Rep: Reputation: Disabled
AMD microcode/ucode update for Slackware 14.2?


Just a curiosity - I am wondering if there is a way to update AMD CPU ucode in 14.2 - I see on slackbuilds that the Intel ucode is available (iucode-tool), but I have not found amd64-ucode like other distros (e.g. Ubuntu, Arch). Is there something that exists like this for Slackware?
 
Old 07-13-2020, 11:51 AM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 7,240

Rep: Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932
AMD microcode updates are included with the kernel-firmware package. However, I've heard that even though the kernel is supposed to load those automatically on boot, that it hasn't been.

Another way to update your microcode is by updating your BIOS/UEFI, if there's supported updates for your motherboard.
 
Old 07-13-2020, 12:11 PM   #3
obobskivich
Member
 
Registered: Jun 2020
Distribution: Xubuntu / Slackware
Posts: 68

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
AMD microcode updates are included with the kernel-firmware package. However, I've heard that even though the kernel is supposed to load those automatically on boot, that it hasn't been.

Another way to update your microcode is by updating your BIOS/UEFI, if there's supported updates for your motherboard.

I had read about kernel-firmware providing that, and I've got the latest updates via slackpkg (as of a few days ago) for 14.2, but know its a bit 'behind' where -current or other distros are in terms of kernel revision, so figured maybe that was part of it. According to what I've polled off of the CPU, it has a recent but not latest firmware, which is also what led me to this reasoning.

Motherboard updates ended a long time ago (like most motherboards older than 3 months ha!) - it's had the latest BIOS installed for years, but that's not in-line with the latest updates from AMD.

Ah well, it's not like it is having any problems and it does have a recent-ish firmware (if I'm not mistaken, its not *that* far behind the latest, which leads me to believe 14.2 *is* updating it over the motherboard, just not 'enough' because it doesn't have the latest package (yet?)).
 
Old 07-13-2020, 01:24 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 7,240

Rep: Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932
Have you checked your dmesg to see what microcode is being loaded (and compare that with what is the latest for your CPU)? According to Gentoo's wiki on Ryzens, my Ryzen 7 has the latest microcode already provided (via my UEFI).

Code:
dmesg | grep microcode
The kernel-firmware package on 14.2 isn't old at all. It was actually just updated last month.

Code:
+--------------------------+
Fri Jun 12 19:05:51 UTC 2020
patches/packages/kernel-firmware-20200610_887d2a1-noarch-1.txz:  Upgraded.
If there is a newer microcode available in that kernel-firmware package that you're not running, you could try and load it via running the following as root:

Code:
echo 1 > /sys/devices/system/cpu/microcode/reload
Once run, you could then check dmesg output to see if your microcode was updated. If it wasn't updated, then you'd likely need to look into loading it early via adding it to your initrd.
 
Old 07-13-2020, 01:54 PM   #5
obobskivich
Member
 
Registered: Jun 2020
Distribution: Xubuntu / Slackware
Posts: 68

Original Poster
Rep: Reputation: Disabled
Yes I did check dmesg and cpuinfo - it was a revision or two behind (just based on the version #s) according to the latest I'm aware of (via spectre-meltdown-checker, which also nicely checks microcode updates for us). Is there a way to check what specific package is being distributed within the kernel-firmware package (as in, what is it 'supposed to be' doing)? (the release notes don't seem to have more information than what you copy/pasted that I could find)
 
Old 07-13-2020, 03:16 PM   #6
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,714

Rep: Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060
If you use an initrd, you can use that to load the new firmware at boot.

EDIT: I only have AMD CPUs on my laptops/desktops. (My wife has an Intel laptop, but I don't hold that against her.)

I think I've posted this somewhere else, but another version isn't horrible.

Note that my swap lives on an lvm logical volume and this is from a laptop where I do encrypt my lvm physical volume(s).

Code:
bash-5.0$ cat mkinitrd.conf
# mkinitrd.conf.sample
# See "man mkinitrd.conf" for details on the syntax of this file
#
#SOURCE_TREE="/boot/initrd-tree"
#CLEAR_TREE="0"
#OUTPUT_IMAGE="/boot/initrd.gz"
#KERNEL_VERSION="$(uname -r)"
#KEYMAP="us"
#MODULE_LIST="ext4"
LUKSDEV="/dev/sda2"
#LUKSKEY="LABEL=TRAVELSTICK:/keys/alienbob.luks"
#ROOTDEV="/dev/sda1"
#ROOTFS="ext3"
RESUMEDEV="/dev/lvg/swaplv"
#RAID="0"
#LVM="0"
#UDEV="1"
#MODCONF="0"
#WAIT="1"
MICROCODE_ARCH="/boot/amd-ucode.cpio"
Note the MICROCODE_ARCH property.

Code:
root@sonicmaster:~# cat bin/make-amd-ucode-cpio.sh 
#! /bin/sh
set -x
set -e

LIB=/lib/firmware/amd-ucode/
TDIR=kernel/x86/microcode
CPIO=/boot/amd-ucode.cpio

echo "Create the $CPIO file from the $LIB directory of files"
rm -rf   /tmp/amd-ucode-cpio
mkdir -p /tmp/amd-ucode-cpio
cd       /tmp/amd-ucode-cpio
mkdir -p  $TDIR
find $LIB -type f -name \*bin | sort | xargs cat > $TDIR/AuthenticAMD.bin
find . | cpio --no-absolute-filenames -H newc -o -F $CPIO

exit
Code:
root@sonicmaster:~# cat bin/mkinit.sh
#!/bin/bash
# expects that mkinitrd.conf is set to build firmware as well
kv=$(readlink /boot/vmlinuz-generic | cut -d- -f3-)
~/bin/make-amd-ucode-cpio.sh
# make sure any RAID arrays are defined prior to creating initrd 
/sbin/mdadm -E -s > /etc/mdadm.conf
$( /usr/share/mkinitrd/mkinitrd_command_generator.sh -k ${kv} -a "-F -o /boot/initrd-${kv}.gz" -r )
~/bin/mkgrub.sh
root@sonicmaster:~#
I use grub. You may not want to.

Code:
root@sonicmaster:~# cat bin/mkgrub.sh 
#!/bin/bash
/usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg
root@sonicmaster:~#
And there's my grub addition at https://github.com/Richard-Cranium/SlackwareGrub2 that you might want if you do use grub.

Last edited by Richard Cranium; 07-14-2020 at 03:18 AM.
 
2 members found this post helpful.
Old 07-13-2020, 04:47 PM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 7,240

Rep: Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932
Quote:
Originally Posted by obobskivich View Post
Is there a way to check what specific package is being distributed within the kernel-firmware package (as in, what is it 'supposed to be' doing)? (the release notes don't seem to have more information than what you copy/pasted that I could find)
Best thing I know is to check the git logs for the amd-ucode folder in the kernel-firmware git repo. This is the repo Pat uses to build newer versions of the kernel-firmware package.

https://git.kernel.org/pub/scm/linux.../log/amd-ucode

But it doesn't really show much. I'm not sure if there's a place to get more detailed information.
 
Old 07-15-2020, 04:21 PM   #8
PROBLEMCHYLD
Member
 
Registered: Apr 2015
Posts: 992

Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
Code:
root@sonicmaster:~# cat bin/make-amd-ucode-cpio.sh 
#! /bin/sh
set -x
set -e

LIB=/lib/firmware/amd-ucode/
TDIR=kernel/x86/microcode
CPIO=/boot/amd-ucode.cpio

echo "Create the $CPIO file from the $LIB directory of files"
rm -rf   /tmp/amd-ucode-cpio
mkdir -p /tmp/amd-ucode-cpio
cd       /tmp/amd-ucode-cpio
mkdir -p  $TDIR
find $LIB -type f -name \*bin | sort | xargs cat > $TDIR/AuthenticAMD.bin
find . | cpio --no-absolute-filenames -H newc -o -F $CPIO

exit
Thanks for the script

Jul 15 15:59:52 darkstar kernel: [ 4.356400] microcode: CPU0: patch_level=0x07030105
Jul 15 15:59:52 darkstar kernel: [ 4.357769] microcode: CPU1: patch_level=0x07030105
Jul 15 15:59:52 darkstar kernel: [ 4.359207] microcode: CPU2: patch_level=0x07030105
Jul 15 15:59:52 darkstar kernel: [ 4.360576] microcode: CPU3: patch_level=0x07030105
Jul 15 15:59:52 darkstar kernel: [ 4.361927] microcode: Microcode Update Driver: v2.2.
 
Old 07-15-2020, 07:09 PM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,714

Rep: Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060Reputation: 2060
To be honest, I'm positive that someone else posted the original in this forum sometime in the past.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Canonical Releases AMD Microcode Update for All Ubuntu Users to Fix Spectre V2 LXer Syndicated Linux News 0 06-24-2018 05:09 AM
Apply new Intel microcode- no microcode.dat file Naks110 Linux - Kernel 2 06-12-2018 05:20 PM
[SOLVED] Linux-4.8-rc2 fails reading AMD microcode, /boot/amd-ucode.cpio aaazen Linux - Kernel 1 08-22-2016 08:33 AM
OpenSuse 12.2. Error failed to load file amd-ucode/microcode_amd.bin Felipe Linux - Software 1 04-10-2013 07:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration