forked from rpms/kernel
89 lines
2.9 KiB
Diff
89 lines
2.9 KiB
Diff
From a385d6a4761819826f5fb234415f4f1ad43fc141 Mon Sep 17 00:00:00 2001
|
|
From: Borislav Petkov <bp@suse.de>
|
|
Date: Mon, 19 Dec 2022 22:06:55 +0100
|
|
Subject: [PATCH 11/36] x86/microcode/AMD: Rename a couple of functions
|
|
|
|
- Rename apply_microcode_early_amd() to early_apply_microcode():
|
|
simplify the name so that it is clear what it does and when does it do
|
|
it.
|
|
|
|
- Rename __load_ucode_amd() to find_blobs_in_containers(): the new name
|
|
actually explains what it does.
|
|
|
|
Document some.
|
|
|
|
No functional changes.
|
|
|
|
Signed-off-by: Borislav Petkov <bp@suse.de>
|
|
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
|
|
Link: https://lore.kernel.org/r/20221219210656.5140-1-bp@alien8.de
|
|
(cherry picked from commit 61de9b7036f26448a1916291c456f62dd6bf07ea)
|
|
Signed-off-by: Mridula Shastry <mridula.c.shastry@oracle.com>
|
|
Reviewed-by: Todd Vierling <todd.vierling@oracle.com>
|
|
---
|
|
arch/x86/kernel/cpu/microcode/amd.c | 14 +++++++-------
|
|
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
|
|
index 750889d77b56..0b557d04be22 100644
|
|
--- a/arch/x86/kernel/cpu/microcode/amd.c
|
|
+++ b/arch/x86/kernel/cpu/microcode/amd.c
|
|
@@ -415,8 +415,7 @@ static int __apply_microcode_amd(struct microcode_amd *mc)
|
|
*
|
|
* Returns true if container found (sets @desc), false otherwise.
|
|
*/
|
|
-static bool
|
|
-apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, bool save_patch)
|
|
+static bool early_apply_microcode(u32 cpuid_1_eax, void *ucode, size_t size, bool save_patch)
|
|
{
|
|
struct cont_desc desc = { 0 };
|
|
u8 (*patch)[PATCH_MAX_SIZE];
|
|
@@ -476,7 +475,7 @@ static bool get_builtin_microcode(struct cpio_data *cp, unsigned int family)
|
|
#endif
|
|
}
|
|
|
|
-static void __load_ucode_amd(unsigned int cpuid_1_eax, struct cpio_data *ret)
|
|
+static void find_blobs_in_containers(unsigned int cpuid_1_eax, struct cpio_data *ret)
|
|
{
|
|
struct ucode_cpu_info *uci;
|
|
struct cpio_data cp;
|
|
@@ -506,11 +505,11 @@ void __init load_ucode_amd_bsp(unsigned int cpuid_1_eax)
|
|
{
|
|
struct cpio_data cp = { };
|
|
|
|
- __load_ucode_amd(cpuid_1_eax, &cp);
|
|
+ find_blobs_in_containers(cpuid_1_eax, &cp);
|
|
if (!(cp.data && cp.size))
|
|
return;
|
|
|
|
- apply_microcode_early_amd(cpuid_1_eax, cp.data, cp.size, true);
|
|
+ early_apply_microcode(cpuid_1_eax, cp.data, cp.size, true);
|
|
}
|
|
|
|
void load_ucode_amd_ap(unsigned int cpuid_1_eax)
|
|
@@ -541,11 +540,11 @@ void load_ucode_amd_ap(unsigned int cpuid_1_eax)
|
|
}
|
|
}
|
|
|
|
- __load_ucode_amd(cpuid_1_eax, &cp);
|
|
+ find_blobs_in_containers(cpuid_1_eax, &cp);
|
|
if (!(cp.data && cp.size))
|
|
return;
|
|
|
|
- apply_microcode_early_amd(cpuid_1_eax, cp.data, cp.size, false);
|
|
+ early_apply_microcode(cpuid_1_eax, cp.data, cp.size, false);
|
|
}
|
|
|
|
static enum ucode_state
|
|
@@ -810,6 +809,7 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover,
|
|
return 0;
|
|
}
|
|
|
|
+/* Scan the blob in @data and add microcode patches to the cache. */
|
|
static enum ucode_state __load_microcode_amd(u8 family, const u8 *data,
|
|
size_t size)
|
|
{
|
|
--
|
|
2.39.3
|
|
|