[coreboot] Patch set updated for coreboot: 85fd89c buildsystem: Make CPU microcode updating more configurable
Alexandru Gagniuc (firstname.lastname@example.org)
gerrit at coreboot.org
Fri Jul 20 08:25:21 CEST 2012
Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1245
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date: Fri Jul 20 00:11:21 2012 -0500
buildsystem: Make CPU microcode updating more configurable
This commit has two main parts:
1) Move UPDATE_CPU_MICROCODE to src/cpu/Kconfig to make it a more
"global" option, and make it depend on
Having this option hidded in AMD Fam 10h Kconfig made it virtually
invisible to devs working on other CPUs. Having this as a global
option, should provide an incentive for people to work on
configurable microcode updates.
2) Added option to the build system to include a microcode file in CBFS.
The option will only be visible if the CPU's Kconfig selects
CPU_MICROCODE_FROM_CBFS, basically telling the build system that the
CPU initialization routines are capable of finding and applying
microcode updates from CBFS.
If CPU_MICROCODE_FROM_CBFS is selected, the user is presented with two
- Include microcode in CBFS from an external file
- Don't include any microcode in CBFS
You might also have noticed a commented-out option in Kconfig:
The idea behind this is to take a C array, compile it, and generate a
microcode file automatically. This means the user won't have to fiddle
with microcode files, which might be next to impossible to obtain.
Since this option requires more intricate modifications to the build
system, it is better to implement it in a future patch.
I am leaving this commented-out option to communicate intent and provide
an incentive to implement it.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
src/arch/x86/Makefile.inc | 7 ++++
src/cpu/Kconfig | 76 +++++++++++++++++++++++++++++++++++++++
src/cpu/amd/model_10xxx/Kconfig | 33 +----------------
3 files changed, 84 insertions(+), 32 deletions(-)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index f498831..a215a7b 100644
@@ -49,6 +49,9 @@ endif
extract_nth=$(word $(1), $(subst |, ,$(2)))
@@ -100,6 +103,10 @@ ifeq ($(CONFIG_INCLUDE_CONFIG_FILE),y)
sed -e '/^#/d' -e '/^ *$$/d' $(DOTCONFIG) >> $(obj)/config.tmp ; \
$(CBFSTOOL) $@.tmp add $(obj)/config.tmp config raw; rm -f $(obj)/config.tmp ; fi
+ @printf " CPU uCode cpu_microcode\n"
+ $(CBFSTOOL) $@.tmp add $(CONFIG_CPU_MICROCODE_FILE) cpu_microcode microcode
mv $@.tmp $@
@printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n"
$(CBFSTOOL) $@ print
diff --git a/src/cpu/Kconfig b/src/cpu/Kconfig
index 85e83d4..849b6f3 100644
@@ -62,3 +62,79 @@ config SSE2
with more efficient code if SSE2 instructions are available.
endif # ARCH_X86
+ default n
+ prompt "Include CPU microcode in CBFS"
+ default CPU_MICROCODE_CBFS_NONE
+ depends on EXPERT && CPU_MICROCODE_FROM_CBFS
+# bool "Generate from tree"
+ depends on CPU_MICROCODE_FROM_CBFS
+ bool "Include external microcode file"
+ Select this option if you want to include an external file containing
+ the CPU microcode. This will be included as a separate file in CBFS.
+ This option is only available for CPUs where loading microcode from
+ CBFS is implemented.
+ bool "None"
+ Select this option if you do not want CPU microcode included in CBFS.
+ Note that for some CPUs, the microcode is hard-coded into the source
+ tree and is not loaded from CBFS. In this case, microcode will still
+ be updated.
+ string "Path and filename of CPU microcode"
+ depends on CPU_MICROCODE_CBFS_EXTERNAL
+ default "microcode.bin"
+ The path and filename of the file containing the CPU microcode.
+# The following option lets us know that the CPU initialization code will check
+# for UPDATE_CPU_MICROCODE, and will not include any microcode updates in the
+# image if it detects this option.
+# This must only be selected by CPUs whose microcode update has been adjusted
+# to respect UPDATE_CPU_MICROCODE option.
+ default n
+ bool "Update CPU microcode"
+ default y
+ depends on EXPERT && RESPECTS_UPDATE_CPU_MICROCODE_OPTION
+ Select this to apply patches to the CPU microcode provided by the
+ vendor (without source), and distributed with coreboot, to address
+ issues in the CPU post production.
+ Microcode updates distributed with coreboot are not necessarily the
+ latest version available. Updates are only applied if they are newer
+ than the microcode already in the CPU.
+ Unselect this to let CPUs run with microcode as shipped from factory.
+ No binary microcode patches will be included in the coreboot image in
+ that case, which can help with creating an image for which complete
+ source code is available, which in turn might simplify license
+ Microcode updates intend to solve issues that have been discovered
+ after CPU production. The common case is that systems work as intended
+ with updated microcode, but we have also seen cases where issues were
+ solved by not applying the microcode updates.
+ Note that some operating system include these same microcode patches,
+ so you may need to also disable microcode updates in your operating
+ system in order for this option to matter.
diff --git a/src/cpu/amd/model_10xxx/Kconfig b/src/cpu/amd/model_10xxx/Kconfig
index 221d044..64ac850 100644
@@ -3,6 +3,7 @@ config CPU_AMD_MODEL_10XXX
+ select RESPECTS_UPDATE_CPU_MICROCODE_OPTION
@@ -51,36 +52,4 @@ config SET_FIDVID_CORE_RANGE
endif # SET_FIDVID
- default y
- bool "Update CPU microcode"
- default y
- depends on EXPERT && CPU_AMD_MODEL_10XXX
- Select this to apply patches to the CPU microcode provided by
- AMD without source, and distributed with coreboot, to address
- issues in the CPU post production.
- Microcode updates distributed with coreboot are not necessarily
- the latest version available from AMD. Updates are only applied
- if they are newer than the microcode already in your CPU.
- Unselect this to let Fam10h CPUs run with microcode as shipped
- from factory. No binary microcode patches will be included in the
- coreboot image in that case, which can help with creating an image
- for which complete source code is available, which in turn might
- simplify license compliance.
- Microcode updates intend to solve issues that have been discovered
- after CPU production. The common case is that systems work as
- intended with updated microcode, but we have also seen cases where
- issues were solved by not applying the microcode updates.
- Note that some operating system include these same microcode
- patches, so you may need to also disable microcode updates in
- your operating system in order for this option to matter.
endif # CPU_AMD_MODEL_10XXX
More information about the coreboot