Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1273528 > unrolled thread

x86/microcode update on systems without INITRD

Started byMarkus Trippelsdorf <markus@trippelsdorf.de>
First post2015-11-19 22:50 +0100
Last post2015-11-23 17:30 +0100
Articles 9 — 3 participants

Back to article view | Back to linux.kernel


Contents

  x86/microcode update on systems without INITRD Markus Trippelsdorf <markus@trippelsdorf.de> - 2015-11-19 22:50 +0100
    Re: x86/microcode update on systems without INITRD Borislav Petkov <bp@suse.de> - 2015-11-19 23:00 +0100
      Re: x86/microcode update on systems without INITRD Borislav Petkov <bp@suse.de> - 2015-11-20 00:00 +0100
        Re: x86/microcode update on systems without INITRD Markus Trippelsdorf <markus@trippelsdorf.de> - 2015-11-20 08:20 +0100
          Re: x86/microcode update on systems without INITRD Borislav Petkov <bp@suse.de> - 2015-11-20 09:30 +0100
            Re: x86/microcode update on systems without INITRD Markus Trippelsdorf <markus@trippelsdorf.de> - 2015-11-20 09:40 +0100
              Re: x86/microcode update on systems without INITRD Borislav Petkov <bp@suse.de> - 2015-11-20 09:50 +0100
                [PATCH] x86/microcode: Initialize the driver late when facilities  are up Borislav Petkov <bp@suse.de> - 2015-11-20 12:30 +0100
                  [tip:x86/urgent] x86/microcode:   Initialize the driver late when facilities are up tip-bot for Borislav Petkov <tipbot@zytor.com> - 2015-11-23 17:30 +0100

#1273528 — x86/microcode update on systems without INITRD

FromMarkus Trippelsdorf <markus@trippelsdorf.de>
Date2015-11-19 22:50 +0100
Subjectx86/microcode update on systems without INITRD
Message-ID<qwFfA-6wX-13@gated-at.bofh.it>
It looks like the ability to update x86/microcode without using an
initrd was removed this merge window.

Why?

I've used "echo -n 1 >| /sys/devices/system/cpu/microcode/reload" in my
init script for years without any issues.

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

[toc] | [next] | [standalone]


#1273535

FromBorislav Petkov <bp@suse.de>
Date2015-11-19 23:00 +0100
Message-ID<qwFpf-6AK-11@gated-at.bofh.it>
In reply to#1273528
On Thu, Nov 19, 2015 at 10:43:01PM +0100, Markus Trippelsdorf wrote:
> It looks like the ability to update x86/microcode without using an
> initrd was removed this merge window.

Whoops, that shouldnt've happened. Will debug it tomorrow and provide a
fix.

Thanks for letting me know.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1273560

FromBorislav Petkov <bp@suse.de>
Date2015-11-20 00:00 +0100
Message-ID<qwGlj-7bk-1@gated-at.bofh.it>
In reply to#1273535
On Thu, Nov 19, 2015 at 10:55:43PM +0100, Borislav Petkov wrote:
> On Thu, Nov 19, 2015 at 10:43:01PM +0100, Markus Trippelsdorf wrote:
> > It looks like the ability to update x86/microcode without using an
> > initrd was removed this merge window.
> 
> Whoops, that shouldnt've happened. Will debug it tomorrow and provide a
> fix.

Btw, you should consider changing your setup to use the initrd for
loading microcode early because microcode should be loaded as early as
possible.

The ".../reload" method is aimed at updating microcode on long-running
boxes without rebooting them. And that means those updates need to be
tested first in a lab environment before running them on the production
systems because not every microcode patch can be applied late. Some
shouldn't be even tried.

Anyway, the hunk below seems to work in my guest here, I'll run it
on the rest of the boxes tomorrow. In case you want to give it a try
before:

---
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 3aaffb601c91..faec7120c508 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -698,3 +698,4 @@ int __init microcode_init(void)
 	return error;
 
 }
+late_initcall(microcode_init);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 29db25f9a745..d2bbe343fda7 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1250,8 +1250,6 @@ void __init setup_arch(char **cmdline_p)
 	if (efi_enabled(EFI_BOOT))
 		efi_apply_memmap_quirks();
 #endif
-
-	microcode_init();
 }
 
 #ifdef CONFIG_X86_32
---

Thanks!

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1273751

FromMarkus Trippelsdorf <markus@trippelsdorf.de>
Date2015-11-20 08:20 +0100
Message-ID<qwO9b-44h-1@gated-at.bofh.it>
In reply to#1273560
On 2015.11.19 at 23:58 +0100, Borislav Petkov wrote:
> On Thu, Nov 19, 2015 at 10:55:43PM +0100, Borislav Petkov wrote:
> > On Thu, Nov 19, 2015 at 10:43:01PM +0100, Markus Trippelsdorf wrote:
> > > It looks like the ability to update x86/microcode without using an
> > > initrd was removed this merge window.
> > 
> > Whoops, that shouldnt've happened. Will debug it tomorrow and provide a
> > fix.
> 
> Anyway, the hunk below seems to work in my guest here, I'll run it
> on the rest of the boxes tomorrow. In case you want to give it a try
> before:

Your patch works fine. Thanks.
But of course it needs this additional patch, otherwise the microcode
loader wouldn't build at all:

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index db3622f22b61..52c6964e24bd 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1126,7 +1126,6 @@ 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---
 

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

[toc] | [prev] | [next] | [standalone]


#1273822

FromBorislav Petkov <bp@suse.de>
Date2015-11-20 09:30 +0100
Message-ID<qwPeX-4Iu-31@gated-at.bofh.it>
In reply to#1273751
On Fri, Nov 20, 2015 at 08:19:20AM +0100, Markus Trippelsdorf wrote:
> On 2015.11.19 at 23:58 +0100, Borislav Petkov wrote:
> > On Thu, Nov 19, 2015 at 10:55:43PM +0100, Borislav Petkov wrote:
> > > On Thu, Nov 19, 2015 at 10:43:01PM +0100, Markus Trippelsdorf wrote:
> > > > It looks like the ability to update x86/microcode without using an
> > > > initrd was removed this merge window.
> > > 
> > > Whoops, that shouldnt've happened. Will debug it tomorrow and provide a
> > > fix.
> > 
> > Anyway, the hunk below seems to work in my guest here, I'll run it
> > on the rest of the boxes tomorrow. In case you want to give it a try
> > before:
> 
> Your patch works fine. Thanks.

Thanks for testing.

> But of course it needs this additional patch, otherwise the microcode
> loader wouldn't build at all:
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index db3622f22b61..52c6964e24bd 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1126,7 +1126,6 @@ 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---

That dependency is a must as the early loader needs the initrd support.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1273826

FromMarkus Trippelsdorf <markus@trippelsdorf.de>
Date2015-11-20 09:40 +0100
Message-ID<qwPoC-4LV-3@gated-at.bofh.it>
In reply to#1273822
On 2015.11.20 at 09:27 +0100, Borislav Petkov wrote:
> On Fri, Nov 20, 2015 at 08:19:20AM +0100, Markus Trippelsdorf wrote:
> > On 2015.11.19 at 23:58 +0100, Borislav Petkov wrote:
> > > On Thu, Nov 19, 2015 at 10:55:43PM +0100, Borislav Petkov wrote:
> > > > On Thu, Nov 19, 2015 at 10:43:01PM +0100, Markus Trippelsdorf wrote:
> > > > > It looks like the ability to update x86/microcode without using an
> > > > > initrd was removed this merge window.
> > > > 
> > > > Whoops, that shouldnt've happened. Will debug it tomorrow and provide a
> > > > fix.
> > > 
> > > Anyway, the hunk below seems to work in my guest here, I'll run it
> > > on the rest of the boxes tomorrow. In case you want to give it a try
> > > before:
> > 
> > Your patch works fine. Thanks.
> 
> Thanks for testing.
> 
> > But of course it needs this additional patch, otherwise the microcode
> > loader wouldn't build at all:
> > 
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index db3622f22b61..52c6964e24bd 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -1126,7 +1126,6 @@ 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---
> 
> That dependency is a must as the early loader needs the initrd support.

Well, BLK_DEV_INITRD is not set in my config and it works just fine...

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

[toc] | [prev] | [next] | [standalone]


#1273849

FromBorislav Petkov <bp@suse.de>
Date2015-11-20 09:50 +0100
Message-ID<qwPyi-4PB-31@gated-at.bofh.it>
In reply to#1273826
On Fri, Nov 20, 2015 at 09:33:48AM +0100, Markus Trippelsdorf wrote:
> Well, BLK_DEV_INITRD is not set in my config and it works just fine...

I'm assuming with "works just fine" you mean, you can load microcode.

Again, as I explained previously, you should consider moving to the
early method with an initrd. The late method is a fallback for certain
setups and the early method should be the preferred one.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1273991 — [PATCH] x86/microcode: Initialize the driver late when facilities are up

FromBorislav Petkov <bp@suse.de>
Date2015-11-20 12:30 +0100
Subject[PATCH] x86/microcode: Initialize the driver late when facilities are up
Message-ID<qwS38-6xE-15@gated-at.bofh.it>
In reply to#1273849
From: Borislav Petkov <bp@suse.de>
Date: Fri, 20 Nov 2015 00:05:24 +0100
Subject: [PATCH] x86/microcode: Initialize the driver late when facilities are up

Running microcode_init() from setup_arch() is a bad idea because not
even kmalloc() is ready at that point and the loader does all kinds of
allocations and init/registration with various subsystems.

Make it a late initcall when required facilities are initialized so that
the microcode driver initialization can succeed too.

Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/cpu/microcode/core.c | 1 +
 arch/x86/kernel/setup.c              | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 7fc27f1cca58..b3e94ef461fd 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -698,3 +698,4 @@ int __init microcode_init(void)
 	return error;
 
 }
+late_initcall(microcode_init);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 29db25f9a745..d2bbe343fda7 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1250,8 +1250,6 @@ void __init setup_arch(char **cmdline_p)
 	if (efi_enabled(EFI_BOOT))
 		efi_apply_memmap_quirks();
 #endif
-
-	microcode_init();
 }
 
 #ifdef CONFIG_X86_32
-- 
2.3.5

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1275580 — [tip:x86/urgent] x86/microcode: Initialize the driver late when facilities are up

Fromtip-bot for Borislav Petkov <tipbot@zytor.com>
Date2015-11-23 17:30 +0100
Subject[tip:x86/urgent] x86/microcode: Initialize the driver late when facilities are up
Message-ID<qy2a7-4i0-39@gated-at.bofh.it>
In reply to#1273991
Commit-ID:  2d5be37d686c4dae8e60d20283d6f44ac2c44f65
Gitweb:     http://git.kernel.org/tip/2d5be37d686c4dae8e60d20283d6f44ac2c44f65
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Fri, 20 Nov 2015 12:24:00 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 23 Nov 2015 10:39:49 +0100

x86/microcode: Initialize the driver late when facilities are up

Running microcode_init() from setup_arch() is a bad idea because
not even kmalloc() is ready at that point and the loader does
all kinds of allocations and init/registration with various
subsystems.

Make it a late initcall when required facilities are initialized
so that the microcode driver initialization can succeed too.

Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20151120112400.GC4028@pd.tnic
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/microcode/core.c | 1 +
 arch/x86/kernel/setup.c              | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 7fc27f1..b3e94ef 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -698,3 +698,4 @@ int __init microcode_init(void)
 	return error;
 
 }
+late_initcall(microcode_init);
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 29db25f..d2bbe34 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1250,8 +1250,6 @@ void __init setup_arch(char **cmdline_p)
 	if (efi_enabled(EFI_BOOT))
 		efi_apply_memmap_quirks();
 #endif
-
-	microcode_init();
 }
 
 #ifdef CONFIG_X86_32
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web