x86/ucode: Add option to scan microcode by default
PATCH 1/1 x86/ucode: Add option to scan microcode by default
A lot of systems automatically add microcode to the initrd so it can be useful as a vendor policy to always scan for microcode. Add a Kconfig option to allow setting the default behaviour.
The default behaviour is unchanged since the new option defaults to "no".
--- xen/arch/x86/Kconfig | 11 +++++++++++ xen/arch/x86/cpu/microcode/core.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)
xen/arch/x86/Kconfig +11 -0
@@ -383,6 +383,17 @@ config ALTP2M If unsure, stay with defaults. +config UCODE_SCAN_DEFAULT + def_bool n + prompt "Scan for microcode by default" + help + During boot, Xen can scan the multiboot images for a CPIO archive + containing CPU microcode to be loaded. + + Enabling this option will cause Xen to scan for it by default. + + If unsure, say N. + endmenu source "common/Kconfig"
xen/arch/x86/cpu/microcode/core.c +1 -1
@@ -100,7 +100,7 @@ static struct microcode_patch *microcode_cache;* location we require that they are not both active together. */ static int __initdata opt_mod_idx; -static bool __initdata opt_scan; +static bool __initdata opt_scan =IS_ENABLED (CONFIG_UCODE_SCAN_DEFAULT );/* * Used by the EFI path only, when xen.cfg identifies an explicit microcode
Signature · 1 line
2.48.1
Quoted 4 lines · Ross Lagerwall
A lot of systems automatically add microcode to the initrd so it can be useful as a vendor policy to always scan for microcode. Add a
Kconfigoption to allow setting the default behaviour.
Quoted 8 lines
The default behaviour is unchanged since the new option defaults to "no".
Signed-off-by Ross Lagerwall <[email protected]>--- xen/arch/x86/Kconfig | 11 +++++++++++ xen/arch/x86/cpu/microcode/core.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)
Please also update the command line doc accordingly.
xen/arch/x86/Kconfig config ALTP2M · line 387
Quoted 8 lines
xen/arch/x86/Kconfig +2
-0@@ -383,6 +383,17 @@ config ALTP2M If unsure, stay with defaults. +config UCODE_SCAN_DEFAULT + def_bool n
Just "bool" will suffice.
Also can you please send patches To: the list, with maintainers Cc:-ed?
Jan
Quoted 8 lines · Jan Beulich
Quoted 7 lines · Ross Lagerwall
A lot of systems automatically add microcode to the initrd so it can be useful as a vendor policy to always scan for microcode. Add a
Kconfigoption to allow setting the default behaviour.The default behaviour is unchanged since the new option defaults to "no".
Quoted 6 lines
Quoted 5 lines
Signed-off-by Ross Lagerwall <[email protected]>--- xen/arch/x86/Kconfig | 11 +++++++++++ xen/arch/x86/cpu/microcode/core.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)Please also update the command line doc accordingly.
I've got an open task to fix both the cmdline and sphinx docs WRT changes in 4.20. I could do this too.
~Andrew
Quoted 8 lines · Ross Lagerwall
A lot of systems automatically add microcode to the initrd so it can be useful as a vendor policy to always scan for microcode. Add a
Kconfigoption to allow setting the default behaviour.The default behaviour is unchanged since the new option defaults to "no".
Signed-off-by Ross Lagerwall <[email protected]>
I'm pretty sure this is safe on 4.20.
Prior versions of Xen need the fix to make idx/scan be mutually exclusive, which hasn't been backported yet IIRC.
Quoted 10 lines
--- xen/arch/x86/Kconfig | 11 +++++++++++ xen/arch/x86/cpu/microcode/core.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)xen/arch/x86/Kconfig +0
-0
xen/arch/x86/Kconfig config ALTP2M · line 391
Quoted 9 lines
xen/arch/x86/Kconfig +6
-0@@ -383,6 +383,17 @@ config ALTP2M If unsure, stay with defaults. +config UCODE_SCAN_DEFAULT + def_bool n + prompt "Scan for microcode by default" + help + During boot, Xen can scan the multiboot images for a CPIO archive + containing CPU microcode to be loaded.
", which is Linux's mechanism for early microcode loading."
This is quite an important point to cover.
xen/arch/x86/Kconfig config ALTP2M · line 395
Quoted 4 lines
xen/arch/x86/Kconfig +4
-0+ + Enabling this option will cause Xen to scan for it by default. + + If unsure, say N.
Personally I don't like this "If unsure", because it's almost always redundant with the default.
In this case, it really ought to be "set if you have a Linux dom0", which in turn begs the question as to whether it ought to be bool y.
~Andrew
Quoted 48 lines · Andrew Cooper
Quoted 8 lines · Ross Lagerwall
A lot of systems automatically add microcode to the initrd so it can be useful as a vendor policy to always scan for microcode. Add a
Kconfigoption to allow setting the default behaviour.The default behaviour is unchanged since the new option defaults to "no".
Signed-off-by Ross Lagerwall <[email protected]>I'm pretty sure this is safe on 4.20.
Prior versions of Xen need the fix to make idx/scan be mutually exclusive, which hasn't been backported yet IIRC.
Quoted 10 lines
--- xen/arch/x86/Kconfig | 11 +++++++++++ xen/arch/x86/cpu/microcode/core.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)xen/arch/x86/Kconfig +0
-0xen/arch/x86/Kconfig config ALTP2M · line 391
Quoted 9 lines
xen/arch/x86/Kconfig +6
-0@@ -383,6 +383,17 @@ config ALTP2M If unsure, stay with defaults. +config UCODE_SCAN_DEFAULT + def_bool n + prompt "Scan for microcode by default" + help + During boot, Xen can scan the multiboot images for a CPIO archive + containing CPU microcode to be loaded.", which is Linux's mechanism for early microcode loading."
This is quite an important point to cover.
xen/arch/x86/Kconfig config ALTP2M · line 395
Quoted 4 lines
xen/arch/x86/Kconfig +4
-0+ + Enabling this option will cause Xen to scan for it by default. + + If unsure, say N.Personally I don't like this "If unsure", because it's almost always redundant with the default.
Quoted 3 lines
In this case, it really ought to be "set if you have a Linux dom0", which in turn begs the question as to whether it ought to be bool y.
I agree with you that changing the default to yes is probably a good idea but I think it would be better to separate making it configurable from changing the default behaviour.
Ross