LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How To: Early-loading of Intel Microcode (https://www.linuxquestions.org/questions/slackware-14/how-to-early-loading-of-intel-microcode-4175712810/)

BernieK 05-30-2022 09:25 PM

How To: Early-loading of Intel Microcode
 
After slogging thru Linux forums and Wiki-pages, and Intel's website, I pieced together a process for obtaining and installing (for early-loading) appropriate Intel microcode for the processor on my Slackare Linux box.

So I do not have to worry about forgetting the process I "wrote" it down. The process - which can be mostly-completed by copying-n-pasting example shell commands in the document - is available at:

https://www.bernieland.com/share/how...y_loading.html

enorbet 06-01-2022 11:02 AM

Thank you BernieK. I hadn't updated in a long time and the reminder was appreciated. I never use initrd so I had to dig a bit deeper to first recall lilo.conf entry (for older installs) and then adapt to rEFInd (for newer). This was just to confirm it loaded the newest but apparently once the /boot/intel-ucode.cpio directory and the /lib/firmware/ has an entry, it apparently just loads, maybe not as early as other methods, but sufficient for my requirements.

zeebra 06-01-2022 01:39 PM

Quote:

Originally Posted by BernieK (Post 6357660)
After slogging thru Linux forums and Wiki-pages, and Intel's website, I pieced together a process for obtaining and installing (for early-loading) appropriate Intel microcode for the processor on my Slackare Linux box.

So I do not have to worry about forgetting the process I "wrote" it down. The process - which can be mostly-completed by copying-n-pasting example shell commands in the document - is available at:

https://www.bernieland.com/share/how...y_loading.html

Howdy, that's great. I was actually doing something similar (but without initrd).. And I was documenting the process. I have't yet gotten around to do the initrd version, hah.

Ehm.. Is there any chance you could add the information to docs.slackware?

I made this article there:
https://docs.slackware.com/howtos:se...rocode_loading

And there is still a rather empty initrd section. I didn't yet get around to it, but at some point I will for sure. Or perhaps you could help me get it done?

BernieK 06-01-2022 06:52 PM

Quote:

Originally Posted by zeebra (Post 6358005)
Is there any chance you could add the information to docs.slackware?

Any Slackware Documentation project contributor is welcome to include on the project's pages the microcode-loading document I wrote - in whole or in part, or by reference (as you kindly did).


Thank you for writing the microcode-loading page for the Slackware Documentation Project at docs.slackware.com

Good news regarding the reference on that page to manually creating the /lib/firmware/amd-ucode/ directory; As of Slackware 15.0 that directory is created and populated during Slackware installation and subsequent kernel-firmware package updates.

Code:

$ cat /etc/slackware-version
Slackware 15.0

$  grep -e "lib/firmware/amd-ucode/$" -e "lib/firmware/intel-ucode/$" /var/adm/packages/kernel-firmware-20220124_eb8ea1b-noarch-1
lib/firmware/amd-ucode/


zeebra 06-02-2022 03:53 AM

Quote:

Originally Posted by BernieK (Post 6358091)
Any Slackware Documentation project contributor is welcome to include on the project's pages the microcode-loading document I wrote - in whole or in part, or by reference (as you kindly did).

Thank you. I'll include it as soon as I can and credit you for it. Meanwhile I will leave the reference there :)

Quote:

Originally Posted by BernieK (Post 6358091)
Good news regarding the reference on that page to manually creating the /lib/firmware/amd-ucode/ directory; As of Slackware 15.0 that directory is created and populated during Slackware installation and subsequent kernel-firmware package updates.

hmm. you sure?

I added that section because I didn't have those folders in the standard Slackware 15 installation :scratch:

BernieK 06-02-2022 11:11 AM

Quote:

Originally Posted by zeebra (Post 6358163)
hmm. you sure? I added that section because I didn't have those folders in the standard Slackware 15 installation :scratch:

Thank you for double-checking.
I am sure with respect to the full Slackware 15.0 installations on one each of my AMD and Intel boxes. The kernel.org GIT repository suggests so as well since it includes a populated amd-ucode directory (but no intel-ucode directory):

Code:

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
I cannot say when the amd-ucode directory was added to the source tree, but it is present on my Slackware 14.2 box (also a full installation).

kjhambrick 06-02-2022 02:29 PM

All --

Just to add a me too ... there is an amd-ucode/ directory in the official Slackware64 15.0 a/kernel-firmware-20220124_eb8ea1b-noarch-1.txz Package ...

HTH

-- kjh

Code:

# pwd
/dld/15.0/slackware/slackware-15.0-64/slackware64/a    # my local Slackware 65 15.0 repo

# tar -tvf kernel-firmware-20220124_eb8ea1b-noarch-1.txz |grep /amd-ucode/

drwxr-xr-x root/root        0 2022-01-24 23:03 lib/firmware/amd-ucode/
-rw-r--r-- root/root    12684 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd.bin
-rw-r--r-- root/root      490 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd.bin.asc
-rw-r--r-- root/root      7876 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam15h.bin
-rw-r--r-- root/root      473 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam15h.bin.asc
-rw-r--r-- root/root      3510 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam16h.bin
-rw-r--r-- root/root      473 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam16h.bin.asc
-rw-r--r-- root/root      6476 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam17h.bin
-rw-r--r-- root/root      488 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam17h.bin.asc
-rw-r--r-- root/root    16804 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam19h.bin
-rw-r--r-- root/root      488 2022-01-24 23:03 lib/firmware/amd-ucode/microcode_amd_fam19h.bin.asc


brianL 06-03-2022 08:31 AM

There is another method, mentioned in a previous thread (I haven't searched for it, but I made notes at the time):
Install iucode_tool & intel-microcode from SBo.
Then (as root,of course) check your present microcode:
Code:

dmesg -t | grep 'microcode'
Then run:
Code:

iucode_tool -S -l /tmp/SBo/intel-microcode-20220510/intel-ucode/*
To see if it's been updated.
Then (this is assuming you already have a /boot/initrd.gz):
Code:

cp /boot/initrd.gz /tmp/
Then:
Code:

cat /boot/intel-ucode.cpio /tmp/initrd.gz > /boot/initrd.gz
Run lilo (or whatever), reboot and check dmesg again.
Thanks to whoever I got this information from. :hattip:

zeebra 06-03-2022 09:06 AM

Iucode tool is not available in Slackware by default. But ok, interesting enough.

brianL 06-03-2022 09:35 AM

Quote:

Originally Posted by brianL (Post 6358409)
Install iucode_tool & intel-microcode from SBo.

https://slackbuilds.org/repository/1...m/iucode_tool/

https://slackbuilds.org/repository/1...tel-microcode/

zeebra 06-03-2022 09:50 AM

That's fine as a side note. But best practices when recommending someone do something, is to get things done with the default tools in Slackware, if possible. If not, then..

brianL 06-03-2022 10:27 AM

TIMTOWTDI as somebody said.

zeebra 06-03-2022 10:40 AM

Quote:

Originally Posted by brianL (Post 6358430)
TIMTOWTDI as somebody said.

KISS :hattip:

slackmensch 06-07-2022 09:06 AM

For those using alternative bootloaders or just too lazy to muck about with initrds, there isn't much to do. You can load intel microcode "late":

echo 1 > /sys/devices/system/cpu/microcode/reload

as described in section 22.2 here:

https://www.kernel.org/doc/html/late...microcode.html

Of course intel-microcode from slackbuilds has to be installed. Why isn't intel microcode included in the binary blob monster package called kernel-firmware? It's got blobs for 20-year-old USB tv tuners in there but not Intel's latest CPU updates?!

Edit: Sorry, I didn't see that it said "Early" in the subject line. Maybe my head needs a micorcode update.

zeebra 06-07-2022 03:59 PM

Quote:

Originally Posted by slackmensch (Post 6359267)
For those using alternative bootloaders or just too lazy to muck about with initrds, there isn't much to do. You can load intel microcode "late":

It is certainly possible, but it doesn't always/often "help" mitigate anything. From my reading, this method is mostly useful for servers that want to test the load without rebooting. But I could be wrong, it could also not just load, but also mitigate issues in some setups/situations.


All times are GMT -5. The time now is 07:53 AM.