aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/microcode_intel.h8
-rw-r--r--arch/x86/kernel/cpu/microcode/intel_early.c2
-rw-r--r--arch/x86/kernel/cpu/microcode/intel_lib.c8
3 files changed, 8 insertions, 10 deletions
diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h
index dd4c20043ce7..a6b753a131cd 100644
--- a/arch/x86/include/asm/microcode_intel.h
+++ b/arch/x86/include/asm/microcode_intel.h
@@ -60,8 +60,12 @@ extern int
60get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev); 60get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev);
61extern int microcode_sanity_check(void *mc, int print_err); 61extern int microcode_sanity_check(void *mc, int print_err);
62extern int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev); 62extern int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev);
63extern int 63
64update_match_revision(struct microcode_header_intel *mc_header, int rev); 64static inline int
65revision_is_newer(struct microcode_header_intel *mc_header, int rev)
66{
67 return (mc_header->rev <= rev) ? 0 : 1;
68}
65 69
66#ifdef CONFIG_MICROCODE_INTEL_EARLY 70#ifdef CONFIG_MICROCODE_INTEL_EARLY
67extern void __init load_ucode_intel_bsp(void); 71extern void __init load_ucode_intel_bsp(void);
diff --git a/arch/x86/kernel/cpu/microcode/intel_early.c b/arch/x86/kernel/cpu/microcode/intel_early.c
index 94ec304b7af3..cd42b3a55897 100644
--- a/arch/x86/kernel/cpu/microcode/intel_early.c
+++ b/arch/x86/kernel/cpu/microcode/intel_early.c
@@ -285,7 +285,7 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved,
285 285
286 found = 1; 286 found = 1;
287 287
288 if (!update_match_revision(mc_hdr, new_rev)) 288 if (!revision_is_newer(mc_hdr, new_rev))
289 continue; 289 continue;
290 290
291 /* 291 /*
diff --git a/arch/x86/kernel/cpu/microcode/intel_lib.c b/arch/x86/kernel/cpu/microcode/intel_lib.c
index ce69320d0179..7e259d99b0aa 100644
--- a/arch/x86/kernel/cpu/microcode/intel_lib.c
+++ b/arch/x86/kernel/cpu/microcode/intel_lib.c
@@ -38,12 +38,6 @@ update_match_cpu(unsigned int csig, unsigned int cpf,
38 return (!sigmatch(sig, csig, pf, cpf)) ? 0 : 1; 38 return (!sigmatch(sig, csig, pf, cpf)) ? 0 : 1;
39} 39}
40 40
41int
42update_match_revision(struct microcode_header_intel *mc_header, int rev)
43{
44 return (mc_header->rev <= rev) ? 0 : 1;
45}
46
47int microcode_sanity_check(void *mc, int print_err) 41int microcode_sanity_check(void *mc, int print_err)
48{ 42{
49 unsigned long total_size, data_size, ext_table_size; 43 unsigned long total_size, data_size, ext_table_size;
@@ -166,7 +160,7 @@ int get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev)
166{ 160{
167 struct microcode_header_intel *mc_header = mc; 161 struct microcode_header_intel *mc_header = mc;
168 162
169 if (!update_match_revision(mc_header, rev)) 163 if (!revision_is_newer(mc_header, rev))
170 return 0; 164 return 0;
171 165
172 return get_matching_sig(csig, cpf, mc, rev); 166 return get_matching_sig(csig, cpf, mc, rev);