Summary: | genkernel forces CONFIG_MICROCODE INTEL AND AMD microcode loading options | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | yves.caniou |
Component: | genkernel | Assignee: | Gentoo Genkernel Maintainers <genkernel> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | bkohler, hjckr, xdudka00, yves.caniou |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=913659 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Kernel config file example for 4.19.270 kernel version |
Description
yves.caniou
2024-01-27 13:52:24 UTC
(In reply to yves.caniou from comment #0) > > In /etc/genkernel.conf, I have : > # Possible values: empty/"no", "all", "intel", "amd" > #MICROCODE="all" > so nothing/no check should be done by default, with no unwanted addition. > Why would genkernel behave like "all" was set, and force things? Empty/"no" > should lead to only what has been configured in the kernel. > The commented line there tells what the default is, "all". The default is defined here: https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_determineargs.sh#n431 Can you share your kernel config which is causing failure out of the box with the defaults? Created attachment 884147 [details]
Kernel config file example for 4.19.270 kernel version
(In reply to Ben Kohler from comment #1) > (In reply to yves.caniou from comment #0) > > > > In /etc/genkernel.conf, I have : > > # Possible values: empty/"no", "all", "intel", "amd" > > #MICROCODE="all" > > so nothing/no check should be done by default, with no unwanted addition. > > Why would genkernel behave like "all" was set, and force things? Empty/"no" > > should lead to only what has been configured in the kernel. > > > > The commented line there tells what the default is, "all". The default is > defined here: > https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_determineargs.sh#n431 > Can you share your kernel config which is causing failure out of the box > with the defaults? - I join a a kernel config file for 4.19.279 version. If you download the corresponding kernel, copy this file as .config and run genkernel --no-clean --no-zfs --save-config --luks all it compiles well. You can see that the file has both intel and AMD microcode options (actually set by genkernel). Using the same config file for 4.19.306 kernel leads to x86_64-pc-linux-gnu-ld: arch/x86/kernel/cpu/common.o: in function `microcode_check' undefined reference to `amd_check_microcode' - As written previously, I don't really get why the unset is defaulted to all. MICROCODE could be explicitly set defaulted to all in the config file in that case, which is more expressive. Also, to my opinion, MICROCODE="intel" should unset AMD microcode option from the config file (same with AMD and intel of course). Typo: - I join a a kernel config file for 4.19.279 version. -----> - I join a a kernel config file for 4.19.270 version. I can second this issue, where if one decides to disable CONFIG_CPU_SUP_INTEL=y because they run their kernel on AMD, genkernel reverts it by default, essentially modifying the user kernel configuration. It not only re-adds CONFIG_CPU_SUP_INTEL, but also all of its dependencies, so the list grows for a non-intel build. Took me a while to realize I had to feed a genkernel option to avoid it modify my kernel configuration, --microcode=amd in my case. Noticed it by looking in dmesg for something else when I noticed: [ 0.000000] KERNEL supported cpus: [ 0.000000] Intel GenuineIntel [ 0.000000] AMD AuthenticAMD and I new I've turned intel off long time ago... well, only to realize it has resurfaced... now it is gone for good. I'd rather had genkernel complain(and fail if needed) that I mixed --microcode=all with a missing CONFIG_CPU_SUP_INTEL=y option than have it silently modify my configuration. and just before I have forgotten, the resulting kernel, system map and initrd files are smaller: old, amd and intel: -rwxr-xr-x 1 root root 4.4M Apr 11 13:34 /boot/System.map-6.8.5-gentoo-x86_64.old -rwxr-xr-x 1 root root 8.6M Apr 11 13:34 /boot/vmlinuz-6.8.5-gentoo-x86_64.old -rwxr-xr-x 1 root root 5.8M Apr 11 13:38 /boot/initramfs-6.8.5-gentoo-x86_64.img.old new, without intel: -rwxr-xr-x 1 root root 2.6M Apr 12 11:43 /boot/System.map-6.8.5-gentoo-x86_64 -rwxr-xr-x 1 root root 7.9M Apr 12 11:43 /boot/vmlinuz-6.8.5-gentoo-x86_64 -rwxr-xr-x 1 root root 5.7M Apr 12 11:46 /boot/initramfs-6.8.5-gentoo-x86_64.img |