powerpc/powernv: Plumb fsp memory errors to memory poison infrastructure.
cover powerpc/powernv: Plumb fsp memory errors to memory poison infrastructure.
Hi,
Please find the patch set that implements FSP memory error handling and plumbs then into memory poison infrastructure.
Patch 1 enables the generic memory hwpoisoning infrastructure for ppc64. Patch 2 reads the memory errors reported from opal layer and plumbs them into memory poison infrastructure.
This patch uses new messaging channel infrastructure (proposed through a separate patch at
https://lists.ozlabs.org/pipermail/linuxppc-dev/2013-November/113331.html)
to pull the fsp memory errors to linux.
Thanks,
-Mahesh.
---
Mahesh Salgaonkar (2):
powerpc/powernv: Add config option for hwpoisoning.
powerpc/powernv: Get FSP memory errors and plumb into memory poison infrastructure.
arch/powerpc/Kconfig | 6 + arch/powerpc/include/asm/opal.h | 52 +++++++ arch/powerpc/platforms/powernv/Makefile | 1 .../powerpc/platforms/powernv/opal-memory-errors.c | 146 ++++++++++++++++++++ 4 files changed, 205 insertions(+) create mode 100644 arch/powerpc/platforms/powernv/opal-memory-errors.c
Signature · 1 line
-Mahesh
PATCH 1/2 powerpc/powernv: Add config option for hwpoisoning.
From: Mahesh Salgaonkar <[email protected]>
Add config option to enable generic memory hwpoisoning infrastructure for ppc64.
--- arch/powerpc/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+)
arch/powerpc/Kconfig +6 -0
@@ -375,6 +375,12 @@ config ARCH_HAS_WALK_MEMORY config ARCH_ENABLE_MEMORY_HOTREMOVE def_bool y +config PPC64_SUPPORTS_MEMORY_FAILURE + bool "Add support for memory hwpoison" + depends on PPC_BOOK3S_64 + default "y" if PPC_POWERNV + select ARCH_SUPPORTS_MEMORY_FAILURE + config KEXEC bool "kexec system call" depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP))
PATCH 2/2 powerpc/powernv: Get FSP memory errors and plumb into memory poison infrastructure.
In reply to Mahesh J SalgaonkarFrom: Mahesh Salgaonkar <[email protected]>
Get the memory errors reported by opal and plumb it into memory poison infrastructure. This patch uses new messaging channel infrastructure to pull the fsp memory errors to linux.
--- arch/powerpc/include/asm/opal.h | 52 +++++++ arch/powerpc/platforms/powernv/Makefile | 1 .../powerpc/platforms/powernv/opal-memory-errors.c | 146 ++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 arch/powerpc/platforms/powernv/opal-memory-errors.c
arch/powerpc/include/asm/opal.h +52 -0
@@ -418,6 +418,58 @@ struct opal_machine_check_event { } u; }; +/* FSP memory errors handling */ +enum OpalMemErr_Version { + OpalMemErr_V1 =1 , +}; + +enum OpalMemErrType { +OPAL_MEM_ERR_TYPE_RESILIENCE =0 , +OPAL_MEM_ERR_TYPE_DYN_DALLOC , +OPAL_MEM_ERR_TYPE_SCRUB , +}; + +/* Memory Reilience error type */ +enum OpalMemErr_ResilErrType { +OPAL_MEM_RESILIENCE_CE =0 , +OPAL_MEM_RESILIENCE_UE , +OPAL_MEM_RESILIENCE_UE_SCRUB , +}; + +/* Dynamic Memory Deallocation type */ +enum OpalMemErr_DynErrType { +OPAL_MEM_DYNAMIC_DEALLOC =0 , +}; + +/* OpalMemoryErrorData->flags */ +#define OPAL_MEM_CORRECTED_ERROR 0x0001 +#define OPAL_MEM_THRESHOLD_EXCEEDED 0x0002 +#define OPAL_MEM_ACK_REQUIRED 0x8000 + +struct OpalMemoryErrorData { +enum OpalMemErr_Version version:8 ;/* 0x00 */ +enum OpalMemErrType type:8 ;/* 0x01 */ +uint16_t flags;/* 0x02 */ +uint8_t reserved_1[4 ];/* 0x04 */ + +union { +/* Memory Resilience corrected/uncorrected error info */ +struct { +enum OpalMemErr_ResilErrType resil_err_type:8 ; +uint8_t reserved_1[7 ]; +uint64_t physical_address_start; +uint64_t physical_address_end; + } resilience; +/* Dynamic memory deallocation error info */ +struct { +enum OpalMemErr_DynErrType dyn_err_type:8 ; +uint8_t reserved_1[7 ]; +uint64_t physical_address_start; +uint64_t physical_address_end; + } dyn_dealloc; + } u; +}; +enum {OPAL_P7IOC_DIAG_TYPE_NONE =0 ,OPAL_P7IOC_DIAG_TYPE_RGC =1 ,
arch/powerpc/platforms/powernv/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-y += opal-rtc.o opal-nvram.o opal-lpc.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o obj-$(CONFIG_EEH) += eeh-ioda.o eeh-powernv.o +obj-$(CONFIG_MEMORY_FAILURE) += opal-memory-errors.o
arch/powerpc/platforms/powernv/opal-memory-errors.c new file +146 -0
146 lines not on this page · raw message