Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301667 - sys-fs/udev-150 breaks sys-apps/microcode-ctl
Summary: sys-fs/udev-150 breaks sys-apps/microcode-ctl
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-20 20:27 UTC by Nikos Chantziaras
Modified: 2010-02-01 20:54 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info,4.11 KB, text/plain)
2010-01-20 20:33 UTC, Nikos Chantziaras
Details
udev-151-missing-firmware.diff (udev-151-missing-firmware.diff,1.04 KB, patch)
2010-02-01 02:23 UTC, Boney McCracker
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2010-01-20 20:27:35 UTC
I updated udev from 149 to 150.  This made microcode-ctl (I have it in the default runlevel) need a ridiculous amount of time (several minutes instead of under 1 second) to load the CPU's microcode, stopping the boot process for several minutes.

Downgrading to udev-149 again fixes the problem.
Comment 1 Nikos Chantziaras 2010-01-20 20:33:01 UTC
Created attachment 217005 [details]
emerge --info
Comment 2 Maxime G. 2010-01-21 03:04:37 UTC
Same here, "modprobe microcode" take several time.
microcode-ctl executable run normally after module loading, so is module loading problem

My emerge --info :
Portage 2.2_rc61 (default/linux/amd64/10.0/desktop, gcc-4.4.2, glibc-2.11-r1, 2.6.32-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 21 Jan 2010 01:30:01 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4, 3.1.1-r1
dev-python/pycrypto: 2.1.0
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ABI="amd64"
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
ACCEPT_PROPERTIES="*"
ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci"
ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol"
ANT_HOME="/usr/share/ant"
APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
ARCH="amd64"
ASFLAGS_x86="--32"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CDEFINE_amd64="__x86_64__"
CDEFINE_x86="__i386__"
CFLAGS="-O2 -march=native -msse4.1 -msse4.2 -pipe"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLISION_IGNORE="/lib/modules"
COLORTERM="gnome-terminal"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CVS_RSH="ssh"
CXXFLAGS="-O2 -pipe"
DEFAULT_ABI="amd64"
DISPLAY=":0.0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/usr/bin/vi"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--verbose --with-bdeps=y"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
GCC_SPECS=""
GDK_USE_XFT="1"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/"
GTK_IM_MODULE="uim"
HISTFILE="/home/maxime/.history"
HISTSIZE="1000"
HOME="/home/maxime"
INFOPATH="/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.20/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/info"
INPUT_DEVICES="evdev"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVACC_HOME="/usr/share/javacc/"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KERNEL="linux"
LANG="fr_FR.utf8"
LANGUAGE="fr"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LC_COLLATE="ja_JP.utf8"
LDFLAGS="-Wl,--hash-style=both"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSCHARSET="utf-8"
LESSOPEN="|lesspipe.sh %s"
LIBDIR_amd64="lib64"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LINGUAS="fr ja"
LOGNAME="root"
MAKEOPTS="-j9"
MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.20/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/man:/etc/java-config/system-vm/man/"
MULTILIB_ABIS="amd64 x86"
MULTILIB_STRICT_DENY="64-bit.*shared object"
MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage)"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
OLDPWD="/home/maxime"
OPENGL_PROFILE="nvidia"
PAGER="/usr/bin/less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.2"
PKGDIR="/usr/portage/packages"
PORTAGE_ARCHLIST="ppc x86-openbsd ppc-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris mips-irix m68k sh x86-solaris sparc-fbsd"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_BIN_PATH="/usr/lib64/portage/bin"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_MAILFROM="portage@neurone-network.org"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="echo mail"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_NICENESS="15"
PORTAGE_PYM_PATH="/usr/lib64/portage/pym"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_RSYNC_RETRIES="3"
PORTAGE_TMPDIR="/var/tmp"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/xwing /usr/local/portage/layman/desktop-effects /usr/local/portage/local"
PRELINK_PATH_MASK="/usr/lib64/klibc"
PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"
PWD="/home/maxime"
QT_IM_MODULE="uim"
RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
ROOT="/"
ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.2"
RPMDIR="/usr/portage/rpm"
RUBYOPT="-rauto_gem"
RUBY_TARGETS="ruby18"
SANE_BACKENDS="plustek"
SANE_CONFIG_DIR="/etc/sane.d"
SAVEHIST="1000"
SHELL="/bin/zsh"
SHLVL="1"
STAGE1_USE="multilib nptl nptlonly unicode"
SUDO_COMMAND="/bin/zsh"
SUDO_GID="1000"
SUDO_UID="1000"
SUDO_USER="maxime"
SYMLINK_LIB="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
TERM="xterm"
TEXINPUTS="~/.latex/packages//:"
USB_DEVFS_PATH="/dev/bus/usb"
USE="amd64 multilib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr ja" RUBY_TARGETS="ruby18" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="nvidia" 
USER="root"
USERLAND="GNU"
USERNAME="root"
USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CAMERAS CROSSCOMPILE_OPTS DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS"
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"
VIDEO_CARDS="nvidia"
VISUAL="/usr/bin/vi"
XAUTHORITY="/home/maxime/.Xauthority"
XDG_CONFIG_DIRS="/etc/xdg"
XDG_DATA_DIRS="/usr/local/share:/usr/share:/usr/share/gdm"
XMODIFIERS="@im=uim"
_="/usr/bin/emerge"
Comment 3 Boney McCracker 2010-01-27 13:00:08 UTC
(In reply to comment #0)
> I updated udev from 149 to 150.  This made microcode-ctl (I have it in the
> default runlevel) need a ridiculous amount of time (several minutes instead of
> under 1 second) to load the CPU's microcode, stopping the boot process for
> several minutes.
> 
> Downgrading to udev-149 again fixes the problem.
> 

Same thing on ~x86.  The modprobe of the microcode module is what is taking too much time.  Verified this manually.  Downgrade of udev from 150 to 149 fixes the problem.
Comment 4 Ewgenij Starostin 2010-01-28 18:31:53 UTC
Same issue here. As a temporary hack-around,
  cd /lib/firmware ; mkdir intel-ucode ; cd intel-ucode ; ln -s /lib/microcode.dat 06-0f-02
removes the delay. The diff between releases 149 and 150 of udev shows a relatively large change of the code that handles firmware, though I haven’t found any specific spot there that’d cause such a difference in behaviour.

The delay on my machine was exactly 60 seconds, by the way (as reported by udevmonitor).

Relevant /proc/config.gz lines:
CONFIG_MICROCODE=m
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y

System:
Linux thing 2.6.31-tuxonice-r1 #3 SMP Tue Sep 29 14:06:32 CEST 2009 x86_64 Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz GenuineIntel GNU/Linux

I take it the microcode loading is being taken care of by udev and the kernel module now, and the microcode_ctl userspace tool isn’t needed anymore?
Comment 5 Boney McCracker 2010-01-28 21:31:06 UTC
(In reply to comment #4)

>   cd /lib/firmware ; mkdir intel-ucode ; cd intel-ucode ; ln -s
> /lib/microcode.dat 06-0f-02

Do you mean "ln -s /lib/firmware/microcode.dat 06-0f-02"?


> I take it the microcode loading is being taken care of by udev and the kernel
> module now, and the microcode_ctl userspace tool isn’t needed anymore?

Interesting.  Why do you believe this?
Comment 6 Ewgenij Starostin 2010-01-28 23:03:42 UTC
(In reply to comment #5)

Sorry, I didn’t think through my previous comment enough.

> Do you mean "ln -s /lib/firmware/microcode.dat 06-0f-02"?

I did. Actually, though, the hex digits will vary for people, depending on the CPU model (check /dev/.udev/firmware-missing...), and a symlink is the wrong thing to do here. Just ‘touch c0-ff-ee’ in /lib/firmware/intel-ucode (for the right value of c0ffee) to satisfy udev.

> Interesting.  Why do you believe this?

Because I was lazy and didn’t read the source code. :)

Having done that...
* microcode_ctl just reads hex numbers from one file and writes the corresponding bytes to another file.
* microcode.ko does the magic of putting those bytes in the CPU.

If one dumped the output of microcode_ctl in a regular file, one could just dd that on boot into the microcode device for the same effect as running microcode_ctl. In fact...

* microcode.ko actually tries to get the data itself, at microcode_intel.c:428:
        sprintf(name, "intel-ucode/%02x-%02x-%02x",
                c->x86, c->x86_model, c->x86_mask);

        if (request_firmware(&firmware, name, device)) {
* udev seems to know about that, but I’m too lazy to find out how.
* udev proceeds to start its ‘firmware’ binary (formerly the ‘firmware.sh’ script) and asks it to dump /lib/firmware/intel-ucode/c0-ff-fe into /dev/cpu/microcode

However, that first file doesn’t exist... on my system, anyway, which somehow causes udev to stop for a minute. If it does exist but does not contain the data the module expects (e. g. when it’s a link to microcode.dat), the module just complains in dmesg and does nothing (and udev doesn’t wait). As far as I understand things, it’d have to contain exactly the output of microcode_ctl for udev’s firmware loader to work right. And then microcode_ctl wouldn’t be needed at boot anymore.

In fact, microcode_ctl could be adequately replaced by a two-line awk or perl script, in src_compile of sys-apps/microcode-data, after careful thinking about endianness... But there’s not really a reason to do that.

Sorry if this was off topic, but I wanted at least to correct my earlier statements.
Comment 7 Boney McCracker 2010-01-29 02:41:28 UTC
(In reply to comment #4)

> Sorry if this was off topic, but I wanted at least to correct my earlier
> statements.

Thanks for the insight, which I think is relevant.
Comment 8 Matthias Schwarzott gentoo-dev 2010-01-31 21:30:12 UTC
That sounds exactly like this report:
http://thread.gmane.org/gmane.linux.hotplug.devel/15302

Could you check if the attached patch works?
Comment 9 Boney McCracker 2010-02-01 02:23:08 UTC
Created attachment 218048 [details, diff]
udev-151-missing-firmware.diff

The patch works for me.

Added as an attachment (to correct an artificially inserted newline in the post, which causes the patch to fail).
Comment 10 Nikos Chantziaras 2010-02-01 13:39:03 UTC
The patch works here too. No more 60 seconds delay per CPU :)

Closing as FIXED.
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2010-02-01 13:50:00 UTC
(In reply to comment #10)
> The patch works here too. No more 60 seconds delay per CPU :)
> 
> Closing as FIXED.
> 

How is this fixed if the patch is not in portage?
Comment 12 Nikos Chantziaras 2010-02-01 13:53:11 UTC
It's fixed upstream :P
Comment 13 Matthias Schwarzott gentoo-dev 2010-02-01 20:54:35 UTC
Fixed in udev-150 and udev-151 by adding -r1 for each.