Skip to content

Commit da0aa3d

Browse files
suryasaimadhuKAGA-KOKO
authored andcommitted
x86/microcode/AMD: Remove struct cont_desc.eq_id
The equivalence ID was needed outside of the container scanning logic but now, after this has been cleaned up, not anymore. Now, cont_desc.mc is used to denote whether the container we're looking at has the proper microcode patch for this CPU or not. Signed-off-by: Borislav Petkov <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent 69f5f98 commit da0aa3d

File tree

1 file changed

+4
-10
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+4
-10
lines changed

arch/x86/kernel/cpu/microcode/amd.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ struct cont_desc {
4949
struct microcode_amd *mc;
5050
u32 cpuid_1_eax;
5151
u32 psize;
52-
u16 eq_id;
5352
u8 *data;
5453
size_t size;
5554
};
@@ -92,10 +91,8 @@ static ssize_t parse_container(u8 *ucode, ssize_t size, struct cont_desc *desc)
9291
/* Am I looking at an equivalence table header? */
9392
if (hdr[0] != UCODE_MAGIC ||
9493
hdr[1] != UCODE_EQUIV_CPU_TABLE_TYPE ||
95-
hdr[2] == 0) {
96-
desc->eq_id = 0;
94+
hdr[2] == 0)
9795
return CONTAINER_HDR_SZ;
98-
}
9996

10097
buf = ucode;
10198

@@ -147,9 +144,8 @@ static ssize_t parse_container(u8 *ucode, ssize_t size, struct cont_desc *desc)
147144
* buffer.
148145
*/
149146
if (desc->mc) {
150-
desc->eq_id = eq_id;
151-
desc->data = ucode;
152-
desc->size = orig_size - size;
147+
desc->data = ucode;
148+
desc->size = orig_size - size;
153149

154150
return 0;
155151
}
@@ -220,8 +216,6 @@ apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, bool save_p
220216
desc.cpuid_1_eax = cpuid_1_eax;
221217

222218
scan_containers(ucode, size, &desc);
223-
if (!desc.eq_id)
224-
return ret;
225219

226220
mc = desc.mc;
227221
if (!mc)
@@ -341,7 +335,7 @@ int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax)
341335
desc.cpuid_1_eax = cpuid_1_eax;
342336

343337
scan_containers(cp.data, cp.size, &desc);
344-
if (!desc.eq_id)
338+
if (!desc.mc)
345339
return -EINVAL;
346340

347341
ret = load_microcode_amd(smp_processor_id(), x86_family(cpuid_1_eax),

0 commit comments

Comments
 (0)