Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]intel early microcode with iucode_tool-1.5
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
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1390

PostPosted: Wed Nov 18, 2015 10:44 pm    Post subject: [solved]intel early microcode with iucode_tool-1.5 Reply with quote

Seeing Debian updates the iucode_tool I made a version bump bug entry
because I saw different outcomes of {gentoo,debian}/lib/firmware/intel-ucode

I didn't not believe any thing any more
and downloaded original Intel microcode
But it is identical with sys-apps/microcode-data-20151106
per sha256sum.

I searched a way without using intermediates of /lib/firmware/intel-ucode. A very short HowTo:
To get an early microcode initrd image I just did with my new iucode_tool-1.5
Code:
/usr/sbin/iucode_tool -v -td --scan-system --list --write-earlyfw=/boot/efi/core2fw.img \
  --strict-checks  /lib/firmware/microcode.dat
which I then can prepend to any other initrd by just writing before the main initrd the line "initrd=/core2fw.img". This image placed at "/" despite efi is mounted /boot/efi, because I use an efi system with my kernels directly on that vFat 200Mbyte efi partition. There is a way to "cat" the two of the initrds together, but having both of them works best, if you sometime want to boot without the main initrd.

Logs then show
Nov 18 00:22:43 maci kernel: microcode: CPU0 sig=0x1067a, pf=0x80, revision=0xa0b
Nov 18 00:22:43 maci kernel: microcode: CPU1 sig=0x1067a, pf=0x80, revision=0xa0b
as before with microcode of a year ago. Without this early microcode I get revision=0xa07
of the original Bios.

What I do not understand is the output of the iucode_tool of the microcodes selected:
001: sig 0x0001067a, pf mask 0xa0, 2010-09-28, rev 0x0a0b, size 8192
002: sig 0x0001067a, pf mask 0x11, 2010-09-28, rev 0x0a0b, size 8192
003: sig 0x0001067a, pf mask 0x44, 2010-09-28, rev 0x0a0b, size 8192
which show different pf masks than the "pf=0x80" of my Log ?

My 2cents critics:
When I inspect sys-apps/microcode-data--2015110.ebuild
I can see an extra tool: files/intel-microcode2ucode.c
which is used to split the microcode.dat. I don't think this is nice and beautiful to have, because this should be done by the iucode_tool? And microcode-data should be in sys-kernel category like the other firmware ebuild, I think ...
_________________
the thread ain't easily find an end
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Thu Nov 19, 2015 4:35 am    Post subject: Reply with quote

For my Intel Core i7 I just needed to do the following to get the microcode updated at every boot:

I made sure the kernel is set up as follows:

Code:
# grep CONFIG_BLK_DEV_INITRD /usr/src/linux/.config
CONFIG_BLK_DEV_INITRD=y
# grep CONFIG_MICROCODE /usr/src/linux/.config
CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_MICROCODE_INTEL_EARLY=y
# CONFIG_MICROCODE_AMD_EARLY is not set
CONFIG_MICROCODE_EARLY=y
# grep CONFIG_INITRAMFS_SOURCE /usr/src/linux/.config
CONFIG_INITRAMFS_SOURCE=""


Then I set the initramfs USE flag and unmasked the ~amd64 ebuilds microcode-ctl, microcode-data and iucode_tool:

Code:
# cat /etc/portage/package.use/microcode-data
sys-apps/microcode-data initramfs
# cat /etc/portage/package.accept_keywords/microcode-data
sys-apps/microcode-data ~amd64
sys-apps/iucode_tool ~amd64
# cat /etc/portage/package.accept_keywords/microcode-ctl
sys-apps/microcode-ctl ~amd64


Then I merged the packages:

Code:
# emerge --ask microcode-ctl microcode-data


Then I copied to the boot directory the cpio file created when I merged the packages:

Code:
# cp /lib/firmware/microcode.cpio /boot/


Then I added an initrd line to /boot/grub/grub.cfg as shown below:

Code:
# grep -B 15 -A 1 initrd /boot/grub/grub.cfg

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-525a90f1-8ad2-44a3-ade3-20f18a0a9595' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  f6ffc085-66fe-4bbe-b080-cec355749f85
        else
          search --no-floppy --fs-uuid --set=root f6ffc085-66fe-4bbe-b080-cec355749f85
        fi
        echo    'Loading Linux 3.18.11-gentoo ...'
        linux   /vmlinuz-3.18.11-gentoo root=/dev/sda5 ro  drm_kms_helper.edid_firmware=edid/1920x1080_Clevo_W230SS.bin i915.modeset=1 rcutree.rcu_idle_gp_delay=1
        initrd /microcode.cpio
}


Works correctly:

Code:
$ dmesg | grep microcode
[    0.000000] CPU0 microcode updated early to revision 0x1e, date = 2015-08-13
[    0.048340] CPU1 microcode updated early to revision 0x1e, date = 2015-08-13
[    0.063442] CPU2 microcode updated early to revision 0x1e, date = 2015-08-13
[    0.078471] CPU3 microcode updated early to revision 0x1e, date = 2015-08-13
[    0.267442] microcode: CPU0 sig=0x306c3, pf=0x10, revision=0x1e
[    0.267540] microcode: CPU1 sig=0x306c3, pf=0x10, revision=0x1e
[    0.267640] microcode: CPU2 sig=0x306c3, pf=0x10, revision=0x1e
[    0.267738] microcode: CPU3 sig=0x306c3, pf=0x10, revision=0x1e
[    0.267838] microcode: CPU4 sig=0x306c3, pf=0x10, revision=0x1e
[    0.267935] microcode: CPU5 sig=0x306c3, pf=0x10, revision=0x1e
[    0.268053] microcode: CPU6 sig=0x306c3, pf=0x10, revision=0x1e
[    0.268150] microcode: CPU7 sig=0x306c3, pf=0x10, revision=0x1e
[    0.268265] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba

_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
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