* [PATCH 0/4] x86 RAS: Reorganize functionality
@ 2011-10-07 15:27 Borislav Petkov
2011-10-07 15:27 ` [PATCH 1/4] x86, mce: Enable MCA support by default Borislav Petkov
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Borislav Petkov @ 2011-10-07 15:27 UTC (permalink / raw)
To: EDAC devel
Cc: Tony Luck, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, LKML,
Borislav Petkov
From: Borislav Petkov <borislav.petkov@amd.com>
Hi all,
this is a first attempt at reorganizing and concentrating x86 RAS
features under arch/x86/. The idea is to put them close to the MCA code
so that code reuse and extending functionality can be done much more
easily.
This first attempt deals only with AMD RAS features but I expect that we
can put all into one unified menu entry in Kconfig after we've agreed on
the structure.
As always, all comments are welcome.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] x86, mce: Enable MCA support by default
2011-10-07 15:27 [PATCH 0/4] x86 RAS: Reorganize functionality Borislav Petkov
@ 2011-10-07 15:27 ` Borislav Petkov
2011-10-07 15:27 ` [PATCH 2/4] x86, RAS: Start reorganizing RAS features support Borislav Petkov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2011-10-07 15:27 UTC (permalink / raw)
To: EDAC devel
Cc: Tony Luck, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, LKML,
Borislav Petkov
From: Borislav Petkov <borislav.petkov@amd.com>
MCA is the most basic support for hardware error collection and
reporting, and it is majorly unwise to run without it so enable machine
check software support by default on x86.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
arch/x86/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6a47bb2..afb7a19 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -841,6 +841,7 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
config X86_MCE
bool "Machine Check / overheating reporting"
+ default y
---help---
Machine Check support allows the processor to notify the
kernel if it detects a problem (e.g. overheating, data corruption).
--
1.7.4.rc2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/4] x86, RAS: Start reorganizing RAS features support
2011-10-07 15:27 [PATCH 0/4] x86 RAS: Reorganize functionality Borislav Petkov
2011-10-07 15:27 ` [PATCH 1/4] x86, mce: Enable MCA support by default Borislav Petkov
@ 2011-10-07 15:27 ` Borislav Petkov
2011-10-07 15:27 ` [PATCH 3/4] x86, RAS: Move MCE decoding code into ras/ Borislav Petkov
2011-10-07 15:27 ` [PATCH 4/4] x86, RAS: Move MCE injection " Borislav Petkov
3 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2011-10-07 15:27 UTC (permalink / raw)
To: EDAC devel
Cc: Tony Luck, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, LKML,
Borislav Petkov
From: Borislav Petkov <borislav.petkov@amd.com>
Start relocating RAS features into a centralized location under
arch/x86/kernel/cpu/ras/. Readjust Kconfig items and makefiles
accordingly.
No functionality change.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
arch/x86/Kconfig | 10 ++--------
arch/x86/include/asm/mce.h | 2 +-
arch/x86/kernel/cpu/Makefile | 2 +-
arch/x86/kernel/cpu/mcheck/Makefile | 1 -
arch/x86/kernel/cpu/ras/Kconfig | 16 ++++++++++++++++
arch/x86/kernel/cpu/ras/Makefile | 1 +
arch/x86/kernel/cpu/ras/amd/Makefile | 1 +
.../{mcheck/mce_amd.c => ras/amd/thresholding.c} | 0
8 files changed, 22 insertions(+), 11 deletions(-)
create mode 100644 arch/x86/kernel/cpu/ras/Kconfig
create mode 100644 arch/x86/kernel/cpu/ras/Makefile
create mode 100644 arch/x86/kernel/cpu/ras/amd/Makefile
rename arch/x86/kernel/cpu/{mcheck/mce_amd.c => ras/amd/thresholding.c} (100%)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index afb7a19..1a70aad 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -856,13 +856,7 @@ config X86_MCE_INTEL
Additional support for intel specific MCE features such as
the thermal monitor.
-config X86_MCE_AMD
- def_bool y
- prompt "AMD MCE features"
- depends on X86_MCE && X86_LOCAL_APIC
- ---help---
- Additional support for AMD specific MCE features such as
- the DRAM Error Threshold.
+source "arch/x86/kernel/cpu/ras/Kconfig"
config X86_ANCIENT_MCE
bool "Support for old Pentium 5 / WinChip machine checks"
@@ -873,7 +867,7 @@ config X86_ANCIENT_MCE
line.
config X86_MCE_THRESHOLD
- depends on X86_MCE_AMD || X86_MCE_INTEL
+ depends on X86_AMD_ERROR_THRESHOLDING || X86_MCE_INTEL
def_bool y
config X86_MCE_INJECT
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index c9321f3..545e8e4 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -174,7 +174,7 @@ static inline void cmci_rediscover(int dying) {}
static inline void cmci_recheck(void) {}
#endif
-#ifdef CONFIG_X86_MCE_AMD
+#ifdef CONFIG_X86_AMD_ERROR_THRESHOLDING
void mce_amd_feature_init(struct cpuinfo_x86 *c);
#else
static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { }
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 6042981..b2832b8 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
-obj-$(CONFIG_X86_MCE) += mcheck/
+obj-$(CONFIG_X86_MCE) += mcheck/ ras/
obj-$(CONFIG_MTRR) += mtrr/
obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o
diff --git a/arch/x86/kernel/cpu/mcheck/Makefile b/arch/x86/kernel/cpu/mcheck/Makefile
index bb34b03..ccd1997 100644
--- a/arch/x86/kernel/cpu/mcheck/Makefile
+++ b/arch/x86/kernel/cpu/mcheck/Makefile
@@ -2,7 +2,6 @@ obj-y = mce.o mce-severity.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_THRESHOLD) += threshold.o
obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o
diff --git a/arch/x86/kernel/cpu/ras/Kconfig b/arch/x86/kernel/cpu/ras/Kconfig
new file mode 100644
index 0000000..a0d96b9
--- /dev/null
+++ b/arch/x86/kernel/cpu/ras/Kconfig
@@ -0,0 +1,16 @@
+menu "AMD RAS features"
+ depends on X86_MCE
+
+config X86_AMD_ERROR_THRESHOLDING
+ def_bool y
+ prompt "Error Thresholding"
+ depends on X86_LOCAL_APIC
+ ---help---
+ Support hardware-maintained counters of some types of hw errors.
+ Currently, there three groups: DRAM, Link and L3 errors. For more
+ detailed information see the section on Error Thresholding in
+ the respective AMD BKDG.
+
+endmenu
+
+
diff --git a/arch/x86/kernel/cpu/ras/Makefile b/arch/x86/kernel/cpu/ras/Makefile
new file mode 100644
index 0000000..dd7a321
--- /dev/null
+++ b/arch/x86/kernel/cpu/ras/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_X86_MCE) += amd/
diff --git a/arch/x86/kernel/cpu/ras/amd/Makefile b/arch/x86/kernel/cpu/ras/amd/Makefile
new file mode 100644
index 0000000..3c1678f
--- /dev/null
+++ b/arch/x86/kernel/cpu/ras/amd/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_X86_AMD_ERROR_THRESHOLDING) += thresholding.o
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/ras/amd/thresholding.c
similarity index 100%
rename from arch/x86/kernel/cpu/mcheck/mce_amd.c
rename to arch/x86/kernel/cpu/ras/amd/thresholding.c
--
1.7.4.rc2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/4] x86, RAS: Move MCE decoding code into ras/
2011-10-07 15:27 [PATCH 0/4] x86 RAS: Reorganize functionality Borislav Petkov
2011-10-07 15:27 ` [PATCH 1/4] x86, mce: Enable MCA support by default Borislav Petkov
2011-10-07 15:27 ` [PATCH 2/4] x86, RAS: Start reorganizing RAS features support Borislav Petkov
@ 2011-10-07 15:27 ` Borislav Petkov
2011-10-07 15:27 ` [PATCH 4/4] x86, RAS: Move MCE injection " Borislav Petkov
3 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2011-10-07 15:27 UTC (permalink / raw)
To: EDAC devel
Cc: Tony Luck, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, LKML,
Borislav Petkov
From: Borislav Petkov <borislav.petkov@amd.com>
As part of collecting AMD RAS features at a single place, move the MCE
decoding code there.
No functionality change.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
.../x86/include/ras/amd/mce-decode.h | 0
arch/x86/kernel/cpu/ras/Kconfig | 14 +++++++++++++-
arch/x86/kernel/cpu/ras/amd/Makefile | 3 +++
.../x86/kernel/cpu/ras/amd/mce-decode.c | 2 +-
drivers/edac/Kconfig | 12 ------------
drivers/edac/Makefile | 3 ---
drivers/edac/amd64_edac.h | 2 +-
drivers/edac/mce_amd_inj.c | 3 +--
8 files changed, 19 insertions(+), 20 deletions(-)
rename drivers/edac/mce_amd.h => arch/x86/include/ras/amd/mce-decode.h (100%)
rename drivers/edac/mce_amd.c => arch/x86/kernel/cpu/ras/amd/mce-decode.c (99%)
diff --git a/drivers/edac/mce_amd.h b/arch/x86/include/ras/amd/mce-decode.h
similarity index 100%
rename from drivers/edac/mce_amd.h
rename to arch/x86/include/ras/amd/mce-decode.h
diff --git a/arch/x86/kernel/cpu/ras/Kconfig b/arch/x86/kernel/cpu/ras/Kconfig
index a0d96b9..440d6a1 100644
--- a/arch/x86/kernel/cpu/ras/Kconfig
+++ b/arch/x86/kernel/cpu/ras/Kconfig
@@ -1,5 +1,5 @@
menu "AMD RAS features"
- depends on X86_MCE
+ depends on X86_MCE && CPU_SUP_AMD
config X86_AMD_ERROR_THRESHOLDING
def_bool y
@@ -11,6 +11,18 @@ config X86_AMD_ERROR_THRESHOLDING
detailed information see the section on Error Thresholding in
the respective AMD BKDG.
+config X86_AMD_DECODE_MCE
+ tristate "Decode MCEs in human-readable form"
+ default y
+ ---help---
+ Enable this option if you want to decode Machine Check Exceptions
+ occurring on your machine in a human-readable form.
+
+ You should definitely say Y here in case you want to decode MCEs
+ which occur really early upon boot, before the module infrastructure
+ has been initialized.
+
+
endmenu
diff --git a/arch/x86/kernel/cpu/ras/amd/Makefile b/arch/x86/kernel/cpu/ras/amd/Makefile
index 3c1678f..a18207b 100644
--- a/arch/x86/kernel/cpu/ras/amd/Makefile
+++ b/arch/x86/kernel/cpu/ras/amd/Makefile
@@ -1 +1,4 @@
obj-$(CONFIG_X86_AMD_ERROR_THRESHOLDING) += thresholding.o
+
+amd_mce_decode-y := mce-decode.o
+obj-$(CONFIG_X86_AMD_DECODE_MCE) += amd_mce_decode.o
diff --git a/drivers/edac/mce_amd.c b/arch/x86/kernel/cpu/ras/amd/mce-decode.c
similarity index 99%
rename from drivers/edac/mce_amd.c
rename to arch/x86/kernel/cpu/ras/amd/mce-decode.c
index d0864d9..052ee9a 100644
--- a/drivers/edac/mce_amd.c
+++ b/arch/x86/kernel/cpu/ras/amd/mce-decode.c
@@ -1,7 +1,7 @@
#include <linux/module.h>
#include <linux/slab.h>
-#include "mce_amd.h"
+#include <ras/amd/mce-decode.h>
static struct amd_decoder_ops *fam_ops;
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index af1a17d..8de46e7 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -39,18 +39,6 @@ config EDAC_DEBUG
there're four debug levels (x=0,1,2,3 from low to high).
Usually you should select 'N'.
-config EDAC_DECODE_MCE
- tristate "Decode MCEs in human-readable form (only on AMD for now)"
- depends on CPU_SUP_AMD && X86_MCE
- default y
- ---help---
- Enable this option if you want to decode Machine Check Exceptions
- occurring on your machine in human-readable form.
-
- You should definitely say Y here in case you want to decode MCEs
- which occur really early upon boot, before the module infrastructure
- has been initialized.
-
config EDAC_MCE_INJ
tristate "Simple MCE injection interface over /sysfs"
depends on EDAC_DECODE_MCE
diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile
index 3e23913..a6f10c2 100644
--- a/drivers/edac/Makefile
+++ b/drivers/edac/Makefile
@@ -19,9 +19,6 @@ endif
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
-
obj-$(CONFIG_EDAC_AMD76X) += amd76x_edac.o
obj-$(CONFIG_EDAC_CPC925) += cpc925_edac.o
obj-$(CONFIG_EDAC_I5000) += i5000_edac.o
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index 9a666cb..cd4232a 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -71,8 +71,8 @@
#include <linux/mmzone.h>
#include <linux/edac.h>
#include <asm/msr.h>
+#include <ras/amd/mce-decode.h>
#include "edac_core.h"
-#include "mce_amd.h"
#define amd64_debug(fmt, arg...) \
edac_printk(KERN_DEBUG, "amd64", fmt, ##arg)
diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c
index a4987e0..a38806a 100644
--- a/drivers/edac/mce_amd_inj.c
+++ b/drivers/edac/mce_amd_inj.c
@@ -14,8 +14,7 @@
#include <linux/sysdev.h>
#include <linux/edac.h>
#include <asm/mce.h>
-
-#include "mce_amd.h"
+#include <ras/amd/mce-decode.h>
struct edac_mce_attr {
struct attribute attr;
--
1.7.4.rc2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4/4] x86, RAS: Move MCE injection code into ras/
2011-10-07 15:27 [PATCH 0/4] x86 RAS: Reorganize functionality Borislav Petkov
` (2 preceding siblings ...)
2011-10-07 15:27 ` [PATCH 3/4] x86, RAS: Move MCE decoding code into ras/ Borislav Petkov
@ 2011-10-07 15:27 ` Borislav Petkov
3 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2011-10-07 15:27 UTC (permalink / raw)
To: EDAC devel
Cc: Tony Luck, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, LKML,
Borislav Petkov
From: Borislav Petkov <borislav.petkov@amd.com>
This is the code collecting all AMD MCE injection methods.
No functionality change.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
arch/x86/kernel/cpu/ras/Kconfig | 9 +++++++--
arch/x86/kernel/cpu/ras/amd/Makefile | 3 +++
.../x86/kernel/cpu/ras/amd/mce-inject.c | 0
drivers/edac/Kconfig | 10 ----------
drivers/edac/Makefile | 2 --
5 files changed, 10 insertions(+), 14 deletions(-)
rename drivers/edac/mce_amd_inj.c => arch/x86/kernel/cpu/ras/amd/mce-inject.c (100%)
diff --git a/arch/x86/kernel/cpu/ras/Kconfig b/arch/x86/kernel/cpu/ras/Kconfig
index 440d6a1..39dd0af 100644
--- a/arch/x86/kernel/cpu/ras/Kconfig
+++ b/arch/x86/kernel/cpu/ras/Kconfig
@@ -22,7 +22,12 @@ config X86_AMD_DECODE_MCE
which occur really early upon boot, before the module infrastructure
has been initialized.
+config X86_AMD_MCE_INJECT
+ tristate "Simple MCE injection interface over /sysfs"
+ depends on X86_AMD_DECODE_MCE
+ default n
+ help
+ This is a simple interface to inject MCEs over /sysfs and test
+ the MCE decoding code.
endmenu
-
-
diff --git a/arch/x86/kernel/cpu/ras/amd/Makefile b/arch/x86/kernel/cpu/ras/amd/Makefile
index a18207b..3a01e3a 100644
--- a/arch/x86/kernel/cpu/ras/amd/Makefile
+++ b/arch/x86/kernel/cpu/ras/amd/Makefile
@@ -2,3 +2,6 @@ obj-$(CONFIG_X86_AMD_ERROR_THRESHOLDING) += thresholding.o
amd_mce_decode-y := mce-decode.o
obj-$(CONFIG_X86_AMD_DECODE_MCE) += amd_mce_decode.o
+
+amd_mce_inject-y := mce-inject.o
+obj-$(CONFIG_X86_AMD_MCE_INJECT) += amd_mce_inject.o
diff --git a/drivers/edac/mce_amd_inj.c b/arch/x86/kernel/cpu/ras/amd/mce-inject.c
similarity index 100%
rename from drivers/edac/mce_amd_inj.c
rename to arch/x86/kernel/cpu/ras/amd/mce-inject.c
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index 8de46e7..9c9b319 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -39,16 +39,6 @@ config EDAC_DEBUG
there're four debug levels (x=0,1,2,3 from low to high).
Usually you should select 'N'.
-config EDAC_MCE_INJ
- tristate "Simple MCE injection interface over /sysfs"
- depends on EDAC_DECODE_MCE
- default n
- help
- This is a simple interface to inject MCEs over /sysfs and test
- the MCE decoding code in EDAC.
-
- This is currently AMD-only.
-
config EDAC_MM_EDAC
tristate "Main Memory EDAC (Error Detection And Correction) reporting"
help
diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile
index a6f10c2..5444512 100644
--- a/drivers/edac/Makefile
+++ b/drivers/edac/Makefile
@@ -17,8 +17,6 @@ ifdef CONFIG_PCI
edac_core-y += edac_pci.o edac_pci_sysfs.o
endif
-obj-$(CONFIG_EDAC_MCE_INJ) += mce_amd_inj.o
-
obj-$(CONFIG_EDAC_AMD76X) += amd76x_edac.o
obj-$(CONFIG_EDAC_CPC925) += cpc925_edac.o
obj-$(CONFIG_EDAC_I5000) += i5000_edac.o
--
1.7.4.rc2
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-07 15:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-07 15:27 [PATCH 0/4] x86 RAS: Reorganize functionality Borislav Petkov
2011-10-07 15:27 ` [PATCH 1/4] x86, mce: Enable MCA support by default Borislav Petkov
2011-10-07 15:27 ` [PATCH 2/4] x86, RAS: Start reorganizing RAS features support Borislav Petkov
2011-10-07 15:27 ` [PATCH 3/4] x86, RAS: Move MCE decoding code into ras/ Borislav Petkov
2011-10-07 15:27 ` [PATCH 4/4] x86, RAS: Move MCE injection " Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®