public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Alexander Hirsch <1zeeky@gmail.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH] x86/microcode: Allow early loading without initrd
Date: Sun, 26 Apr 2015 17:31:13 +0200	[thread overview]
Message-ID: <1430062273.2927.121.camel@x220> (raw)
In-Reply-To: <20150426170314.210e921c@netblarch.fritz.box>

On Sun, 2015-04-26 at 17:03 +0200, Alexander Hirsch wrote:
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
 
>  config MICROCODE_EARLY
>  	bool "Early load microcode"
> -	depends on MICROCODE=y && BLK_DEV_INITRD
> +	depends on MICROCODE=y
>  	select MICROCODE_INTEL_EARLY if MICROCODE_INTEL
>  	select MICROCODE_AMD_EARLY if MICROCODE_AMD
>  	default y

> --- a/arch/x86/kernel/cpu/microcode/intel_early.c
> +++ b/arch/x86/kernel/cpu/microcode/intel_early.c
> @@ -691,6 +691,9 @@ int __init save_microcode_in_initrd_intel(void)
>  	unsigned int count = mc_saved_data.mc_saved_count;
>  	struct microcode_intel *mc_saved[MAX_UCODE_COUNT];
>  	int ret = 0;
> +#ifndef BLK_DEV_INITRD

#ifndef CONFIG_BLK_DEV_INITRD?

> +	unsigned long initrd_start = 0;
> +#endif
>  
>  	if (count == 0)
>  		return ret;
> @@ -728,24 +731,32 @@ _load_ucode_intel_bsp(struct mc_saved_data *mc_saved_data,
>  
>  void __init load_ucode_intel_bsp(void)
>  {
> -	u64 start, size;
> +	u64 start = 0, size = 0;
> +	struct mc_saved_data *mc_saved_data_p;
> +	unsigned long *mc_saved_in_initrd_p;
> +#ifdef BLK_DEV_INITRD

Likewise.

>  #ifdef CONFIG_X86_32
>  	struct boot_params *p;
>  
>  	p	= (struct boot_params *)__pa_nodebug(&boot_params);
>  	start	= p->hdr.ramdisk_image;
>  	size	= p->hdr.ramdisk_size;
> -
> -	_load_ucode_intel_bsp(
> -			(struct mc_saved_data *)__pa_nodebug(&mc_saved_data),
> -			(unsigned long *)__pa_nodebug(&mc_saved_in_initrd),
> -			start, size);
>  #else
>  	start	= boot_params.hdr.ramdisk_image + PAGE_OFFSET;
>  	size	= boot_params.hdr.ramdisk_size;
> -
> -	_load_ucode_intel_bsp(&mc_saved_data, mc_saved_in_initrd, start, size);
>  #endif
> +#endif
> +
> +#ifdef CONFIG_X86_32
> +	mc_saved_in_initrd_p =
> +		(unsigned long *)__pa_nodebug(mc_saved_in_initrd);
> +	mc_saved_data_p = (struct mc_saved_data *)__pa_nodebug(&mc_saved_data);
> +#else
> +	mc_saved_data_p = &mc_saved_data;
> +	mc_saved_in_initrd_p = mc_saved_in_initrd;
> +#endif
> +
> +	_load_ucode_intel_bsp(mc_saved_data_p, mc_saved_in_initrd_p, start, size);
>  }
>  
>  void load_ucode_intel_ap(void)
> @@ -755,6 +766,9 @@ void load_ucode_intel_ap(void)
>  	unsigned long *mc_saved_in_initrd_p;
>  	unsigned long initrd_start_addr;
>  	enum ucode_state ret;
> +#ifndef BLK_DEV_INITRD

Likewise.

> +	unsigned long initrd_start = 0;
> +#endif
>  #ifdef CONFIG_X86_32
>  	unsigned long *initrd_start_p;
>  

Thanks,


Paul Bolle


  reply	other threads:[~2015-04-26 15:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-26 15:03 [PATCH] x86/microcode: Allow early loading without initrd Alexander Hirsch
2015-04-26 15:31 ` Paul Bolle [this message]
2015-04-26 16:37   ` Alexander Hirsch
2015-04-26 16:16 ` Borislav Petkov
2015-04-26 17:27   ` Alexander Hirsch
2015-04-27  9:23     ` Borislav Petkov
2015-04-30 13:18   ` Henrique de Moraes Holschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430062273.2927.121.camel@x220 \
    --to=pebolle@tiscali.nl \
    --cc=1zeeky@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox