diff options
author | Jacob Shin <jacob.shin@amd.com> | 2013-05-30 15:09:17 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-05-30 23:19:25 -0400 |
commit | f2b3ee820a9f2368d7f8842ad7da062dfe86e199 (patch) | |
tree | 58d54ec7d50d69afd393b2e358253f798a71f952 | |
parent | 83b325f1b4d00035494bc18a7a131b2197b3c718 (diff) |
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: Jacob Shin <jacob.shin@amd.com>
Link: http://lkml.kernel.org/r/1369940959-2077-3-git-send-email-jacob.shin@amd.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
-rw-r--r-- | arch/x86/include/asm/microcode_intel.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/microcode_core_early.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/microcode_intel_early.c | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h index 5356f927d411..87a085333cbf 100644 --- a/arch/x86/include/asm/microcode_intel.h +++ b/arch/x86/include/asm/microcode_intel.h | |||
@@ -67,10 +67,12 @@ update_match_revision(struct microcode_header_intel *mc_header, int rev); | |||
67 | extern void __init load_ucode_intel_bsp(void); | 67 | extern void __init load_ucode_intel_bsp(void); |
68 | extern void __cpuinit load_ucode_intel_ap(void); | 68 | extern void __cpuinit load_ucode_intel_ap(void); |
69 | extern void show_ucode_info_early(void); | 69 | extern void show_ucode_info_early(void); |
70 | extern int __init save_microcode_in_initrd_intel(void); | ||
70 | #else | 71 | #else |
71 | static inline __init void load_ucode_intel_bsp(void) {} | 72 | static inline __init void load_ucode_intel_bsp(void) {} |
72 | static inline __cpuinit void load_ucode_intel_ap(void) {} | 73 | static inline __cpuinit void load_ucode_intel_ap(void) {} |
73 | static inline void show_ucode_info_early(void) {} | 74 | static inline void show_ucode_info_early(void) {} |
75 | static inline int __init save_microcode_in_initrd_intel(void) { return -EINVAL; } | ||
74 | #endif | 76 | #endif |
75 | 77 | ||
76 | #if defined(CONFIG_MICROCODE_INTEL_EARLY) && defined(CONFIG_HOTPLUG_CPU) | 78 | #if defined(CONFIG_MICROCODE_INTEL_EARLY) && defined(CONFIG_HOTPLUG_CPU) |
diff --git a/arch/x86/kernel/microcode_core_early.c b/arch/x86/kernel/microcode_core_early.c index 833d51d6ee06..0d19ac5016a7 100644 --- a/arch/x86/kernel/microcode_core_early.c +++ b/arch/x86/kernel/microcode_core_early.c | |||
@@ -98,3 +98,13 @@ void __cpuinit load_ucode_ap(void) | |||
98 | if (vendor == X86_VENDOR_INTEL && x86 >= 6) | 98 | if (vendor == X86_VENDOR_INTEL && x86 >= 6) |
99 | load_ucode_intel_ap(); | 99 | load_ucode_intel_ap(); |
100 | } | 100 | } |
101 | |||
102 | int __init save_microcode_in_initrd(void) | ||
103 | { | ||
104 | struct cpuinfo_x86 *c = &boot_cpu_data; | ||
105 | |||
106 | if (c->x86_vendor == X86_VENDOR_INTEL && c->x86 >= 6) | ||
107 | return save_microcode_in_initrd_intel(); | ||
108 | |||
109 | return 0; | ||
110 | } | ||
diff --git a/arch/x86/kernel/microcode_intel_early.c b/arch/x86/kernel/microcode_intel_early.c index a07f0a026e7b..dabef95506f3 100644 --- a/arch/x86/kernel/microcode_intel_early.c +++ b/arch/x86/kernel/microcode_intel_early.c | |||
@@ -699,7 +699,7 @@ static int __cpuinit apply_microcode_early(struct mc_saved_data *mc_saved_data, | |||
699 | * This function converts microcode patch offsets previously stored in | 699 | * This function converts microcode patch offsets previously stored in |
700 | * mc_saved_in_initrd to pointers and stores the pointers in mc_saved_data. | 700 | * mc_saved_in_initrd to pointers and stores the pointers in mc_saved_data. |
701 | */ | 701 | */ |
702 | int __init save_microcode_in_initrd(void) | 702 | int __init save_microcode_in_initrd_intel(void) |
703 | { | 703 | { |
704 | unsigned int count = mc_saved_data.mc_saved_count; | 704 | unsigned int count = mc_saved_data.mc_saved_count; |
705 | struct microcode_intel *mc_saved[MAX_UCODE_COUNT]; | 705 | struct microcode_intel *mc_saved[MAX_UCODE_COUNT]; |