All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/5] x86, microcode: Don't lose error returns in save_microcode_in_initrd()
@ 2013-07-23 20:59 Torsten Kaiser
  2013-07-24 12:57 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Torsten Kaiser @ 2013-07-23 20:59 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Borislav Petkov,
	Jacob Shin, Johannes Hirte, linux-kernel

Don't lose the error return.
This was lost when early amd microcode loading was added in
757885e94a22bcc82beb9b1445c95218cb20ceab

Signed-off-by: Torsten Kaiser <just.for.lkml@googlemail.com>

--- a/arch/x86/kernel/microcode_core_early.c	2013-07-23 19:44:05.509516795 +0200
+++ b/arch/x86/kernel/microcode_core_early.c	2013-07-23 19:58:34.459509474 +0200
@@ -127,11 +127,11 @@ int __init save_microcode_in_initrd(void
 	switch (c->x86_vendor) {
 	case X86_VENDOR_INTEL:
 		if (c->x86 >= 6)
-			save_microcode_in_initrd_intel();
+			return save_microcode_in_initrd_intel();
 		break;
 	case X86_VENDOR_AMD:
 		if (c->x86 >= 0x10)
-			save_microcode_in_initrd_amd();
+			return save_microcode_in_initrd_amd();
 		break;
 	default:
 		break;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/5] x86, microcode: Don't lose error returns in save_microcode_in_initrd()
  2013-07-23 20:59 [PATCH 2/5] x86, microcode: Don't lose error returns in save_microcode_in_initrd() Torsten Kaiser
@ 2013-07-24 12:57 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2013-07-24 12:57 UTC (permalink / raw)
  To: Torsten Kaiser
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Jacob Shin,
	Johannes Hirte, linux-kernel

On Tue, Jul 23, 2013 at 10:59:23PM +0200, Torsten Kaiser wrote:
> Don't lose the error return.
> This was lost when early amd microcode loading was added in
> 757885e94a22bcc82beb9b1445c95218cb20ceab
> 
> Signed-off-by: Torsten Kaiser <just.for.lkml@googlemail.com>
> 
> --- a/arch/x86/kernel/microcode_core_early.c	2013-07-23 19:44:05.509516795 +0200
> +++ b/arch/x86/kernel/microcode_core_early.c	2013-07-23 19:58:34.459509474 +0200
> @@ -127,11 +127,11 @@ int __init save_microcode_in_initrd(void
>  	switch (c->x86_vendor) {
>  	case X86_VENDOR_INTEL:
>  		if (c->x86 >= 6)
> -			save_microcode_in_initrd_intel();
> +			return save_microcode_in_initrd_intel();
>  		break;
>  	case X86_VENDOR_AMD:
>  		if (c->x86 >= 0x10)
> -			save_microcode_in_initrd_amd();
> +			return save_microcode_in_initrd_amd();

This one is incomplete: if we really want to hand up the error code, we
need to add a printk to the caller free_initrd_mem() saying that saving
of microcode from the initrd failed.

However, save_microcode_in_initrd_intel() already warns about it in the
error case.

So, actually, I think the warning should be issued by
save_microcode_in_initrd() and this function itself should be made to
return void. And save_microcode_in_initrd_intel() can simply return the
error code without doing the printk.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-24 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-23 20:59 [PATCH 2/5] x86, microcode: Don't lose error returns in save_microcode_in_initrd() Torsten Kaiser
2013-07-24 12:57 ` Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.