diff options
author | Borislav Petkov <bp@suse.de> | 2015-02-10 05:28:23 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-03-02 14:32:13 -0500 |
commit | e3d8f6747663b468ccedb8af0f38f2be82874c63 (patch) | |
tree | 049e3b703d7638eee2c70b129749a7a942a9dcb7 | |
parent | 9e02bb46d366b3635da966e29c5a53920ee7fde8 (diff) |
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: Borislav Petkov <bp@suse.de>
-rw-r--r-- | arch/x86/include/asm/microcode_intel.h | 5 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel_early.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel_lib.c | 16 |
4 files changed, 14 insertions, 17 deletions
diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h index a6b753a131cd..2b9209c46ca9 100644 --- a/arch/x86/include/asm/microcode_intel.h +++ b/arch/x86/include/asm/microcode_intel.h | |||
@@ -56,10 +56,9 @@ struct extended_sigtable { | |||
56 | 56 | ||
57 | #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE) | 57 | #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE) |
58 | 58 | ||
59 | extern int | 59 | extern int get_matching_microcode(unsigned int csig, int cpf, int rev, void *mc); |
60 | get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev); | ||
61 | extern int microcode_sanity_check(void *mc, int print_err); | 60 | extern int microcode_sanity_check(void *mc, int print_err); |
62 | extern int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev); | 61 | extern int get_matching_sig(unsigned int csig, int cpf, int rev, void *mc); |
63 | 62 | ||
64 | static inline int | 63 | static inline int |
65 | revision_is_newer(struct microcode_header_intel *mc_header, int rev) | 64 | revision_is_newer(struct microcode_header_intel *mc_header, int rev) |
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index 746e7fd08aad..a41beadb3db9 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c | |||
@@ -124,7 +124,7 @@ static int get_matching_mc(struct microcode_intel *mc_intel, int cpu) | |||
124 | cpf = cpu_sig.pf; | 124 | cpf = cpu_sig.pf; |
125 | crev = cpu_sig.rev; | 125 | crev = cpu_sig.rev; |
126 | 126 | ||
127 | return get_matching_microcode(csig, cpf, mc_intel, crev); | 127 | return get_matching_microcode(csig, cpf, crev, mc_intel); |
128 | } | 128 | } |
129 | 129 | ||
130 | static int apply_microcode_intel(int cpu) | 130 | 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 | 226 | ||
227 | csig = uci->cpu_sig.sig; | 227 | csig = uci->cpu_sig.sig; |
228 | cpf = uci->cpu_sig.pf; | 228 | cpf = uci->cpu_sig.pf; |
229 | if (get_matching_microcode(csig, cpf, mc, new_rev)) { | 229 | if (get_matching_microcode(csig, cpf, new_rev, mc)) { |
230 | vfree(new_mc); | 230 | vfree(new_mc); |
231 | new_rev = mc_header.rev; | 231 | new_rev = mc_header.rev; |
232 | new_mc = mc; | 232 | new_mc = mc; |
diff --git a/arch/x86/kernel/cpu/microcode/intel_early.c b/arch/x86/kernel/cpu/microcode/intel_early.c index d7192124f50b..844c75895160 100644 --- a/arch/x86/kernel/cpu/microcode/intel_early.c +++ b/arch/x86/kernel/cpu/microcode/intel_early.c | |||
@@ -50,8 +50,8 @@ load_microcode_early(struct microcode_intel **saved, | |||
50 | 50 | ||
51 | ret = get_matching_microcode(uci->cpu_sig.sig, | 51 | ret = get_matching_microcode(uci->cpu_sig.sig, |
52 | uci->cpu_sig.pf, | 52 | uci->cpu_sig.pf, |
53 | ucode_ptr, | 53 | new_rev, |
54 | new_rev); | 54 | ucode_ptr); |
55 | if (!ret) | 55 | if (!ret) |
56 | continue; | 56 | continue; |
57 | 57 | ||
@@ -251,7 +251,7 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved, | |||
251 | pf = mc_saved_hdr->pf; | 251 | pf = mc_saved_hdr->pf; |
252 | new_rev = mc_hdr->rev; | 252 | new_rev = mc_hdr->rev; |
253 | 253 | ||
254 | if (!get_matching_sig(sig, pf, ucode_ptr, new_rev)) | 254 | if (!get_matching_sig(sig, pf, new_rev, ucode_ptr)) |
255 | continue; | 255 | continue; |
256 | 256 | ||
257 | found = 1; | 257 | found = 1; |
diff --git a/arch/x86/kernel/cpu/microcode/intel_lib.c b/arch/x86/kernel/cpu/microcode/intel_lib.c index 7e259d99b0aa..cd47a510a3f1 100644 --- a/arch/x86/kernel/cpu/microcode/intel_lib.c +++ b/arch/x86/kernel/cpu/microcode/intel_lib.c | |||
@@ -122,10 +122,9 @@ int microcode_sanity_check(void *mc, int print_err) | |||
122 | EXPORT_SYMBOL_GPL(microcode_sanity_check); | 122 | EXPORT_SYMBOL_GPL(microcode_sanity_check); |
123 | 123 | ||
124 | /* | 124 | /* |
125 | * return 0 - no update found | 125 | * Returns 1 if update has been found, 0 otherwise. |
126 | * return 1 - found update | ||
127 | */ | 126 | */ |
128 | int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev) | 127 | int get_matching_sig(unsigned int csig, int cpf, int rev, void *mc) |
129 | { | 128 | { |
130 | struct microcode_header_intel *mc_header = mc; | 129 | struct microcode_header_intel *mc_header = mc; |
131 | struct extended_sigtable *ext_header; | 130 | struct extended_sigtable *ext_header; |
@@ -153,16 +152,15 @@ int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev) | |||
153 | } | 152 | } |
154 | 153 | ||
155 | /* | 154 | /* |
156 | * return 0 - no update found | 155 | * Returns 1 if update has been found, 0 otherwise. |
157 | * return 1 - found update | ||
158 | */ | 156 | */ |
159 | int get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev) | 157 | int get_matching_microcode(unsigned int csig, int cpf, int rev, void *mc) |
160 | { | 158 | { |
161 | struct microcode_header_intel *mc_header = mc; | 159 | struct microcode_header_intel *mc_hdr = mc; |
162 | 160 | ||
163 | if (!revision_is_newer(mc_header, rev)) | 161 | if (!revision_is_newer(mc_hdr, rev)) |
164 | return 0; | 162 | return 0; |
165 | 163 | ||
166 | return get_matching_sig(csig, cpf, mc, rev); | 164 | return get_matching_sig(csig, cpf, rev, mc); |
167 | } | 165 | } |
168 | EXPORT_SYMBOL_GPL(get_matching_microcode); | 166 | EXPORT_SYMBOL_GPL(get_matching_microcode); |