Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: /
Date: Mon, 02 Jan 2017 22:58:58
Message-Id: 1483397832.c2eebda7f0e16390ab0dd45d604285fba403abb8.robbat2@gentoo
1 commit: c2eebda7f0e16390ab0dd45d604285fba403abb8
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 2 22:57:12 2017 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 2 22:57:12 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c2eebda7
7
8 Make early microcode loading optional.
9
10 Nasty corner case with early microcode loading is that there are some
11 processors that hardlock when the new microcode is loaded.
12
13 Disable microcode loading by default to avoid crashing those systems.
14
15 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
16
17 gen_cmdline.sh | 4 ++++
18 gen_configkernel.sh | 22 ++++++++++++++++++++++
19 gen_determineargs.sh | 1 +
20 gen_initramfs.sh | 2 +-
21 4 files changed, 28 insertions(+), 1 deletion(-)
22
23 diff --git a/gen_cmdline.sh b/gen_cmdline.sh
24 index 57a8e1d..f4392f9 100755
25 --- a/gen_cmdline.sh
26 +++ b/gen_cmdline.sh
27 @@ -314,6 +314,10 @@ parse_cmdline() {
28 CMD_BUSYBOX=`parse_optbool "$*"`
29 print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
30 ;;
31 + --microcode|--no-microcode)
32 + CMD_MICROCODE=`parse_optbool "$*"`
33 + print_info 2 "CMD_MICROCODE: ${CMD_MICROCODE}"
34 + ;;
35 --nfs|--no-nfs)
36 CMD_NFS=`parse_optbool "$*"`
37 print_info 2 "CMD_NFS: ${CMD_NFS}"
38
39 diff --git a/gen_configkernel.sh b/gen_configkernel.sh
40 index 9c37649..74693f3 100755
41 --- a/gen_configkernel.sh
42 +++ b/gen_configkernel.sh
43 @@ -218,4 +218,26 @@ config_kernel() {
44 kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "$k" "${cfg___virtio_opt}"
45 done
46 fi
47 +
48 + # Microcode setting, intended for early microcode loading
49 + # needs to be compiled in.
50 + if isTrue ${MICROCODE}
51 + then
52 + for k in \
53 + CONFIG_MICROCODE \
54 + CONFIG_MICROCODE_INTEL \
55 + CONFIG_MICROCODE_AMD \
56 + CONFIG_MICROCODE_OLD_INTERFACE \
57 + CONFIG_MICROCODE_INTEL_EARLY \
58 + CONFIG_MICROCODE_AMD_EARLY \
59 + CONFIG_MICROCODE_EARLY \
60 + ; do
61 + cfg=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "$k")
62 + case "$cfg" in
63 + y) ;; # Do nothing
64 + *) cfg='y'
65 + esac
66 + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "$k" "${cfg}"
67 + done
68 + fi
69 }
70
71 diff --git a/gen_determineargs.sh b/gen_determineargs.sh
72 index 0d908b6..2dbd958 100755
73 --- a/gen_determineargs.sh
74 +++ b/gen_determineargs.sh
75 @@ -117,6 +117,7 @@ determine_real_args() {
76 set_config_with_override BOOL ISCSI CMD_ISCSI
77 set_config_with_override BOOL BUSYBOX CMD_BUSYBOX "yes"
78 set_config_with_override BOOL NFS CMD_NFS "yes"
79 + set_config_with_override BOOL MICROCODE CMD_MICROCODE
80 set_config_with_override BOOL UNIONFS CMD_UNIONFS
81 set_config_with_override BOOL NETBOOT CMD_NETBOOT
82 set_config_with_override STRING REAL_ROOT CMD_REAL_ROOT
83
84 diff --git a/gen_initramfs.sh b/gen_initramfs.sh
85 index e968719..afbef92 100755
86 --- a/gen_initramfs.sh
87 +++ b/gen_initramfs.sh
88 @@ -1056,7 +1056,7 @@ create_initramfs() {
89 ## It only loads monolithic ucode from an uncompressed cpio, which MUST
90 ## be before the other cpio archives in the stream.
91 cfg_CONFIG_MICROCODE=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}"/.config CONFIG_MICROCODE)
92 - if [ "${cfg_CONFIG_MICROCODE}" == "y" ]; then
93 + if isTrue "${MICROCODE}" && [ "${cfg_CONFIG_MICROCODE}" == "y" ]; then
94 cfg_CONFIG_MICROCODE_INTEL=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}"/.config CONFIG_MICROCODE_INTEL)
95 cfg_CONFIG_MICROCODE_AMD=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}"/.config CONFIG_MICROCODE_AMD)
96 print_info 1 "early-microcode: >> Preparing..."