Commit f2b3ee82 authored by Jacob Shin's avatar Jacob Shin Committed by H. Peter Anvin

x86, microcode: Vendor abstract out save_microcode_in_initrd()

Currently save_microcode_in_initrd() is declared in vendor neutural
microcode.h file, but defined in vendor specific
microcode_intel_early.c file. Vendor abstract it out to
microcode_core_early.c with a wrapper function.
Signed-off-by: default avatarJacob Shin <jacob.shin@amd.com>
Link: http://lkml.kernel.org/r/1369940959-2077-3-git-send-email-jacob.shin@amd.comSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
parent 83b325f1
...@@ -67,10 +67,12 @@ update_match_revision(struct microcode_header_intel *mc_header, int rev); ...@@ -67,10 +67,12 @@ update_match_revision(struct microcode_header_intel *mc_header, int rev);
extern void __init load_ucode_intel_bsp(void); extern void __init load_ucode_intel_bsp(void);
extern void __cpuinit load_ucode_intel_ap(void); extern void __cpuinit load_ucode_intel_ap(void);
extern void show_ucode_info_early(void); extern void show_ucode_info_early(void);
extern int __init save_microcode_in_initrd_intel(void);
#else #else
static inline __init void load_ucode_intel_bsp(void) {} static inline __init void load_ucode_intel_bsp(void) {}
static inline __cpuinit void load_ucode_intel_ap(void) {} static inline __cpuinit void load_ucode_intel_ap(void) {}
static inline void show_ucode_info_early(void) {} static inline void show_ucode_info_early(void) {}
static inline int __init save_microcode_in_initrd_intel(void) { return -EINVAL; }
#endif #endif
#if defined(CONFIG_MICROCODE_INTEL_EARLY) && defined(CONFIG_HOTPLUG_CPU) #if defined(CONFIG_MICROCODE_INTEL_EARLY) && defined(CONFIG_HOTPLUG_CPU)
......
...@@ -98,3 +98,13 @@ void __cpuinit load_ucode_ap(void) ...@@ -98,3 +98,13 @@ void __cpuinit load_ucode_ap(void)
if (vendor == X86_VENDOR_INTEL && x86 >= 6) if (vendor == X86_VENDOR_INTEL && x86 >= 6)
load_ucode_intel_ap(); load_ucode_intel_ap();
} }
int __init save_microcode_in_initrd(void)
{
struct cpuinfo_x86 *c = &boot_cpu_data;
if (c->x86_vendor == X86_VENDOR_INTEL && c->x86 >= 6)
return save_microcode_in_initrd_intel();
return 0;
}
...@@ -699,7 +699,7 @@ static int __cpuinit apply_microcode_early(struct mc_saved_data *mc_saved_data, ...@@ -699,7 +699,7 @@ static int __cpuinit apply_microcode_early(struct mc_saved_data *mc_saved_data,
* This function converts microcode patch offsets previously stored in * This function converts microcode patch offsets previously stored in
* mc_saved_in_initrd to pointers and stores the pointers in mc_saved_data. * mc_saved_in_initrd to pointers and stores the pointers in mc_saved_data.
*/ */
int __init save_microcode_in_initrd(void) int __init save_microcode_in_initrd_intel(void)
{ {
unsigned int count = mc_saved_data.mc_saved_count; unsigned int count = mc_saved_data.mc_saved_count;
struct microcode_intel *mc_saved[MAX_UCODE_COUNT]; struct microcode_intel *mc_saved[MAX_UCODE_COUNT];
......
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