return patch;
}
+static const char __initconst amd_cpio_path[] =
+ "kernel/x86/microcode/AuthenticAMD.bin";
+
static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops = {
.cpu_request_microcode = cpu_request_microcode,
.collect_cpu_info = collect_cpu_info,
.apply_microcode = apply_microcode,
.compare_patch = compare_patch,
+ .cpio_path = amd_cpio_path,
};
void __init ucode_probe_amd(struct microcode_ops *ops)
}
custom_param("ucode", parse_ucode);
+static struct microcode_ops __ro_after_init ucode_ops;
+
static void __init microcode_scan_module(struct boot_info *bi)
{
uint64_t *_blob_start;
unsigned long _blob_size;
struct cpio_data cd;
- const char *p = NULL;
int i;
ucode_blob.size = 0;
if ( !ucode_scan )
return;
- if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
- p = "kernel/x86/microcode/AuthenticAMD.bin";
- else if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
- p = "kernel/x86/microcode/GenuineIntel.bin";
- else
- return;
-
/*
* Try all modules and see whichever could be the microcode blob.
*/
}
cd.data = NULL;
cd.size = 0;
- cd = find_cpio_data(p, _blob_start, _blob_size);
+ cd = find_cpio_data(ucode_ops.cpio_path, _blob_start, _blob_size);
if ( cd.data )
{
ucode_blob.size = cd.size;
}
}
-static struct microcode_ops __ro_after_init ucode_ops;
-
static DEFINE_SPINLOCK(microcode_mutex);
DEFINE_PER_CPU(struct cpu_signature, cpu_sig);
return !(mcu_ctrl & MCU_CONTROL_DIS_MCU_LOAD);
}
+static const char __initconst intel_cpio_path[] =
+ "kernel/x86/microcode/GenuineIntel.bin";
+
static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = {
.cpu_request_microcode = cpu_request_microcode,
.collect_cpu_info = collect_cpu_info,
.apply_microcode = apply_microcode,
.compare_patch = compare_patch,
+ .cpio_path = intel_cpio_path,
};
void __init ucode_probe_intel(struct microcode_ops *ops)
*/
enum microcode_match_result (*compare_patch)(
const struct microcode_patch *new, const struct microcode_patch *old);
+
+ /*
+ * For Linux inird microcode compatibliity.
+ *
+ * The path where this vendor's microcode can be found in CPIO.
+ */
+ const char *cpio_path;
};
/*