Re: [PATCH 2/6] x86/microcode: Merge early loader

From: Josh Boyer
Date: Fri Nov 06 2015 - 14:25:30 EST


On Tue, Oct 20, 2015 at 5:54 AM, Borislav Petkov <bp@xxxxxxxxx> wrote:
> From: Borislav Petkov <bp@xxxxxxx>
>
> Merge the early loader functionality into the driver proper. The diff
> is huge but logically, it is simply moving code from the _early.c files
> into the main driver.
>
> Signed-off-by: Borislav Petkov <bp@xxxxxxx>
> ---
> arch/x86/Kconfig | 19 +-
> arch/x86/include/asm/microcode.h | 19 +-
> arch/x86/include/asm/microcode_amd.h | 2 +-
> arch/x86/include/asm/microcode_intel.h | 10 +-
> arch/x86/kernel/cpu/microcode/Makefile | 3 -
> arch/x86/kernel/cpu/microcode/amd.c | 446 ++++++++++++++-
> arch/x86/kernel/cpu/microcode/amd_early.c | 444 ---------------
> arch/x86/kernel/cpu/microcode/core.c | 160 +++++-
> arch/x86/kernel/cpu/microcode/core_early.c | 170 ------
> arch/x86/kernel/cpu/microcode/intel.c | 788 ++++++++++++++++++++++++++-
> arch/x86/kernel/cpu/microcode/intel_early.c | 808 ----------------------------
> arch/x86/kernel/head_32.S | 5 +-
> arch/x86/mm/init.c | 2 -
> 13 files changed, 1399 insertions(+), 1477 deletions(-)
> delete mode 100644 arch/x86/kernel/cpu/microcode/amd_early.c
> delete mode 100644 arch/x86/kernel/cpu/microcode/core_early.c
> delete mode 100644 arch/x86/kernel/cpu/microcode/intel_early.c
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index fdf1f0cdf6b6..255ea22ccbec 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1126,6 +1126,7 @@ config MICROCODE
> bool "CPU microcode loading support"
> default y
> depends on CPU_SUP_AMD || CPU_SUP_INTEL
> + depends on BLK_DEV_INITRD
> select FW_LOADER
> ---help---
>
> @@ -1167,24 +1168,6 @@ config MICROCODE_OLD_INTERFACE
> def_bool y
> depends on MICROCODE
>
> -config MICROCODE_INTEL_EARLY
> - bool
> -
> -config MICROCODE_AMD_EARLY
> - bool
> -
> -config MICROCODE_EARLY
> - bool "Early load microcode"
> - depends on MICROCODE && BLK_DEV_INITRD
> - select MICROCODE_INTEL_EARLY if MICROCODE_INTEL
> - select MICROCODE_AMD_EARLY if MICROCODE_AMD
> - default y
> - help
> - This option provides functionality to read additional microcode data
> - at the beginning of initrd image. The data tells kernel to load
> - microcode to CPU's as early as possible. No functional change if no
> - microcode data is glued to the initrd, therefore it's safe to say Y.
> -

So this broke dracut. Dracut will look at the config file for the
INTEL or AMD early config options being set. If it does not find
them, it disables the creation of the early microcode part of the
initramfs. Now that the options don't even exist, it fails.

Do we have suggestions on how to work this out going forward? I
suppose we could assume the check should only be done on 4.3 or older
kernels, but I'm not sure making assumptions about newer kernels is a
great idea either.

josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/