Commit e3d8f674 authored by Borislav Petkov's avatar Borislav Petkov

x86/microcode/intel: Move mc arg last in get_matching_{microcode|sig}

... arguments list so that it comes more natural for those functions to
have the signature, processor flags and revision together, before the
rest of the args.

No functionality change.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
parent 9e02bb46
...@@ -56,10 +56,9 @@ struct extended_sigtable { ...@@ -56,10 +56,9 @@ struct extended_sigtable {
#define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE) #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE)
extern int extern int get_matching_microcode(unsigned int csig, int cpf, int rev, void *mc);
get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev);
extern int microcode_sanity_check(void *mc, int print_err); extern int microcode_sanity_check(void *mc, int print_err);
extern int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev); extern int get_matching_sig(unsigned int csig, int cpf, int rev, void *mc);
static inline int static inline int
revision_is_newer(struct microcode_header_intel *mc_header, int rev) revision_is_newer(struct microcode_header_intel *mc_header, int rev)
......
...@@ -124,7 +124,7 @@ static int get_matching_mc(struct microcode_intel *mc_intel, int cpu) ...@@ -124,7 +124,7 @@ static int get_matching_mc(struct microcode_intel *mc_intel, int cpu)
cpf = cpu_sig.pf; cpf = cpu_sig.pf;
crev = cpu_sig.rev; crev = cpu_sig.rev;
return get_matching_microcode(csig, cpf, mc_intel, crev); return get_matching_microcode(csig, cpf, crev, mc_intel);
} }
static int apply_microcode_intel(int cpu) static int apply_microcode_intel(int cpu)
...@@ -226,7 +226,7 @@ static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size, ...@@ -226,7 +226,7 @@ static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
csig = uci->cpu_sig.sig; csig = uci->cpu_sig.sig;
cpf = uci->cpu_sig.pf; cpf = uci->cpu_sig.pf;
if (get_matching_microcode(csig, cpf, mc, new_rev)) { if (get_matching_microcode(csig, cpf, new_rev, mc)) {
vfree(new_mc); vfree(new_mc);
new_rev = mc_header.rev; new_rev = mc_header.rev;
new_mc = mc; new_mc = mc;
......
...@@ -50,8 +50,8 @@ load_microcode_early(struct microcode_intel **saved, ...@@ -50,8 +50,8 @@ load_microcode_early(struct microcode_intel **saved,
ret = get_matching_microcode(uci->cpu_sig.sig, ret = get_matching_microcode(uci->cpu_sig.sig,
uci->cpu_sig.pf, uci->cpu_sig.pf,
ucode_ptr, new_rev,
new_rev); ucode_ptr);
if (!ret) if (!ret)
continue; continue;
...@@ -251,7 +251,7 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved, ...@@ -251,7 +251,7 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved,
pf = mc_saved_hdr->pf; pf = mc_saved_hdr->pf;
new_rev = mc_hdr->rev; new_rev = mc_hdr->rev;
if (!get_matching_sig(sig, pf, ucode_ptr, new_rev)) if (!get_matching_sig(sig, pf, new_rev, ucode_ptr))
continue; continue;
found = 1; found = 1;
......
...@@ -122,10 +122,9 @@ int microcode_sanity_check(void *mc, int print_err) ...@@ -122,10 +122,9 @@ int microcode_sanity_check(void *mc, int print_err)
EXPORT_SYMBOL_GPL(microcode_sanity_check); EXPORT_SYMBOL_GPL(microcode_sanity_check);
/* /*
* return 0 - no update found * Returns 1 if update has been found, 0 otherwise.
* return 1 - found update
*/ */
int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev) int get_matching_sig(unsigned int csig, int cpf, int rev, void *mc)
{ {
struct microcode_header_intel *mc_header = mc; struct microcode_header_intel *mc_header = mc;
struct extended_sigtable *ext_header; struct extended_sigtable *ext_header;
...@@ -153,16 +152,15 @@ int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev) ...@@ -153,16 +152,15 @@ int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev)
} }
/* /*
* return 0 - no update found * Returns 1 if update has been found, 0 otherwise.
* return 1 - found update
*/ */
int get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev) int get_matching_microcode(unsigned int csig, int cpf, int rev, void *mc)
{ {
struct microcode_header_intel *mc_header = mc; struct microcode_header_intel *mc_hdr = mc;
if (!revision_is_newer(mc_header, rev)) if (!revision_is_newer(mc_hdr, rev))
return 0; return 0;
return get_matching_sig(csig, cpf, mc, rev); return get_matching_sig(csig, cpf, rev, mc);
} }
EXPORT_SYMBOL_GPL(get_matching_microcode); EXPORT_SYMBOL_GPL(get_matching_microcode);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment