Skip to content
Snippets Groups Projects
Commit 78e0aadb authored by Borislav Petkov (AMD)'s avatar Borislav Petkov (AMD)
Browse files

x86/microcode/AMD: Have __apply_microcode_amd() return bool


This is the natural thing to do anyway.

No functional changes.

Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
parent d8317f3d
No related branches found
No related tags found
No related merge requests found
......@@ -484,7 +484,7 @@ static void scan_containers(u8 *ucode, size_t size, struct cont_desc *desc)
}
}
static int __apply_microcode_amd(struct microcode_amd *mc, unsigned int psize)
static bool __apply_microcode_amd(struct microcode_amd *mc, unsigned int psize)
{
unsigned long p_addr = (unsigned long)&mc->hdr.data_code;
u32 rev, dummy;
......@@ -508,9 +508,9 @@ static int __apply_microcode_amd(struct microcode_amd *mc, unsigned int psize)
native_rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
if (rev != mc->hdr.patch_id)
return -1;
return false;
return 0;
return true;
}
/*
......@@ -544,7 +544,7 @@ static bool early_apply_microcode(u32 old_rev, void *ucode, size_t size)
if (old_rev > mc->hdr.patch_id)
return ret;
return !__apply_microcode_amd(mc, desc.psize);
return __apply_microcode_amd(mc, desc.psize);
}
static bool get_builtin_microcode(struct cpio_data *cp)
......@@ -763,7 +763,7 @@ void reload_ucode_amd(unsigned int cpu)
rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
if (rev < mc->hdr.patch_id) {
if (!__apply_microcode_amd(mc, p->size))
if (__apply_microcode_amd(mc, p->size))
pr_info_once("reload revision: 0x%08x\n", mc->hdr.patch_id);
}
}
......@@ -816,7 +816,7 @@ static enum ucode_state apply_microcode_amd(int cpu)
goto out;
}
if (__apply_microcode_amd(mc_amd, p->size)) {
if (!__apply_microcode_amd(mc_amd, p->size)) {
pr_err("CPU%d: update failed for patch_level=0x%08x\n",
cpu, mc_amd->hdr.patch_id);
return UCODE_ERROR;
......
  • CI @project_6562_bot_3b694df01c2c1ffadb3454960c315475

    mentioned in commit eb50ccb8

    ·

    mentioned in commit eb50ccb8

    Toggle commit list
  • CI @project_6562_bot_3b694df01c2c1ffadb3454960c315475

    mentioned in commit e14b82eb

    ·

    mentioned in commit e14b82eb

    Toggle commit list
  • CI @project_6562_bot_3b694df01c2c1ffadb3454960c315475

    mentioned in commit be5a41a9

    ·

    mentioned in commit be5a41a9

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment