0006-never-enable-cpu-microcode-even-if-told-to.patch 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. From 830f8f67dd6ffd4520272eab60ad8aba76a4d41f Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <leah@libreboot.org>
  3. Date: Thu, 12 Oct 2023 01:20:23 +0100
  4. Subject: [PATCH 6/9] never enable cpu microcode, even if told to
  5. Signed-off-by: Leah Rowe <leah@libreboot.org>
  6. ---
  7. src/cpu/Makefile.mk | 55 -----------------------------------
  8. src/cpu/intel/fit/Makefile.mk | 46 -----------------------------
  9. 2 files changed, 101 deletions(-)
  10. diff --git a/src/cpu/Makefile.mk b/src/cpu/Makefile.mk
  11. index 0afe454c1e..9ae3a107bd 100644
  12. --- a/src/cpu/Makefile.mk
  13. +++ b/src/cpu/Makefile.mk
  14. @@ -11,61 +11,6 @@ subdirs-$(CONFIG_ARCH_X86) += x86
  15. subdirs-$(CONFIG_CPU_QEMU_X86) += qemu-x86
  16. subdirs-$(CONFIG_CPU_POWER9) += power9
  17. -$(eval $(call create_class_compiler,cpu_microcode,x86_32))
  18. -################################################################################
  19. -## Rules for building the microcode blob in CBFS
  20. -################################################################################
  21. -
  22. -cbfs-files-$(CONFIG_USE_CPU_MICROCODE_CBFS_BINS) += cpu_microcode_blob.bin
  23. -
  24. -ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER),y)
  25. -cbfs-files-y += cpu_microcode_blob.bin
  26. -cpu_microcode_blob.bin-file = $(objgenerated)/microcode.bin
  27. -
  28. -$(objgenerated)/microcode.bin: $(call strip_quotes,$(CONFIG_CPU_MICROCODE_HEADER_FILES))
  29. - echo " util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin \"$(CONFIG_CPU_MICROCODE_HEADER_FILES)\""
  30. - util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin $(CONFIG_CPU_MICROCODE_HEADER_FILES)
  31. -endif
  32. -
  33. -ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS),y)
  34. -$(obj)/cpu_microcode_blob.bin: cpu_microcode_bins := $(call strip_quotes,$(CONFIG_CPU_UCODE_BINARIES))
  35. -endif
  36. -# otherwise `cpu_microcode_bins` should be filled by platform makefiles
  37. -
  38. -# We just mash all microcode binaries together into one binary to rule them all.
  39. -# This approach assumes that the microcode binaries are properly padded, and
  40. -# their headers specify the correct size. This works fairly well on isolatied
  41. -# updates, such as Intel and some AMD microcode, but won't work very well if the
  42. -# updates are wrapped in a container, like AMD's microcode update container. If
  43. -# there is only one microcode binary (i.e. one container), then we don't have
  44. -# this issue, and this rule will continue to work.
  45. -$(obj)/cpu_microcode_blob.bin: $$(wildcard $$(cpu_microcode_bins)) $(DOTCONFIG)
  46. - for bin in $(cpu_microcode_bins); do \
  47. - if [ ! -f "$$bin" ]; then \
  48. - echo "Microcode error: $$bin does not exist"; \
  49. - NO_MICROCODE_FILE=1; \
  50. - fi; \
  51. - done; \
  52. - if [ -n "$$NO_MICROCODE_FILE" ]; then \
  53. - if [ -z "$(CONFIG_USE_BLOBS)" ] && [ -n "$(CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS)" ]; then \
  54. - echo "Try enabling binary-only repository in Kconfig 'General setup' menu."; \
  55. - fi; \
  56. - false; \
  57. - fi
  58. - $(if $(cpu_microcode_bins),,false) # fail if no file is given at all
  59. - @printf " MICROCODE $(subst $(obj)/,,$(@))\n"
  60. - @echo $(cpu_microcode_bins)
  61. - cat $(cpu_microcode_bins) > $@
  62. -
  63. -cpu_microcode_blob.bin-file ?= $(obj)/cpu_microcode_blob.bin
  64. -cpu_microcode_blob.bin-type := microcode
  65. -# The AMD LPC SPI DMA controller requires source files to be 64 byte aligned.
  66. -ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA),y)
  67. -cpu_microcode_blob.bin-align := 64
  68. -else
  69. -cpu_microcode_blob.bin-align := 16
  70. -endif
  71. -
  72. ifneq ($(CONFIG_CPU_MICROCODE_CBFS_LOC),)
  73. cpu_microcode_blob.bin-COREBOOT-position := $(CONFIG_CPU_MICROCODE_CBFS_LOC)
  74. endif
  75. diff --git a/src/cpu/intel/fit/Makefile.mk b/src/cpu/intel/fit/Makefile.mk
  76. index f405c57744..a354595e85 100644
  77. --- a/src/cpu/intel/fit/Makefile.mk
  78. +++ b/src/cpu/intel/fit/Makefile.mk
  79. @@ -18,49 +18,3 @@ $(call add_intermediate, set_fit_ptr, $(IFITTOOL))
  80. $(IFITTOOL) -f $< -F -n intel_fit -r COREBOOT -c
  81. FIT_ENTRY=$(call strip_quotes, $(CONFIG_INTEL_TOP_SWAP_FIT_ENTRY_FMAP_REG))
  82. -
  83. -ifneq ($(CONFIG_UPDATE_IMAGE),y) # never update the bootblock
  84. -
  85. -ifneq ($(CONFIG_CPU_MICROCODE_CBFS_NONE)$(CONFIG_CPU_INTEL_MICROCODE_CBFS_SPLIT_BINS),y)
  86. -
  87. -$(call add_intermediate, add_mcu_fit, set_fit_ptr $(IFITTOOL))
  88. - @printf " UPDATE-FIT Microcode\n"
  89. - $(IFITTOOL) -f $< -a -n cpu_microcode_blob.bin -t 1 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) -r COREBOOT
  90. -
  91. -# Second FIT in TOP_SWAP bootblock
  92. -ifeq ($(CONFIG_INTEL_ADD_TOP_SWAP_BOOTBLOCK),y)
  93. -
  94. -$(call add_intermediate, set_ts_fit_ptr, $(IFITTOOL))
  95. - @printf " UPDATE-FIT Top Swap: set FIT pointer to table\n"
  96. - $(IFITTOOL) -f $< -F -n intel_fit_ts -r COREBOOT $(TS_OPTIONS)
  97. -
  98. -$(call add_intermediate, add_ts_mcu_fit, set_ts_fit_ptr $(IFITTOOL))
  99. - @printf " UPDATE-FIT Top Swap: Microcode\n"
  100. -ifneq ($(FIT_ENTRY),)
  101. - $(IFITTOOL) -f $< -A -n $(FIT_ENTRY) -t 1 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) $(TS_OPTIONS) -r COREBOOT
  102. -endif # FIT_ENTRY
  103. - $(IFITTOOL) -f $< -a -n cpu_microcode_blob.bin -t 1 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) $(TS_OPTIONS) -r COREBOOT
  104. -
  105. -cbfs-files-y += intel_fit_ts
  106. -intel_fit_ts-file := fit_table.c:struct
  107. -intel_fit_ts-type := intel_fit
  108. -intel_fit_ts-align := 16
  109. -
  110. -endif # CONFIG_INTEL_ADD_TOP_SWAP_BOOTBLOCK
  111. -
  112. -endif # CONFIG_CPU_MICROCODE_CBFS_NONE
  113. -
  114. -# Platform Boot Policy
  115. -ifeq ($(CONFIG_HAVE_PBP_BIN),y)
  116. -
  117. -cbfs-files-y += pbp.bin
  118. -pbp.bin-file := $(call strip_quotes,$(CONFIG_PBP_BIN_PATH))
  119. -pbp.bin-type := raw
  120. -
  121. -$(call add_intermediate, add_pbp_fit, set_fit_ptr $(IFITTOOL))
  122. - @printf " UPDATE-FIT Platform Boot Policy binary\n"
  123. - $(IFITTOOL) -f $< -a -n pbp.bin -t 4 -s $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES) -r COREBOOT
  124. -
  125. -endif # CONFIG_HAVE_PBP_BIN
  126. -
  127. -endif # CONFIG_UPDATE_IMAGE
  128. --
  129. 2.39.5