diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index dc4acaa1549def4f31a17d035bb22b58b45619f4..ac78f90aea562dc332a9f84703d266e62007c80a 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile @@ -36,7 +36,7 @@ obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o -obj-$(CONFIG_X86_MCE) += mcheck/ +obj-$(CONFIG_X86_MCE) += mce/ obj-$(CONFIG_MTRR) += mtrr/ obj-$(CONFIG_MICROCODE) += microcode/ obj-$(CONFIG_RESCTRL) += resctrl/ diff --git a/arch/x86/kernel/cpu/mcheck/Makefile b/arch/x86/kernel/cpu/mce/Makefile similarity index 61% rename from arch/x86/kernel/cpu/mcheck/Makefile rename to arch/x86/kernel/cpu/mce/Makefile index bcc7c54c7041f95b2f0cf55b8d52fa07511b9365..9f020c9941545ed033d41acd94092d6d0a85b6b9 100644 --- a/arch/x86/kernel/cpu/mcheck/Makefile +++ b/arch/x86/kernel/cpu/mce/Makefile @@ -1,14 +1,16 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y = mce.o mce-severity.o mce-genpool.o +obj-y = core.o severity.o genpool.o obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o -obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o -obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o +obj-$(CONFIG_X86_MCE_INTEL) += intel.o +obj-$(CONFIG_X86_MCE_AMD) += amd.o obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o + +mce-inject-y := inject.o obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o obj-$(CONFIG_X86_THERMAL_VECTOR) += therm_throt.o -obj-$(CONFIG_ACPI_APEI) += mce-apei.o +obj-$(CONFIG_ACPI_APEI) += apei.o obj-$(CONFIG_X86_MCELOG_LEGACY) += dev-mcelog.o diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mce/amd.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/mce_amd.c rename to arch/x86/kernel/cpu/mce/amd.c index e12454e21b8a5decc64af5e9143d2b469d6ecfbb..4a2fb59a372e77f01a36a0e34370cdadec263519 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -28,7 +28,7 @@ #include <asm/msr.h> #include <asm/trace/irq_vectors.h> -#include "mce-internal.h" +#include "internal.h" #define NR_BLOCKS 5 #define THRESHOLD_MAX 0xFFF diff --git a/arch/x86/kernel/cpu/mcheck/mce-apei.c b/arch/x86/kernel/cpu/mce/apei.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/mce-apei.c rename to arch/x86/kernel/cpu/mce/apei.c index 2eee853796891460c5cb0dd20dc594697bdd6d1f..1d9b3ce662a0b8a6d8347a76ae88257c1b82531d 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-apei.c +++ b/arch/x86/kernel/cpu/mce/apei.c @@ -36,7 +36,7 @@ #include <acpi/ghes.h> #include <asm/mce.h> -#include "mce-internal.h" +#include "internal.h" void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err) { diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mce/core.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/mce.c rename to arch/x86/kernel/cpu/mce/core.c index 36d2696c9563e88a8e354068d7e8a43d636371d3..ad8f62a0c706a9c7674777c3491c6fd61cd99e3d 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -8,8 +8,6 @@ * Author: Andi Kleen */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include <linux/thread_info.h> #include <linux/capability.h> #include <linux/miscdevice.h> @@ -52,7 +50,7 @@ #include <asm/msr.h> #include <asm/reboot.h> -#include "mce-internal.h" +#include "internal.h" static DEFINE_MUTEX(mce_log_mutex); diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c b/arch/x86/kernel/cpu/mce/dev-mcelog.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/dev-mcelog.c rename to arch/x86/kernel/cpu/mce/dev-mcelog.c index 27f394ac983f6659cd260e766f6ffafa323e8215..9690ec5c80515f73a2a3705b23f673574fe035e4 100644 --- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c +++ b/arch/x86/kernel/cpu/mce/dev-mcelog.c @@ -8,14 +8,12 @@ * Author: Andi Kleen */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include <linux/miscdevice.h> #include <linux/slab.h> #include <linux/kmod.h> #include <linux/poll.h> -#include "mce-internal.h" +#include "internal.h" static BLOCKING_NOTIFIER_HEAD(mce_injector_chain); diff --git a/arch/x86/kernel/cpu/mcheck/mce-genpool.c b/arch/x86/kernel/cpu/mce/genpool.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/mce-genpool.c rename to arch/x86/kernel/cpu/mce/genpool.c index 217cd4449bc9db3aedfd6367529bc9ca99fb8443..3395549c51d3f74502c18060ac5160ad934a1b48 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-genpool.c +++ b/arch/x86/kernel/cpu/mce/genpool.c @@ -10,7 +10,7 @@ #include <linux/mm.h> #include <linux/genalloc.h> #include <linux/llist.h> -#include "mce-internal.h" +#include "internal.h" /* * printk() is not safe in MCE context. This is a lock-less memory allocator diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mce/inject.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/mce-inject.c rename to arch/x86/kernel/cpu/mce/inject.c index 1fc424c40a31851012264262a1728ffc27b1c36c..8492ef7d9015086fb44e08ec532438bf43056d5c 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-inject.c +++ b/arch/x86/kernel/cpu/mce/inject.c @@ -38,7 +38,7 @@ #include <asm/nmi.h> #include <asm/smp.h> -#include "mce-internal.h" +#include "internal.h" /* * Collect all the MCi_XXX settings diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mce/intel.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/mce_intel.c rename to arch/x86/kernel/cpu/mce/intel.c index d05be307d081a67c12eef433b5c832fcfcffa1a7..e43eb6732630ae9b06201e809b1086765afd36fd 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel.c +++ b/arch/x86/kernel/cpu/mce/intel.c @@ -18,7 +18,7 @@ #include <asm/msr.h> #include <asm/mce.h> -#include "mce-internal.h" +#include "internal.h" /* * Support for Intel Correct Machine Check Interrupts. This allows diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mce/internal.h similarity index 98% rename from arch/x86/kernel/cpu/mcheck/mce-internal.h rename to arch/x86/kernel/cpu/mce/internal.h index ceb67cd5918ff4b0b5dbce93fa1f3a36670084bc..af5eab1e65e2707416ecab9e179c3255ec1320a3 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-internal.h +++ b/arch/x86/kernel/cpu/mce/internal.h @@ -2,6 +2,9 @@ #ifndef __X86_MCE_INTERNAL_H__ #define __X86_MCE_INTERNAL_H__ +#undef pr_fmt +#define pr_fmt(fmt) "mce: " fmt + #include <linux/device.h> #include <asm/mce.h> diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mce/p5.c similarity index 98% rename from arch/x86/kernel/cpu/mcheck/p5.c rename to arch/x86/kernel/cpu/mce/p5.c index 5cddf831720fd321b01a7393b8c678d635b46e4b..4ae6df556526e56a70db8dd41c004541d7fe6008 100644 --- a/arch/x86/kernel/cpu/mcheck/p5.c +++ b/arch/x86/kernel/cpu/mce/p5.c @@ -14,6 +14,8 @@ #include <asm/mce.h> #include <asm/msr.h> +#include "internal.h" + /* By default disabled */ int mce_p5_enabled __read_mostly; diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mce/severity.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/mce-severity.c rename to arch/x86/kernel/cpu/mce/severity.c index 44396d52198719df0b0ad7652ba009409ff19037..dc3e26e905a32f5c346852606a55111338b6ca2d 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-severity.c +++ b/arch/x86/kernel/cpu/mce/severity.c @@ -16,7 +16,7 @@ #include <asm/mce.h> #include <linux/uaccess.h> -#include "mce-internal.h" +#include "internal.h" /* * Grade an mce by severity. In general the most severe ones are processed diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mce/therm_throt.c similarity index 99% rename from arch/x86/kernel/cpu/mcheck/therm_throt.c rename to arch/x86/kernel/cpu/mce/therm_throt.c index 2da67b70ba989821db25e3190a5c68964f9e1c26..df01ff8513a5a2823a6d096c5e2c0fa8ad0ebc80 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mce/therm_throt.c @@ -30,6 +30,8 @@ #include <asm/msr.h> #include <asm/trace/irq_vectors.h> +#include "internal.h" + /* How long to wait between reporting thermal events */ #define CHECK_INTERVAL (300 * HZ) diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mce/threshold.c similarity index 96% rename from arch/x86/kernel/cpu/mcheck/threshold.c rename to arch/x86/kernel/cpu/mce/threshold.c index 2b584b319eff37532df8c8729fc520725bee5c29..10586a85c23f08030f0c2262fe47bf5a572023b4 100644 --- a/arch/x86/kernel/cpu/mcheck/threshold.c +++ b/arch/x86/kernel/cpu/mce/threshold.c @@ -10,6 +10,8 @@ #include <asm/mce.h> #include <asm/trace/irq_vectors.h> +#include "internal.h" + static void default_threshold_interrupt(void) { pr_err("Unexpected threshold interrupt at vector %x\n", diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mce/winchip.c similarity index 97% rename from arch/x86/kernel/cpu/mcheck/winchip.c rename to arch/x86/kernel/cpu/mce/winchip.c index 3b45b270a865d1658648667451f4b57fede21f26..a30ea13cccc2611148f6df52149abb712fd9107c 100644 --- a/arch/x86/kernel/cpu/mcheck/winchip.c +++ b/arch/x86/kernel/cpu/mce/winchip.c @@ -13,6 +13,8 @@ #include <asm/mce.h> #include <asm/msr.h> +#include "internal.h" + /* Machine check handler for WinChip C6: */ static void winchip_machine_check(struct pt_regs *regs, long error_code) {