Commit da0aa3dd authored by Borislav Petkov's avatar Borislav Petkov Committed by Thomas Gleixner

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: default avatarBorislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/20170120202955.4091-17-bp@alien8.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 69f5f983
...@@ -49,7 +49,6 @@ struct cont_desc { ...@@ -49,7 +49,6 @@ struct cont_desc {
struct microcode_amd *mc; struct microcode_amd *mc;
u32 cpuid_1_eax; u32 cpuid_1_eax;
u32 psize; u32 psize;
u16 eq_id;
u8 *data; u8 *data;
size_t size; size_t size;
}; };
...@@ -92,10 +91,8 @@ static ssize_t parse_container(u8 *ucode, ssize_t size, struct cont_desc *desc) ...@@ -92,10 +91,8 @@ static ssize_t parse_container(u8 *ucode, ssize_t size, struct cont_desc *desc)
/* Am I looking at an equivalence table header? */ /* Am I looking at an equivalence table header? */
if (hdr[0] != UCODE_MAGIC || if (hdr[0] != UCODE_MAGIC ||
hdr[1] != UCODE_EQUIV_CPU_TABLE_TYPE || hdr[1] != UCODE_EQUIV_CPU_TABLE_TYPE ||
hdr[2] == 0) { hdr[2] == 0)
desc->eq_id = 0;
return CONTAINER_HDR_SZ; return CONTAINER_HDR_SZ;
}
buf = ucode; buf = ucode;
...@@ -147,9 +144,8 @@ static ssize_t parse_container(u8 *ucode, ssize_t size, struct cont_desc *desc) ...@@ -147,9 +144,8 @@ static ssize_t parse_container(u8 *ucode, ssize_t size, struct cont_desc *desc)
* buffer. * buffer.
*/ */
if (desc->mc) { if (desc->mc) {
desc->eq_id = eq_id; desc->data = ucode;
desc->data = ucode; desc->size = orig_size - size;
desc->size = orig_size - size;
return 0; return 0;
} }
...@@ -220,8 +216,6 @@ apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, bool save_p ...@@ -220,8 +216,6 @@ apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, bool save_p
desc.cpuid_1_eax = cpuid_1_eax; desc.cpuid_1_eax = cpuid_1_eax;
scan_containers(ucode, size, &desc); scan_containers(ucode, size, &desc);
if (!desc.eq_id)
return ret;
mc = desc.mc; mc = desc.mc;
if (!mc) if (!mc)
...@@ -341,7 +335,7 @@ int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax) ...@@ -341,7 +335,7 @@ int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax)
desc.cpuid_1_eax = cpuid_1_eax; desc.cpuid_1_eax = cpuid_1_eax;
scan_containers(cp.data, cp.size, &desc); scan_containers(cp.data, cp.size, &desc);
if (!desc.eq_id) if (!desc.mc)
return -EINVAL; return -EINVAL;
ret = load_microcode_amd(smp_processor_id(), x86_family(cpuid_1_eax), ret = load_microcode_amd(smp_processor_id(), x86_family(cpuid_1_eax),
......
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