x86/ucode: Drop ops->match_cpu()

It turns out there are no callers of the hook().  The only callers are the
local, which can easily be rearranged to use the appropriate internal helper.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2020-04-03 20:11:46 +01:00
1 parent c81fb4e4a3
commit 62d7b32df7
3 files changed
+2 -23

No files matched your search

+1 -7
View File
@@ -188,11 +188,6 @@ static enum microcode_match_result microcode_fits(
return NEW_UCODE;
}
static bool match_cpu(const struct microcode_patch *patch)
{
return patch && (microcode_fits(patch) == NEW_UCODE);
}
static void free_patch(struct microcode_patch *patch)
{
xfree(patch);
@@ -227,7 +222,7 @@ static int apply_microcode(const struct microcode_patch *patch)
if ( !patch )
return -ENOENT;
if ( !match_cpu(patch) )
if ( microcode_fits(patch) != NEW_UCODE )
return -EINVAL;
if ( check_final_patch_levels(sig) )
@@ -428,5 +423,4 @@ const struct microcode_ops amd_ucode_ops = {
#endif
.free_patch = free_patch,
.compare_patch = compare_patch,
.match_cpu = match_cpu,
};
+1 -10
View File
@@ -245,14 +245,6 @@ static enum microcode_match_result microcode_update_match(
return mc->rev > cpu_sig->rev ? NEW_UCODE : OLD_UCODE;
}
static bool match_cpu(const struct microcode_patch *patch)
{
if ( !patch )
return false;
return microcode_update_match(patch) == NEW_UCODE;
}
static void free_patch(struct microcode_patch *patch)
{
xfree(patch);
@@ -281,7 +273,7 @@ static int apply_microcode(const struct microcode_patch *patch)
if ( !patch )
return -ENOENT;
if ( !match_cpu(patch) )
if ( microcode_update_match(patch) != NEW_UCODE )
return -EINVAL;
/* write microcode via MSR 0x79 */
@@ -369,5 +361,4 @@ const struct microcode_ops intel_ucode_ops = {
.apply_microcode = apply_microcode,
.free_patch = free_patch,
.compare_patch = compare_patch,
.match_cpu = match_cpu,
};
-6
View File
@@ -59,12 +59,6 @@ struct microcode_ops {
/* Free a patch previously allocated by cpu_request_microcode(). */
void (*free_patch)(struct microcode_patch *patch);
/*
* Is the microcode patch applicable for the current CPU, and newer than
* the currently running patch?
*/
bool (*match_cpu)(const struct microcode_patch *patch);
/*
* Given two patches, are they both applicable to the current CPU, and is
* new a higher revision than old?
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.