Commit 0ccb8568 authored by Aichun Shi's avatar Aichun Shi
Browse files

Revert "x86/microcode: Default-disable late loading"

Intel inclusion
category: feature
feature: Backport Intel In Field Scan(IFS) multi-blob images support
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I6L337


CVE: N/A
Reference: N/A

Intel-SIG: Revert commit f5a968e7 ("x86/microcode: Default-disable
late loading")

-------------------------------------

This reverts commit f5a968e7.

This revert is to re-enable microcode late loading.

Signed-off-by: default avatarAichun Shi <aichun.shi@intel.com>
parent 764b9fb9
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -1336,17 +1336,6 @@ config MICROCODE_AMD
	  If you select this option, microcode patch loading support for AMD
	  processors will be enabled.

config MICROCODE_LATE_LOADING
	bool "Late microcode loading (DANGEROUS)"
	default n
	depends on MICROCODE
	help
	  Loading microcode late, when the system is up and executing instructions
	  is a tricky business and should be avoided if possible. Just the sequence
	  of synchronizing all cores and SMT threads is one fragile dance which does
	  not guarantee that cores might not softlock after the loading. Therefore,
	  use this at your own risk. Late loading taints the kernel too.

config X86_MSR
	tristate "/dev/cpu/*/msr - Model-specific register support"
	help
+0 −2
Original line number Diff line number Diff line
@@ -2145,7 +2145,6 @@ void cpu_init(void)
	load_fixmap_gdt(cpu);
}

#ifdef CONFIG_MICROCODE_LATE_LOADING
/*
 * The microcode loader calls this upon late microcode load to recheck features,
 * only when microcode has been updated. Caller holds microcode_mutex and CPU
@@ -2175,7 +2174,6 @@ void microcode_check(void)
	pr_warn("x86/CPU: CPU features have changed after loading microcode, but might not take effect.\n");
	pr_warn("x86/CPU: Please consider either early loading through initrd/built-in or a potential BIOS update.\n");
}
#endif

/*
 * Invoked from core CPU hotplug code after hotplug operations
+1 −6
Original line number Diff line number Diff line
@@ -393,7 +393,6 @@ static int apply_microcode_on_target(int cpu)
/* fake device for request_firmware */
static struct platform_device	*microcode_pdev;

#ifdef CONFIG_MICROCODE_LATE_LOADING
/*
 * Late loading dance. Why the heavy-handed stomp_machine effort?
 *
@@ -561,9 +560,6 @@ static ssize_t reload_store(struct device *dev,
	return ret;
}

static DEVICE_ATTR_WO(reload);
#endif

static ssize_t version_show(struct device *dev,
			struct device_attribute *attr, char *buf)
{
@@ -580,6 +576,7 @@ static ssize_t pf_show(struct device *dev,
	return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
}

static DEVICE_ATTR_WO(reload);
static DEVICE_ATTR(version, 0444, version_show, NULL);
static DEVICE_ATTR(processor_flags, 0444, pf_show, NULL);

@@ -732,9 +729,7 @@ static int mc_cpu_down_prep(unsigned int cpu)
}

static struct attribute *cpu_root_microcode_attrs[] = {
#ifdef CONFIG_MICROCODE_LATE_LOADING
	&dev_attr_reload.attr,
#endif
	NULL
};