Skip to content

Commit e6bcfdd

Browse files
KAGA-KOKObp3tk0v
authored andcommitted
x86/microcode: Hide the config knob
In reality CONFIG_MICROCODE is enabled in any reasonable configuration when Intel or AMD support is enabled. Accommodate to reality. Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e5a8192 commit e6bcfdd

File tree

5 files changed

+8
-44
lines changed

5 files changed

+8
-44
lines changed

arch/x86/Kconfig

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,44 +1308,8 @@ config X86_REBOOTFIXUPS
13081308
Say N otherwise.
13091309

13101310
config MICROCODE
1311-
bool "CPU microcode loading support"
1312-
default y
1311+
def_bool y
13131312
depends on CPU_SUP_AMD || CPU_SUP_INTEL
1314-
help
1315-
If you say Y here, you will be able to update the microcode on
1316-
Intel and AMD processors. The Intel support is for the IA32 family,
1317-
e.g. Pentium Pro, Pentium II, Pentium III, Pentium 4, Xeon etc. The
1318-
AMD support is for families 0x10 and later. You will obviously need
1319-
the actual microcode binary data itself which is not shipped with
1320-
the Linux kernel.
1321-
1322-
The preferred method to load microcode from a detached initrd is described
1323-
in Documentation/arch/x86/microcode.rst. For that you need to enable
1324-
CONFIG_BLK_DEV_INITRD in order for the loader to be able to scan the
1325-
initrd for microcode blobs.
1326-
1327-
In addition, you can build the microcode into the kernel. For that you
1328-
need to add the vendor-supplied microcode to the CONFIG_EXTRA_FIRMWARE
1329-
config option.
1330-
1331-
config MICROCODE_INTEL
1332-
bool "Intel microcode loading support"
1333-
depends on CPU_SUP_INTEL && MICROCODE
1334-
default MICROCODE
1335-
help
1336-
This options enables microcode patch loading support for Intel
1337-
processors.
1338-
1339-
For the current Intel microcode data package go to
1340-
<https://downloadcenter.intel.com> and search for
1341-
'Linux Processor Microcode Data File'.
1342-
1343-
config MICROCODE_AMD
1344-
bool "AMD microcode loading support"
1345-
depends on CPU_SUP_AMD && MICROCODE
1346-
help
1347-
If you select this option, microcode patch loading support for AMD
1348-
processors will be enabled.
13491313

13501314
config MICROCODE_LATE_LOADING
13511315
bool "Late microcode loading (DANGEROUS)"

arch/x86/include/asm/microcode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ struct ucode_cpu_info {
5454
extern struct ucode_cpu_info ucode_cpu_info[];
5555
struct cpio_data find_microcode_in_initrd(const char *path, bool use_pa);
5656

57-
#ifdef CONFIG_MICROCODE_INTEL
57+
#ifdef CONFIG_CPU_SUP_INTEL
5858
extern struct microcode_ops * __init init_intel_microcode(void);
5959
#else
6060
static inline struct microcode_ops * __init init_intel_microcode(void)
6161
{
6262
return NULL;
6363
}
64-
#endif /* CONFIG_MICROCODE_INTEL */
64+
#endif /* CONFIG_CPU_SUP_INTEL */
6565

66-
#ifdef CONFIG_MICROCODE_AMD
66+
#ifdef CONFIG_CPU_SUP_AMD
6767
extern struct microcode_ops * __init init_amd_microcode(void);
6868
extern void __exit exit_amd_microcode(void);
6969
#else

arch/x86/include/asm/microcode_amd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct microcode_amd {
4343

4444
#define PATCH_MAX_SIZE (3 * PAGE_SIZE)
4545

46-
#ifdef CONFIG_MICROCODE_AMD
46+
#ifdef CONFIG_CPU_SUP_AMD
4747
extern void load_ucode_amd_early(unsigned int cpuid_1_eax);
4848
extern int __init save_microcode_in_initrd_amd(unsigned int family);
4949
void reload_ucode_amd(unsigned int cpu);

arch/x86/include/asm/microcode_intel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static inline u32 intel_get_microcode_revision(void)
7171
return rev;
7272
}
7373

74-
#ifdef CONFIG_MICROCODE_INTEL
74+
#ifdef CONFIG_CPU_SUP_INTEL
7575
extern void __init load_ucode_intel_bsp(void);
7676
extern void load_ucode_intel_ap(void);
7777
extern void show_ucode_info_early(void);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
microcode-y := core.o
33
obj-$(CONFIG_MICROCODE) += microcode.o
4-
microcode-$(CONFIG_MICROCODE_INTEL) += intel.o
5-
microcode-$(CONFIG_MICROCODE_AMD) += amd.o
4+
microcode-$(CONFIG_CPU_SUP_INTEL) += intel.o
5+
microcode-$(CONFIG_CPU_SUP_AMD) += amd.o

0 commit comments

Comments
 (0)