Commit 8b0c0efc authored by Borislav Petkov's avatar Borislav Petkov Committed by Aichun Shi
Browse files

x86/microcode: Kill refresh_fw

mainline inclusion
from mainline-v6.2-rc1
commit a61ac80a
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: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/


commit/?id=a61ac80a

Intel-SIG: commit a61ac80a ("x86/microcode: Kill refresh_fw")

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

x86/microcode: Kill refresh_fw

request_microcode_fw() can always request firmware now so drop this
superfluous argument.

Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarAshok Raj <ashok.raj@intel.com>
Link: https://lore.kernel.org/r/20221028142638.28498-4-bp@alien8.de


Signed-off-by: default avatarAichun Shi <aichun.shi@intel.com>
parent 5071ec24
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -32,8 +32,7 @@ enum ucode_state {
};

struct microcode_ops {
	enum ucode_state (*request_microcode_fw) (int cpu, struct device *,
						  bool refresh_fw);
	enum ucode_state (*request_microcode_fw) (int cpu, struct device *);

	void (*microcode_fini_cpu) (int cpu);

+2 −3
Original line number Diff line number Diff line
@@ -885,8 +885,7 @@ load_microcode_amd(bool save, u8 family, const u8 *data, size_t size)
 *
 * These might be larger than 2K.
 */
static enum ucode_state request_microcode_amd(int cpu, struct device *device,
					      bool refresh_fw)
static enum ucode_state request_microcode_amd(int cpu, struct device *device)
{
	char fw_name[36] = "amd-ucode/microcode_amd.bin";
	struct cpuinfo_x86 *c = &cpu_data(cpu);
@@ -895,7 +894,7 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device,
	const struct firmware *fw;

	/* reload ucode container only on the boot cpu */
	if (!refresh_fw || !bsp)
	if (!bsp)
		return UCODE_OK;

	if (c->x86 >= 0x15)
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ static ssize_t reload_store(struct device *dev,
	if (ret)
		goto put;

	tmp_ret = microcode_ops->request_microcode_fw(bsp, &microcode_pdev->dev, true);
	tmp_ret = microcode_ops->request_microcode_fw(bsp, &microcode_pdev->dev);
	if (tmp_ret != UCODE_NEW)
		goto put;

+1 −2
Original line number Diff line number Diff line
@@ -878,8 +878,7 @@ static bool is_blacklisted(unsigned int cpu)
	return false;
}

static enum ucode_state request_microcode_fw(int cpu, struct device *device,
					     bool refresh_fw)
static enum ucode_state request_microcode_fw(int cpu, struct device *device)
{
	struct cpuinfo_x86 *c = &cpu_data(cpu);
	const struct firmware *firmware;