diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2011-12-02 10:50:04 -0500 |
---|---|---|
committer | Borislav Petkov <bp@amd64.org> | 2011-12-14 06:46:47 -0500 |
commit | f72c1a576565a4927d650218e183ab5053ab8c3a (patch) | |
tree | 5be7538c92d77deae68e867a9a8a0f17e3e75bed /arch/x86 | |
parent | dc47ce90c3a822cd7c9e9339fe4d5f61dcb26b50 (diff) |
x86, microcode, AMD: Add a vendor-specific exit function
This will be used to do cleanup work before the driver exits.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/microcode.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/microcode_amd.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/microcode_core.c | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h index 24215072d0e1..4ebe157bf73d 100644 --- a/arch/x86/include/asm/microcode.h +++ b/arch/x86/include/asm/microcode.h | |||
@@ -48,6 +48,7 @@ static inline struct microcode_ops * __init init_intel_microcode(void) | |||
48 | 48 | ||
49 | #ifdef CONFIG_MICROCODE_AMD | 49 | #ifdef CONFIG_MICROCODE_AMD |
50 | extern struct microcode_ops * __init init_amd_microcode(void); | 50 | extern struct microcode_ops * __init init_amd_microcode(void); |
51 | extern void __exit exit_amd_microcode(void); | ||
51 | 52 | ||
52 | static inline void get_ucode_data(void *to, const u8 *from, size_t n) | 53 | static inline void get_ucode_data(void *to, const u8 *from, size_t n) |
53 | { | 54 | { |
@@ -59,6 +60,7 @@ static inline struct microcode_ops * __init init_amd_microcode(void) | |||
59 | { | 60 | { |
60 | return NULL; | 61 | return NULL; |
61 | } | 62 | } |
63 | static inline void __exit exit_amd_microcode(void) {} | ||
62 | #endif | 64 | #endif |
63 | 65 | ||
64 | #endif /* _ASM_X86_MICROCODE_H */ | 66 | #endif /* _ASM_X86_MICROCODE_H */ |
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index d494799aafcd..e8a68c2a4364 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
@@ -353,3 +353,7 @@ struct microcode_ops * __init init_amd_microcode(void) | |||
353 | { | 353 | { |
354 | return µcode_amd_ops; | 354 | return µcode_amd_ops; |
355 | } | 355 | } |
356 | |||
357 | void __exit exit_amd_microcode(void) | ||
358 | { | ||
359 | } | ||
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 9d46f5e43b51..9302e2d0eb4b 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -563,6 +563,8 @@ module_init(microcode_init); | |||
563 | 563 | ||
564 | static void __exit microcode_exit(void) | 564 | static void __exit microcode_exit(void) |
565 | { | 565 | { |
566 | struct cpuinfo_x86 *c = &cpu_data(0); | ||
567 | |||
566 | microcode_dev_exit(); | 568 | microcode_dev_exit(); |
567 | 569 | ||
568 | unregister_hotcpu_notifier(&mc_cpu_notifier); | 570 | unregister_hotcpu_notifier(&mc_cpu_notifier); |
@@ -580,6 +582,9 @@ static void __exit microcode_exit(void) | |||
580 | 582 | ||
581 | microcode_ops = NULL; | 583 | microcode_ops = NULL; |
582 | 584 | ||
585 | if (c->x86_vendor == X86_VENDOR_AMD) | ||
586 | exit_amd_microcode(); | ||
587 | |||
583 | pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n"); | 588 | pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n"); |
584 | } | 589 | } |
585 | module_exit(microcode_exit); | 590 | module_exit(microcode_exit); |