Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 531470 - sys-apps/microcode-ctl-1.26 - /etc/init.d/microcode_ctl fails to load microcode.ko
Summary: sys-apps/microcode-ctl-1.26 - /etc/init.d/microcode_ctl fails to load microco...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-02 19:26 UTC by Mario Bachmann
Modified: 2015-01-22 08:28 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Bachmann 2014-12-02 19:26:19 UTC
the init script /etc/init.d/microcode_ctl from sys-apps/microcode-ctl-1.26 does not load the firmware microcode.

Reproducible: Always

Steps to Reproduce:
1. /etc/init.d/microcode_ctl start
2. dmesg |tail -25|grep microcode

Actual Results:  
no output. So the microcode is not loaded. 

Expected Results:  
output:
[    4.902355] microcode: CPU0 sig=0x306a9, pf=0x2, revision=0xc
[    4.902984] microcode: CPU0 sig=0x306a9, pf=0x2, revision=0xc
[    4.903527] microcode: CPU0 updated to revision 0x1b, date = 2014-05-29
[    4.903535] microcode: CPU1 sig=0x306a9, pf=0x2, revision=0xc
[    4.903555] microcode: CPU1 sig=0x306a9, pf=0x2, revision=0xc
[    4.903815] microcode: CPU1 updated to revision 0x1b, date = 2014-05-29
[    4.903821] microcode: CPU2 sig=0x306a9, pf=0x2, revision=0xc
[    4.903839] microcode: CPU2 sig=0x306a9, pf=0x2, revision=0xc
[    4.904097] microcode: CPU2 updated to revision 0x1b, date = 2014-05-29
[    4.904103] microcode: CPU3 sig=0x306a9, pf=0x2, revision=0xc
[    4.904121] microcode: CPU3 sig=0x306a9, pf=0x2, revision=0xc
[    4.904382] microcode: CPU3 updated to revision 0x1b, date = 2014-05-29
[    4.904389] microcode: CPU4 sig=0x306a9, pf=0x2, revision=0xc
[    4.904407] microcode: CPU4 sig=0x306a9, pf=0x2, revision=0xc
[    4.904659] microcode: CPU4 updated to revision 0x1b, date = 2014-05-29
[    4.904666] microcode: CPU5 sig=0x306a9, pf=0x2, revision=0xc
[    4.904685] microcode: CPU5 sig=0x306a9, pf=0x2, revision=0xc
[    4.904945] microcode: CPU5 updated to revision 0x1b, date = 2014-05-29
[    4.904949] microcode: CPU6 sig=0x306a9, pf=0x2, revision=0xc
[    4.904961] microcode: CPU6 sig=0x306a9, pf=0x2, revision=0xc
[    4.905212] microcode: CPU6 updated to revision 0x1b, date = 2014-05-29
[    4.905225] microcode: CPU7 sig=0x306a9, pf=0x2, revision=0xc
[    4.905242] microcode: CPU7 sig=0x306a9, pf=0x2, revision=0xc
[    4.905502] microcode: CPU7 updated to revision 0x1b, date = 2014-05-29
[    4.905545] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba


sys-apps/openrc-0.13.6

# uname -a
Linux core 3.17.4 #1 SMP Sun Nov 23 14:44:21 CET 2014 x86_64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz GenuineIntel GNU/Linux

# grep MICROCODE /usr/src/linux/.config
CONFIG_MICROCODE=m
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
# CONFIG_MICROCODE_INTEL_EARLY is not set
# CONFIG_MICROCODE_AMD_EARLY is not set

I can load it manually: 
modprobe microcode
microcode_ctl -f /lib/f/lib/firmware/microcode.dat
That works!
Comment 1 Mario Bachmann 2014-12-13 10:40:37 UTC
Seems nobody uses the microcode update feature. Most CPUs run well with the original microcode version. 

Perhaps somebody can explain, what is the intention of the microcode_ctl-init-script. It seems to be wrong. 

/etc/init.d/microcode_ctl

start() {
	local ret
	grep -qs ' microcode$' /proc/misc || modprobe -q microcode

	ebegin "Updating microcode"
	microcode_ctl -qu -f /lib/firmware/microcode.dat -d ${MICROCODE_DEV}
	ret=$?
	eend ${ret} "Failed to update microcode via '${MICROCODE_DEV}'"

	[ "${MICROCODE_UNLOAD}" = "yes" ] && rmmod microcode >/dev/null 2>&1

	return ${ret}
}

/etc/conf.d/microcode_ctl

MICROCODE_DEV="/dev/cpu/microcode"
MICROCODE_UNLOAD="yes"
Comment 2 Sergey Popov (RETIRED) gentoo-dev 2015-01-22 06:21:48 UTC
I removed -q from initscript and got this:

oas1 ~ # /etc/init.d/microcode_ctl restart
 * Updating microcode ...
microcode_ctl: writing microcode (length: 616448)
microcode_ctl: microcode successfuly written to /dev/cpu/microcode                                                                                                                       [ ok ]

And i do not have any messages in dmesg even if i run this manually

So, i am closing this as WORKSFORME
Comment 3 Mario Bachmann 2015-01-22 08:28:10 UTC
I think the init script forget to modprobe. 
If the kernel module is not loaded and not shown in lsmod, than the init script fails to load the microcode to the cpu. 

Perhaps it would be an improvement to modify the init script: 

/etc/init.d/microcode_ctl

start() {
	local ret

        #LOAD THE KERNEL MODULE FOR SURE
	modprobe microcode

	ebegin "Updating microcode"
	microcode_ctl -qu -f /lib/firmware/microcode.dat -d ${MICROCODE_DEV}
	ret=$?
	eend ${ret} "Failed to update microcode via '${MICROCODE_DEV}'"

	[ "${MICROCODE_UNLOAD}" = "yes" ] && rmmod microcode >/dev/null 2>&1

	return ${ret}
}