Skip to content

Commit

Permalink
x86/ras: Move AMD MCE injector to arch/x86/ras/
Browse files Browse the repository at this point in the history
This is an x86-specific module and would benefit from being
closer to the arch code. Move it there. Update copyright while
at it.

Signed-off-by: Borislav Petkov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tony Luck <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
suryasaimadhu authored and Ingo Molnar committed Aug 13, 2015
1 parent a79da38 commit 6c36dfe
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
2 changes: 2 additions & 0 deletions arch/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ drivers-$(CONFIG_PM) += arch/x86/power/

drivers-$(CONFIG_FB) += arch/x86/video/

drivers-$(CONFIG_RAS) += arch/x86/ras/

####
# boot loader support. Several targets are kept for legacy purposes

Expand Down
11 changes: 11 additions & 0 deletions arch/x86/ras/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
config AMD_MCE_INJ
tristate "Simple MCE injection interface for AMD processors"
depends on RAS && EDAC_DECODE_MCE && DEBUG_FS
default n
help
This is a simple debugfs interface to inject MCEs and test different
aspects of the MCE handling code.

WARNING: Do not even assume this interface is staying stable!


2 changes: 2 additions & 0 deletions arch/x86/ras/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
obj-$(CONFIG_AMD_MCE_INJ) += mce_amd_inj.o

6 changes: 3 additions & 3 deletions drivers/edac/mce_amd_inj.c → arch/x86/ras/mce_amd_inj.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* This file may be distributed under the terms of the GNU General Public
* License version 2.
*
* Copyright (c) 2010-14: Borislav Petkov <[email protected]>
* Copyright (c) 2010-15: Borislav Petkov <[email protected]>
* Advanced Micro Devices Inc.
*/

Expand All @@ -19,7 +19,7 @@
#include <linux/uaccess.h>
#include <asm/mce.h>

#include "mce_amd.h"
#include "../kernel/cpu/mcheck/mce-internal.h"

/*
* Collect all the MCi_XXX settings
Expand Down Expand Up @@ -195,7 +195,7 @@ static void do_inject(void)
i_mce.status |= MCI_STATUS_MISCV;

if (inj_type == SW_INJ) {
amd_decode_mce(NULL, 0, &i_mce);
mce_inject_log(&i_mce);
return;
}

Expand Down
10 changes: 0 additions & 10 deletions drivers/edac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ config EDAC_DECODE_MCE
which occur really early upon boot, before the module infrastructure
has been initialized.

config EDAC_MCE_INJ
tristate "Simple MCE injection interface"
depends on EDAC_DECODE_MCE && DEBUG_FS
default n
help
This is a simple debugfs interface to inject MCEs and test different
aspects of the MCE handling code.

WARNING: Do not even assume this interface is staying stable!

config EDAC_MM_EDAC
tristate "Main Memory EDAC (Error Detection And Correction) reporting"
select RAS
Expand Down
1 change: 0 additions & 1 deletion drivers/edac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ edac_core-y += edac_pci.o edac_pci_sysfs.o
endif

obj-$(CONFIG_EDAC_GHES) += ghes_edac.o
obj-$(CONFIG_EDAC_MCE_INJ) += mce_amd_inj.o

edac_mce_amd-y := mce_amd.o
obj-$(CONFIG_EDAC_DECODE_MCE) += edac_mce_amd.o
Expand Down
3 changes: 3 additions & 0 deletions drivers/ras/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ menuconfig RAS
data corruption.

if RAS

source arch/x86/ras/Kconfig

endif

0 comments on commit 6c36dfe

Please sign in to comment.