Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/microcode: Remove modularization leftovers

Remove the remaining module functionality leftovers. Make
"dis_ucode_ldr" an early_param and make it static again. Drop
module aliases, autoloading table, description, etc.

Bump version number, while at it.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/1445334889-300-4-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Borislav Petkov and committed by
Ingo Molnar
6b26e1bf fe055896

+12 -40
-1
arch/x86/include/asm/microcode.h
··· 27 27 struct device; 28 28 29 29 enum ucode_state { UCODE_ERROR, UCODE_OK, UCODE_NFOUND }; 30 - extern bool dis_ucode_ldr; 31 30 32 31 struct microcode_ops { 33 32 enum ucode_state (*request_microcode_user) (int cpu,
+1 -6
arch/x86/kernel/cpu/microcode/amd.c
··· 24 24 * Licensed under the terms of the GNU General Public 25 25 * License version 2. See file COPYING for details. 26 26 */ 27 - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 27 + #define pr_fmt(fmt) "microcode: " fmt 28 28 29 29 #include <linux/earlycpio.h> 30 30 #include <linux/firmware.h> ··· 32 32 #include <linux/vmalloc.h> 33 33 #include <linux/initrd.h> 34 34 #include <linux/kernel.h> 35 - #include <linux/module.h> 36 35 #include <linux/pci.h> 37 36 38 37 #include <asm/microcode_amd.h> ··· 40 41 #include <asm/setup.h> 41 42 #include <asm/cpu.h> 42 43 #include <asm/msr.h> 43 - 44 - MODULE_DESCRIPTION("AMD Microcode Update Driver"); 45 - MODULE_AUTHOR("Peter Oruba"); 46 - MODULE_LICENSE("GPL v2"); 47 44 48 45 static struct equiv_cpu_entry *equiv_cpu_table; 49 46
+10 -26
arch/x86/kernel/cpu/microcode/core.c
··· 19 19 * 2 of the License, or (at your option) any later version. 20 20 */ 21 21 22 - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + #define pr_fmt(fmt) "microcode: " fmt 23 23 24 24 #include <linux/platform_device.h> 25 25 #include <linux/syscore_ops.h> ··· 27 27 #include <linux/capability.h> 28 28 #include <linux/firmware.h> 29 29 #include <linux/kernel.h> 30 - #include <linux/module.h> 31 30 #include <linux/mutex.h> 32 31 #include <linux/cpu.h> 33 32 #include <linux/fs.h> ··· 40 41 #include <asm/processor.h> 41 42 #include <asm/cmdline.h> 42 43 43 - MODULE_DESCRIPTION("Microcode Update Driver"); 44 - MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); 45 - MODULE_LICENSE("GPL"); 46 - 47 - #define MICROCODE_VERSION "2.00" 44 + #define MICROCODE_VERSION "2.01" 48 45 49 46 static struct microcode_ops *microcode_ops; 50 47 51 - bool dis_ucode_ldr; 52 - module_param(dis_ucode_ldr, bool, 0); 48 + static bool dis_ucode_ldr; 49 + 50 + static int __init disable_loader(char *str) 51 + { 52 + dis_ucode_ldr = true; 53 + return 1; 54 + } 55 + __setup("dis_ucode_ldr", disable_loader); 53 56 54 57 /* 55 58 * Synchronization. ··· 365 364 { 366 365 misc_deregister(&microcode_dev); 367 366 } 368 - 369 - MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); 370 - MODULE_ALIAS("devname:cpu/microcode"); 371 367 #else 372 368 #define microcode_dev_init() 0 373 369 #define microcode_dev_exit() do { } while (0) ··· 614 616 static struct notifier_block mc_cpu_notifier = { 615 617 .notifier_call = mc_cpu_callback, 616 618 }; 617 - 618 - #ifdef MODULE 619 - /* Autoload on Intel and AMD systems */ 620 - static const struct x86_cpu_id __initconst microcode_id[] = { 621 - #ifdef CONFIG_MICROCODE_INTEL 622 - { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, }, 623 - #endif 624 - #ifdef CONFIG_MICROCODE_AMD 625 - { X86_VENDOR_AMD, X86_FAMILY_ANY, X86_MODEL_ANY, }, 626 - #endif 627 - {} 628 - }; 629 - MODULE_DEVICE_TABLE(x86cpu, microcode_id); 630 - #endif 631 619 632 620 static struct attribute *cpu_root_microcode_attrs[] = { 633 621 &dev_attr_reload.attr,
+1 -6
arch/x86/kernel/cpu/microcode/intel.c
··· 21 21 * 22 22 *#define DEBUG 23 23 */ 24 - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 24 + #define pr_fmt(fmt) "microcode: " fmt 25 25 26 26 #include <linux/earlycpio.h> 27 27 #include <linux/firmware.h> ··· 29 29 #include <linux/vmalloc.h> 30 30 #include <linux/initrd.h> 31 31 #include <linux/kernel.h> 32 - #include <linux/module.h> 33 32 #include <linux/slab.h> 34 33 #include <linux/cpu.h> 35 34 #include <linux/mm.h> ··· 38 39 #include <asm/tlbflush.h> 39 40 #include <asm/setup.h> 40 41 #include <asm/msr.h> 41 - 42 - MODULE_DESCRIPTION("Microcode Update Driver"); 43 - MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); 44 - MODULE_LICENSE("GPL"); 45 42 46 43 static unsigned long mc_saved_in_initrd[MAX_UCODE_COUNT]; 47 44 static struct mc_saved_data {
-1
arch/x86/kernel/cpu/microcode/intel_lib.c
··· 25 25 #include <linux/firmware.h> 26 26 #include <linux/uaccess.h> 27 27 #include <linux/kernel.h> 28 - #include <linux/module.h> 29 28 30 29 #include <asm/microcode_intel.h> 31 30 #include <asm/processor.h>