Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Early microcode + initamfs issues
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Wed Dec 07, 2016 3:41 pm    Post subject: [solved] Early microcode + initamfs issues Reply with quote

Hey folks,

I discovered early microcode loading last night and I want to get this working on my systems. Unfortunately I require an initramfs to load filesystem modules and run cryptsetup to decrypt multiple disks to mount rootfs. How can this be accomplished in tandem with early_ucode.cpio ?

At this point, everything I have tried leads to a kernel panic that says it can not mount root without the initramfs.

Here is my working Grub entry:
Quote:
title Gentoo Linux 64-bit (4.8.12)
root (hd0,0)
kernel /kernel-genkernel-x86_64-4.8.12-gentoo root=/dev/ram0 init=/linuxrc crypt_root=/dev/sda2 real_rootflags=ssd,acl,compress=lzo,noatime,subvol=@rootfs video=vesafb:ywrap,mtrr:3 vga=794
initrd /initramfs-genkernel-x86_64-4.8.12-gentoo


Also, I use this kernel/initramfs on multiple hosts with various CPUs, including VMs. I see there's an option to include firmware blobs in the kernel. Is it possible to use that method and include multiple blobs, and it will select the appropriate one?
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)


Last edited by BlueFusion on Thu Jan 12, 2017 2:34 am; edited 1 time in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Wed Dec 07, 2016 3:51 pm    Post subject: Reply with quote

Have-you try to add the full path of your early_ucode.cpio file with a space at the end of
Code:
initrd /initramfs-genkernel-x86_64-4.8.12-gentoo /early_ucode.cpio

or maybe better
Code:
initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.8.12-gentoo

You use Grub1. With Grub2 you can have several initramfs files in the same entry and the same line. All the initramfs contain that the kernel use must not conflicts with each others, no cpio files and directories lists conflicts.
_________________
Paul
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Wed Dec 07, 2016 4:48 pm    Post subject: Reply with quote

I did already try using multiple entries in the initrd line to no avail. It made no difference, unfortunately.

I did discover at the bottom on this Wiki entry that the microcode blobs can be added to the kernel. I did that, built the kernel, and booted it, however it did not update the microcode on boot.

Code:
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="intel-ucode/06-0f-06 intel-ucode/06-5e-03"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
# Altera FPGA firmware download module
# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_FIRMWARE_EDID=y
# Firmware Drivers
CONFIG_FIRMWARE_MEMMAP=y
# CONFIG_GOOGLE_FIRMWARE is not set
# CONFIG_TEST_FIRMWARE is not set
CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y

_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Wed Dec 07, 2016 6:04 pm    Post subject: Reply with quote

What output dmesg give to you about microcode? This is what I have with Gentoo-sources-4.4.26 and an Intel processor:
Code:
dmesg|grep -i microcode
[    0.000000] microcode: CPU0 microcode updated early to revision 0xa0b, date = 2010-09-28
[    0.002000] microcode: CPU1 microcode updated early to revision 0xa0b, date = 2010-09-28
[    1.756180] microcode: CPU0 sig=0x1067a, pf=0x1, revision=0xa0b
[    1.756188] microcode: CPU1 sig=0x1067a, pf=0x1, revision=0xa0b
[    1.756233] microcode: Microcode Update Driver: v2.01 <tigran@aivazian.fsnet.co.uk>, Peter Oruba

_________________
Paul
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Thu Dec 08, 2016 2:00 am    Post subject: Reply with quote

I finally got a chance to play with this further today on my laptop this time. It seems to work!

Quote:
rich@zenith ~ $ dmesg
[ 0.000000] microcode: microcode updated early to revision 0x1f, date = 2016-04-01
[ 0.000000] Linux version 4.8.12-gentoo (root@zenith) (gcc version 4.9.3 (Gentoo 4.9.3 p1.5, pie-0.6.4) ) #1 SMP Wed Dec 7 20:32:15 EST 2016
[ 0.000000] Command line: root=/dev/ram0 init=/linuxrc crypt_root=/dev/sda3 log_buf_len=2M


This was performed with simply including the microcode into the kernel as extra firmware. I included 3 separate microcode files, one for each of the 3 different CPUs I have in use among my computers that share the same kernel.

Quote:
rich@zenith /etc/kernels $ grep -i firmware kernel-config-x86_64-4.8.12-gentoo
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="intel-ucode/06-0f-06 intel-ucode/06-5e-03 intel-ucode/06-45-01"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"


And FWIW, the Wikipedia article I mentioned above says this seems to be a fairly new feature, likely starting with 4.8 kernel.

I'll report back when I get home again and test this kernel on my two desktops.
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum