Skip to contentSkip to conversation

ACPI, APEI patches for 2.6.37

PATCH In review Huang Ying 8 participants 45 messages Oct 25, 2010 – Oct 27, 2010

Subsystems (11)
lore
Share & tools
lore
author
#1 lore raw

PATCH 1/9 ACPI, APEI, Add ERST record ID cache

In reply to Huang Ying

APEI ERST firmware interface and implementation has no multiple users in mind. For example, there is four records in storage with ID: 1, 2, 3 and 4, if two ERST readers enumerate the records via GET_NEXT_RECORD_ID as follow,

reader 1 reader 2
1

			2
3
			4
-1
			-1

where -1 signals there is no more record ID.

Reader 1 has no chance to check record 2 and 4, while reader 2 has no chance to check record 1 and 3. And any other GET_NEXT_RECORD_ID will return -1, that is, other readers will has no chance to check any record even they are not cleared by anyone.

This makes raw GET_NEXT_RECORD_ID not suitable for usage of multiple users.

To solve the issue, an in memory ERST record ID cache is designed and implemented. When enumerating record ID, the ID returned by GET_NEXT_RECORD_ID is added into cache in addition to be returned to caller. So other readers can check the cache to get all record ID available.

---
 arch/x86/kernel/cpu/mcheck/mce-apei.c |   40 +++--
 drivers/acpi/apei/erst-dbg.c          |   24 ++-
 drivers/acpi/apei/erst.c              |  241 +++++++++++++++++++++++++++-------
 include/acpi/apei.h                   |    5 
 4 files changed, 246 insertions(+), 64 deletions(-)
arch/x86/kernel/cpu/mcheck/mce-apei.c +25 -15
@@ -106,24 +106,34 @@ int apei_write_mce(struct mce *m)
 ssize_t apei_read_mce(struct mce *m, u64 *record_id)
 {
 	struct cper_mce_record rcd;
-	ssize_t len;
-
-	len = erst_read_next(&rcd.hdr, sizeof(rcd));
-	if (len <= 0)
-		return len;
-	/* Can not skip other records in storage via ERST unless clear them */
-	else if (len != sizeof(rcd) ||
-		 uuid_le_cmp(rcd.hdr.creator_id, CPER_CREATOR_MCE)) {
-		if (printk_ratelimit())
-			pr_warning(
-			"MCE-APEI: Can not skip the unknown record in ERST");
-		return -EIO;
-	}
+	int rc, pos;
 
+	rc = erst_get_record_id_begin(&pos);
+	if (rc)
+		return rc;
+retry:
+	rc = erst_get_record_id_next(&pos, record_id);
+	if (rc)
+		goto out;
+	/* no more record */
+	if (*record_id == APEI_ERST_INVALID_RECORD_ID)
+		goto out;
+	rc = erst_read(*record_id, &rcd.hdr, sizeof(rcd));
+	/* someone else has cleared the record, try next one */
+	if (rc == -ENOENT)
+		goto retry;
+	else if (rc < 0)
+		goto out;
+	/* try to skip other type records in storage */
+	else if (rc != sizeof(rcd) ||
+		 uuid_le_cmp(rcd.hdr.creator_id, CPER_CREATOR_MCE))
+		goto retry;
 	memcpy(m, &rcd.mce, sizeof(*m));
-	*record_id = rcd.hdr.record_id;
+	rc = sizeof(*m);
+out:
+	erst_get_record_id_end();
 
-	return sizeof(*m);
+	return rc;
 }
 
 /* Check whether there is record in ERST */
drivers/acpi/apei/erst-dbg.c +21 -3
@@ -43,12 +43,27 @@ static DEFINE_MUTEX(erst_dbg_mutex);
 
 static int erst_dbg_open(struct inode *inode, struct file *file)
 {
+	int rc, *pos;
+
 	if (erst_disable)
 		return -ENODEV;
 
+	pos = (int *)&file->private_data;
+
+	rc = erst_get_record_id_begin(pos);
+	if (rc)
+		return rc;
+
 	return nonseekable_open(inode, file);
 }
 
+static int erst_dbg_release(struct inode *inode, struct file *file)
+{
+	erst_get_record_id_end();
+
+	return 0;
+}
+
 static long erst_dbg_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
 {
 	int rc;
@@ -79,18 +94,20 @@ static long erst_dbg_ioctl(struct file *
 static ssize_t erst_dbg_read(struct file *filp, char __user *ubuf,
 			     size_t usize, loff_t *off)
 {
-	int rc;
+	int rc, *pos;
 	ssize_t len = 0;
 	u64 id;
 
-	if (*off != 0)
+	if (*off)
 		return -EINVAL;
 
 	if (mutex_lock_interruptible(&erst_dbg_mutex) != 0)
 		return -EINTR;
 
+	pos = (int *)&filp->private_data;
+
 retry_next:
-	rc = erst_get_next_record_id(&id);
+	rc = erst_get_record_id_next(pos, &id);
 	if (rc)
 		goto out;
 	/* no more record */
@@ -181,6 +198,7 @@ out:
 static const struct file_operations erst_dbg_ops = {
 	.owner		= THIS_MODULE,
 	.open		= erst_dbg_open,
+	.release	= erst_dbg_release,
 	.read		= erst_dbg_read,
 	.write		= erst_dbg_write,
 	.unlocked_ioctl	= erst_dbg_ioctl,
drivers/acpi/apei/erst.c +197 -44

285 lines not on this page · raw message

include/acpi/apei.h +3 -2
@@ -24,10 +24,11 @@ int apei_hest_parse(apei_hest_func_t fun
 
 int erst_write(const struct cper_record_header *record);
 ssize_t erst_get_record_count(void);
-int erst_get_next_record_id(u64 *record_id);
+int erst_get_record_id_begin(int *pos);
+int erst_get_record_id_next(int *pos, u64 *record_id);
+void erst_get_record_id_end(void);
 ssize_t erst_read(u64 record_id, struct cper_record_header *record,
 		  size_t buflen);
-ssize_t erst_read_next(struct cper_record_header *record, size_t buflen);
 int erst_clear(u64 record_id);
 
 #endif
author
#2 lore raw

PATCH 2/9 Add lock-less version of bitmap_set/clear

In reply to Huang Ying

cmpxchg is used to change the bitmap instead of the ordinary unsigned long assigning. Several users can set/clear the same bitmap simultaneously without lock. If there is conflict between two user, (set/clear same bit), one will return remain bits immediately.

This can be used to implement the lock-less resource allocator.

---
 include/linux/bitmap.h |    4 +
 lib/bitmap.c           |  101 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)
include/linux/bitmap.h +4 -0
@@ -44,6 +44,8 @@
  * bitmap_weight(src, nbits)			Hamming Weight: number set bits
  * bitmap_set(dst, pos, nbits)			Set specified bit area
  * bitmap_clear(dst, pos, nbits)		Clear specified bit area
+ * bitmap_set_ll(dst, pos, nbits)		Set specified bit area, lock-less version
+ * bitmap_clear_ll(dst, pos, nbits)		Clear specified bit area, lock-less version
  * bitmap_find_next_zero_area(buf, len, pos, n, mask)	Find bit free area
  * bitmap_shift_right(dst, src, n, nbits)	*dst = *src >> n
  * bitmap_shift_left(dst, src, n, nbits)	*dst = *src << n
@@ -113,6 +115,8 @@ extern int __bitmap_weight(const unsigne
 
 extern void bitmap_set(unsigned long *map, int i, int len);
 extern void bitmap_clear(unsigned long *map, int start, int nr);
+extern int bitmap_set_ll(unsigned long *map, int i, int len);
+extern int bitmap_clear_ll(unsigned long *map, int start, int nr);
 extern unsigned long bitmap_find_next_zero_area(unsigned long *map,
 					 unsigned long size,
 					 unsigned long start,
lib/bitmap.c +101 -0

107 lines not on this page · raw message

author
#3 lore raw

PATCH 3/9 lock-less NULL terminated single list implementation

In reply to Huang Ying

Cmpxchg is used to implement adding new entry to list, deleting first entry of the list and some other operations.

Because this is a single list, so the tail can not be accessed in O(1).

This can be used in NMI handler.

---
 include/linux/llist.h |   64 ++++++++++++++++++++++++++++++++++++++
 lib/Kconfig           |    3 +
 lib/Makefile          |    2 +
 lib/llist.c           |   84 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 153 insertions(+)
 create mode 100644 include/linux/llist.h
 create mode 100644 lib/llist.c
include/linux/llist.h new file +64 -0
@@ -0,0 +1,64 @@
+#ifndef LLIST_H
+#define LLIST_H
+
+/* lock-less NULL terminated single linked list */
+struct llist_head {
+	struct llist_head *next;
+};
+
+#define LLIST_HEAD_INIT(name) { NULL }
+
+#define LLIST_HEAD(name)				\
+	struct llist_head name = LLIST_HEAD_INIT(name)
+
+/**
+ * init_llist_head - initialize lock-less list head
+ * @head:	the head for your lock-less list
+ */
+static inline void init_llist_head(struct llist_head *list)
+{
+	list->next = NULL;
+}
+
+/**
+ * llist_entry - get the struct of this entry
+ * @ptr:	the &struct llist_head pointer.
+ * @type:	the type of the struct this is embedded in.
+ * @member:	the name of the llist_head within the struct.
+ */
+#define llist_entry(ptr, type, member)		\
+	container_of(ptr, type, member)
+
+/**
+ * llist_for_each - iterate over a lock-less list
+ * @pos:	the &struct llist_head to use as a loop cursor
+ * @head:	the head for your lock-less list
+ */
+#define llist_for_each(pos, head)					\
+	for (pos = (head)->next; pos; pos = pos->next)
+
+/**
+ * llist_for_each_entry - iterate over lock-less list of given type
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your lock-less list.
+ * @member:	the name of the llist_head with the struct.
+ */
+#define llist_for_each_entry(pos, head, member)				\
+	for (pos = llist_entry((head)->next, typeof(*pos), member);	\
+	     &pos->member != NULL;					\
+	     pos = llist_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * llist_empty - tests whether a lock-less list is empty
+ * @head:	the list to test
+ */
+static inline int llist_empty(const struct llist_head *head)
+{
+	return head->next == NULL;
+}
+
+void llist_add(struct llist_head *new, struct llist_head *head);
+struct llist_head *llist_del_first(struct llist_head *head);
+void llist_move_all(struct llist_head *list, struct llist_head *head);
+
+#endif /* LLIST_H */
lib/Kconfig +3 -0
@@ -210,4 +210,7 @@ config GENERIC_ATOMIC64
 config LRU_CACHE
 	tristate
 
+config LLIST
+	bool
+
 endmenu
lib/Makefile +2 -0
@@ -106,6 +106,8 @@ obj-$(CONFIG_GENERIC_ATOMIC64) += atomic
 
 obj-$(CONFIG_ATOMIC64_SELFTEST) += atomic64_test.o
 
+obj-$(CONFIG_LLIST) += llist.o
+
 hostprogs-y	:= gen_crc32table
 clean-files	:= crc32table.h
 
lib/llist.c new file +84 -0

84 lines not on this page · raw message

author
#4 lore raw

PATCH 4/9 lock-less general memory allocator

In reply to Huang Ying

Lock-less memory allocator, can be used to allocate/free memory in IRQ/NMI handler. This is useful for hardware error handling, which needs to collect hardware error information in IRQ/NMI handler.

The memory pages for lock-less memory allocator are pre-allocated during initialization. Bitmap is used to record allocated/free memory blocks. To support lock-less allocate/free operation, lock-less bitmap set/clear operations are used.

The difference between this allocator and the gen_pool implementation in lib/genalloc.c is that memory can be allocated/freed by multiple users simultaneously without lock.

---
 include/linux/llalloc.h |   27 +++++
 lib/Kconfig             |    3 
 lib/Makefile            |    1 
 lib/llalloc.c           |  259 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 290 insertions(+)
 create mode 100644 include/linux/llalloc.h
 create mode 100644 lib/llalloc.c
include/linux/llalloc.h new file +27 -0
@@ -0,0 +1,27 @@
+#ifndef LLALLOC_H
+#define LLALLOC_H
+
+struct ll_pool;
+
+struct ll_pool_chunk {
+	atomic_t avail;
+	void *data;
+	struct ll_pool *pool;
+	unsigned long bitmap[0];
+};
+
+struct ll_pool {
+	int min_alloc_order;
+	int chunk_order;
+	int chunk_num;
+	struct ll_pool_chunk *chunks[0];
+};
+
+struct ll_pool *ll_pool_create(int min_alloc_order, int chunk_order,
+			       int chunk_num, int nid);
+void ll_pool_destroy(struct ll_pool *pool);
+void *ll_pool_alloc(struct ll_pool *pool, size_t len);
+void ll_pool_free(const void *p, size_t len);
+size_t ll_pool_avail(struct ll_pool *pool);
+size_t ll_pool_size(struct ll_pool *pool);
+#endif /* LLALLOC_H */
lib/Kconfig +3 -0
@@ -213,4 +213,7 @@ config LRU_CACHE
 config LLIST
 	bool
 
+config LLALLOC
+	bool
+
 endmenu
lib/Makefile +1 -0
@@ -107,6 +107,7 @@ obj-$(CONFIG_GENERIC_ATOMIC64) += atomic
 obj-$(CONFIG_ATOMIC64_SELFTEST) += atomic64_test.o
 
 obj-$(CONFIG_LLIST) += llist.o
+obj-$(CONFIG_LLALLOC) += llalloc.o
 
 hostprogs-y	:= gen_crc32table
 clean-files	:= crc32table.h
lib/llalloc.c new file +259 -0

259 lines not on this page · raw message

author
#5 lore raw

PATCH 5/9 Hardware error device core

In reply to Huang Ying

Hardware error device is a kind of device which can report hardware errors. The examples of hardware error device include APEI GHES, PCIe AER, etc.

Hardware error device core in this patch provides common services for various hardware error devices.

Hardware error record data structure is defined to accommodate various hardware error information. Several error sections can be incorporated into one error record to accumulate information for multiple hardware components related to one error. For example, for an error on a device on the secondary side of a PCIe bridge, it is useful to record error information from PCIe bridge and from the PCIe device.

To manage various hardware error devices, struct herr_dev is defined as a "sub-class" of "struct device". It should be created as the child device of the "real" hardware error device such as APEI GHES to represent the hardware error reporting aspect of the device. The class of struct herr_dev instances is "error", so that all hardware error devices can be enumerated via listing all links in /sys/class/error.

The most important functionality that this patch provided is hardware error reporting support. Details is as follow.

A lock-less hardware error record allocator is provided. So for hardware error that can be ignored (such as corrected errors), it is not needed to pre-allocate the error record or allocate the error record on stack.

After filling in all necessary fields in hardware error record, the error reporting is quite straightforward, just calling herr_record_report, parameters are the error record itself and the corresponding struct herr_dev. All other special processing including user space interface is handled by hardware error device core, this make it much easier to write a hardware error handler.

Because the possibility for two or more hardware parts to go error simultaneously is quite low, it is not necessary to create one device file for each hardware error device. One device file (/dev/error) which mixed error records from all hardware error devices is created as the user space interface. Then, the user space hardware error daemon can do some further processing (including logging into disk), based on the hardware error records read from the device file.

Although the in-kernel and user space interface of hardware error reporting is quite simple, there is some special consideration in hardware error reporting implementation.

Hardware errors may burst, for example, same hardware errors may be reported at high rate within a short interval, this will use up all pre-allocated memory for error reporting, so that other hardware errors come from same or different hardware device can not be logged. To deal with this issue, a burst control algorithm is implemented. The logging rate for errors come from one hardware error device is throttled based on the available pre-allocated memory for error reporting. In this way we can log as many kinds of errors as possible comes from as many error devices as possible.

This patch is designed by Andi Kleen and Huang Ying.

---
 drivers/char/Kconfig            |    2 
 drivers/char/Makefile           |    2 
 drivers/char/herror/Kconfig     |    4 
 drivers/char/herror/Makefile    |    1 
 drivers/char/herror/herr-core.c |  599 ++++++++++++++++++++++++++++++++++++++++
 include/linux/Kbuild            |    1 
 include/linux/herror.h          |   69 ++++
 include/linux/herror_record.h   |  100 ++++++
 8 files changed, 778 insertions(+)
 create mode 100644 drivers/char/herror/Kconfig
 create mode 100644 drivers/char/herror/Makefile
 create mode 100644 drivers/char/herror/herr-core.c
 create mode 100644 include/linux/herror.h
 create mode 100644 include/linux/herror_record.h
drivers/char/Kconfig +2 -0
@@ -1129,5 +1129,7 @@ config RAMOOPS
 	  This enables panic and oops messages to be logged to a circular
 	  buffer in RAM where it can be read back at some later point.
 
+source "drivers/char/herror/Kconfig"
+
 endmenu
 
drivers/char/Makefile +2 -0
@@ -115,6 +115,8 @@ obj-$(CONFIG_RAMOOPS)		+= ramoops.o
 obj-$(CONFIG_JS_RTC)		+= js-rtc.o
 js-rtc-y = rtc.o
 
+obj-$(CONFIG_HERR_DEV_CORE)	+= herror/
+
 # Files generated that shall be removed upon make clean
 clean-files := consolemap_deftbl.c defkeymap.c
 
drivers/char/herror/Kconfig new file +4 -0
@@ -0,0 +1,4 @@
+config HERR_DEV_CORE
+	bool
+	select LLIST
+	select LLALLOC
drivers/char/herror/Makefile new file +1 -0
@@ -0,0 +1 @@
+obj-y				+= herr-core.o
drivers/char/herror/herr-core.c new file +599 -0

599 lines not on this page · raw message

include/linux/Kbuild +1 -0
@@ -140,6 +140,7 @@ header-y += gigaset_dev.h
 header-y += hdlc.h
 header-y += hdlcdrv.h
 header-y += hdreg.h
+header-y += herror_record.h
 header-y += hid.h
 header-y += hiddev.h
 header-y += hidraw.h
include/linux/herror.h new file +69 -0

69 lines not on this page · raw message

include/linux/herror_record.h new file +100 -0

100 lines not on this page · raw message

author
#6 lore raw

PATCH 6/9 Hardware error record persistent support

In reply to Huang Ying

Normally, corrected hardware error records will go through the kernel processing and be logged to disk or network finally. But for uncorrected errors, system may go panic directly for better error containment, disk or network is not usable in this half-working system. To avoid losing these valuable hardware error records, the error records are saved into some kind of simple persistent storage such as flash before panic, so that they can be read out after system reboot successfully.

Different kind of simple persistent storage implementation mechanisms are provided on different platforms, so an abstract interface for persistent storage is defined. Different implementations of the interface can be registered.

This patch is designed by Andi Kleen and Huang Ying.

---
 drivers/char/herror/Makefile        |    2 
 drivers/char/herror/herr-core.c     |   39 +++++++-
 drivers/char/herror/herr-internal.h |   12 ++
 drivers/char/herror/herr-persist.c  |  174 ++++++++++++++++++++++++++++++++++++
 include/linux/Kbuild                |    1 
 include/linux/herror.h              |   48 +++++++++
 6 files changed, 271 insertions(+), 5 deletions(-)
 create mode 100644 drivers/char/herror/herr-internal.h
 create mode 100644 drivers/char/herror/herr-persist.c
drivers/char/herror/Makefile +1 -1
@@ -1 +1 @@
-obj-y				+= herr-core.o
+obj-y				+= herr-core.o herr-persist.o
drivers/char/herror/herr-core.c +36 -3
@@ -43,9 +43,9 @@
 #include <linux/llalloc.h>
 #include <linux/herror.h>
 
-#define HERR_NOTIFY_BIT			0
+#include "herr-internal.h"
 
-static unsigned long herr_flags;
+unsigned long herr_flags;
 
 /*
  * Record list management and error reporting
@@ -524,6 +524,7 @@ static ssize_t herr_mix_read(struct file
 {
 	int rc;
 	static DEFINE_MUTEX(read_mutex);
+	u64 record_id;
 
 	if (*off != 0)
 		return -EINVAL;
@@ -531,7 +532,14 @@ static ssize_t herr_mix_read(struct file
 	rc = mutex_lock_interruptible(&read_mutex);
 	if (rc)
 		return rc;
+	rc = herr_persist_peek_user(&record_id, ubuf, usize);
+	if (rc > 0) {
+		herr_persist_clear(record_id);
+		goto out;
+	}
+
 	rc = herr_rcd_lists_read(ubuf, usize, &read_mutex);
+out:
 	mutex_unlock(&read_mutex);
 
 	return rc;
@@ -540,15 +548,40 @@ static ssize_t herr_mix_read(struct file
 static unsigned int herr_mix_poll(struct file *file, poll_table *wait)
 {
 	poll_wait(file, &herr_mix_wait, wait);
-	if (!herr_rcd_lists_is_empty())
+	if (!herr_rcd_lists_is_empty() || !herr_persist_read_done())
 		return POLLIN | POLLRDNORM;
 	return 0;
 }
 
+static long herr_mix_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
+{
+	void __user *p = (void __user *)arg;
+	int rc;
+	u64 record_id;
+	struct herr_persist_buffer buf;
+
+	switch (cmd) {
+	case HERR_PERSIST_PEEK:
+		rc = copy_from_user(&buf, p, sizeof(buf));
+		if (rc)
+			return -EFAULT;
+		return herr_persist_peek_user(&record_id, buf.buf,
+					      buf.buf_size);
+	case HERR_PERSIST_CLEAR:
+		rc = copy_from_user(&record_id, p, sizeof(record_id));
+		if (rc)
+			return -EFAULT;
+		return herr_persist_clear(record_id);
+	default:
+		return -ENOTTY;
+	}
+}
+
 static const struct file_operations herr_mix_dev_fops = {
 	.owner		= THIS_MODULE,
 	.read		= herr_mix_read,
 	.poll		= herr_mix_poll,
+	.unlocked_ioctl	= herr_mix_ioctl,
 };
 
 static int __init herr_mix_dev_init(void)
drivers/char/herror/herr-internal.h new file +12 -0
@@ -0,0 +1,12 @@
+#ifndef HERR_INTERNAL_H
+#define HERR_INTERNAL_H
+
+#define HERR_NOTIFY_BIT			0
+
+extern unsigned long herr_flags;
+
+int herr_persist_read_done(void);
+ssize_t herr_persist_peek_user(u64 *record_id, char __user *ercd,
+			       size_t bufsiz);
+int herr_persist_clear(u64 record_id);
+#endif /* HERR_INTERNAL_H */
drivers/char/herror/herr-persist.c new file +174 -0

174 lines not on this page · raw message

include/linux/Kbuild +1 -0
@@ -141,6 +141,7 @@ header-y += hdlc.h
 header-y += hdlcdrv.h
 header-y += hdreg.h
 header-y += herror_record.h
+header-y += herror.h
 header-y += hid.h
 header-y += hiddev.h
 header-y += hidraw.h
include/linux/herror.h +47 -1

61 lines not on this page · raw message

author
#7 lore raw

PATCH 7/9 ACPI, APEI, Use ERST for hardware error persisting before panic

In reply to Huang Ying

Corrected/Recoverable hardware errors can usually be saved into disk and/or sent to network for logging. But if uncorrected/fatal hardware errors occur, system may not reliable enough for desk and/or network accessing and needs to go panic as soon as possible for error containment. In this situation, ERST can be used to save the valuable error records into some persistent storage such as flash.

This patch implements herr_persist interface using ERST. So that hardware error device core can use ERST to save hardware error record before panic.

---
 drivers/acpi/apei/Kconfig |    1 
 drivers/acpi/apei/cper.c  |   19 +++++
 drivers/acpi/apei/erst.c  |  169 ++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/cper.h      |    1 
 4 files changed, 190 insertions(+)
drivers/acpi/apei/cper.c +19 -0
@@ -29,6 +29,25 @@
 #include <linux/time.h>
 #include <linux/cper.h>
 #include <linux/acpi.h>
+#include <linux/herror_record.h>
+
+int herr_severity_to_cper(int herr_severity)
+{
+	switch (herr_severity) {
+	case HERR_SEV_NONE:
+		return CPER_SEV_INFORMATIONAL;
+	case HERR_SEV_CORRECTED:
+		return CPER_SEV_CORRECTED;
+	case HERR_SEV_RECOVERABLE:
+		return CPER_SEV_RECOVERABLE;
+	case HERR_SEV_FATAL:
+		return CPER_SEV_FATAL;
+	default:
+		BUG();
+		return CPER_SEV_FATAL;
+	}
+}
+EXPORT_SYMBOL_GPL(herr_severity_to_cper);
 
 /*
  * CPER record ID need to be unique even after reboot, because record
drivers/acpi/apei/erst.c +169 -0

204 lines not on this page · raw message

include/linux/cper.h +1 -0
@@ -309,6 +309,7 @@ struct cper_sec_mem_err {
 /* Reset to default packing */
 #pragma pack()
 
+int herr_severity_to_cper(int herr_severity);
 u64 cper_next_record_id(void);
 
 #endif
drivers/acpi/apei/Kconfig +1 -0
@@ -1,6 +1,7 @@
 config ACPI_APEI
 	bool "ACPI Platform Error Interface (APEI)"
 	depends on X86
+	select HERR_DEV_CORE
 	help
 	  APEI allows to report errors (for example from the chipset)
 	  to the operating system. This improves NMI handling
author
#9 lore raw

PATCH 9/9 ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Huang Ying

Generic Hardware Error Source provides a way to report platform hardware errors (such as that from chipset). It works in so called "Firmware First" mode, that is, hardware errors are reported to firmware firstly, then reported to Linux by firmware. This way, some non-standard hardware error registers or non-standard hardware link can be checked by firmware to produce more valuable hardware error information for Linux.

This patch adds POLL/IRQ/NMI notification types support.

Because the memory area used to transfer hardware error information from BIOS to Linux can be determined only in NMI, IRQ or timer handler, but general ioremap can not be used in atomic context, so a special version of atomic ioremap is implemented for that.

---
 arch/x86/kernel/acpi/boot.c |    1 
 arch/x86/kernel/dumpstack.c |    1 
 drivers/acpi/apei/ghes.c    |  397 ++++++++++++++++++++++++++++++++++++--------
 kernel/panic.c              |    1 
 lib/ioremap.c               |    2 
 mm/vmalloc.c                |    1 
 6 files changed, 333 insertions(+), 70 deletions(-)
arch/x86/kernel/acpi/boot.c +1 -0
@@ -512,6 +512,7 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq
 	*gsi = irq_to_gsi(isa_irq);
 	return 0;
 }
+EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
 
 /*
  * success: return IRQ number (>=0)
arch/x86/kernel/dumpstack.c +1 -0
@@ -240,6 +240,7 @@ unsigned __kprobes long oops_begin(void)
 	bust_spinlocks(1);
 	return flags;
 }
+EXPORT_SYMBOL_GPL(oops_begin);
 
 void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
 {
drivers/acpi/apei/ghes.c +327 -70

546 lines not on this page · raw message

kernel/panic.c +1 -0
@@ -34,6 +34,7 @@ static int pause_on_oops_flag;
 static DEFINE_SPINLOCK(pause_on_oops_lock);
 
 int panic_timeout;
+EXPORT_SYMBOL_GPL(panic_timeout);
 
 ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
 
lib/ioremap.c +2 -0
@@ -9,6 +9,7 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <asm/cacheflush.h>
 #include <asm/pgtable.h>
 
@@ -90,3 +91,4 @@ int ioremap_page_range(unsigned long add
 
 	return err;
 }
+EXPORT_SYMBOL_GPL(ioremap_page_range);
mm/vmalloc.c +1 -0
@@ -1160,6 +1160,7 @@ void unmap_kernel_range_noflush(unsigned
 {
 	vunmap_page_range(addr, addr + size);
 }
+EXPORT_SYMBOL_GPL(unmap_kernel_range_noflush);
 
 /**
  * unmap_kernel_range - unmap kernel VM area and flush cache and TLB

Huang Ying

author
#0 lore raw

cover ACPI, APEI patches for 2.6.37

v2:

- Some minor changes according to Andi's comments.

[PATCH -v2 1/9] ACPI, APEI, Add ERST record ID cache
[PATCH -v2 2/9] Add lock-less version of bitmap_set/clear
[PATCH -v2 3/9] lock-less NULL terminated single list implementation
[PATCH -v2 4/9] lock-less general memory allocator
[PATCH -v2 5/9] Hardware error device core
[PATCH -v2 6/9] Hardware error record persistent support
[PATCH -v2 7/9] ACPI, APEI, Use ERST for hardware error persisting before panic [PATCH -v2 8/9] ACPI, APEI, Report GHES error record with hardware error device core [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

author
#8 lore raw

PATCH 8/9 ACPI, APEI, Report GHES error record with hardware error device core

One hardware error device (struct herr_dev) is created for each GHES in GHES platform device "probe" function. Then when GHES hardware error handler is notified by firmware, the hardware error records will be reported on the struct herr_dev.

In the previous GHES support, only corrected memory error can be reported to user space via /dev/mcelog, now all kinds of hardware errors notified with SCI can be reported.

---
 drivers/acpi/apei/cper.c |   18 +++++++
 drivers/acpi/apei/ghes.c |  119 +++++++++++++++++++++++++++++++----------------
 include/linux/cper.h     |    2 
 3 files changed, 99 insertions(+), 40 deletions(-)
drivers/acpi/apei/cper.c +18 -0
@@ -49,6 +49,24 @@ int herr_severity_to_cper(int herr_sever
 }
 EXPORT_SYMBOL_GPL(herr_severity_to_cper);
 
+int cper_severity_to_herr(int cper_severity)
+{
+	switch (cper_severity) {
+	case CPER_SEV_INFORMATIONAL:
+		return HERR_SEV_NONE;
+	case CPER_SEV_CORRECTED:
+		return HERR_SEV_CORRECTED;
+	case CPER_SEV_RECOVERABLE:
+		return HERR_SEV_RECOVERABLE;
+	case CPER_SEV_FATAL:
+		return HERR_SEV_FATAL;
+	default:
+		/* Unknown, default to fatal */
+		return HERR_SEV_FATAL;
+	}
+}
+EXPORT_SYMBOL_GPL(cper_severity_to_herr);
+
 /*
  * CPER record ID need to be unique even after reboot, because record
  * ID is used as index for ERST storage, while CPER records from
drivers/acpi/apei/ghes.c +79 -40

185 lines not on this page · raw message

include/linux/cper.h +2 -0
@@ -22,6 +22,7 @@
 #define LINUX_CPER_H
 
 #include <linux/uuid.h>
+#include <linux/herror_record.h>
 
 /* CPER record signature and the size */
 #define CPER_SIG_RECORD				"CPER"
@@ -310,6 +311,7 @@ struct cper_sec_mem_err {
 #pragma pack()
 
 int herr_severity_to_cper(int herr_severity);
+int cper_severity_to_herr(int cper_severity);
 u64 cper_next_record_id(void);
 
 #endif
#10 lore raw

[NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Huang Ying
Quoted 17 lines · Huang Ying

Generic Hardware Error Source provides a way to report platform hardware errors (such as that from chipset). It works in so called "Firmware First" mode, that is, hardware errors are reported to firmware firstly, then reported to Linux by firmware. This way, some non-standard hardware error registers or non-standard hardware link can be checked by firmware to produce more valuable hardware error information for Linux.

This patch adds POLL/IRQ/NMI notification types support.

Because the memory area used to transfer hardware error information from BIOS to Linux can be determined only in NMI, IRQ or timer handler, but general ioremap can not be used in atomic context, so a special version of atomic ioremap is implemented for that.

Quoted 8 lines
---
 arch/x86/kernel/acpi/boot.c |    1 
 arch/x86/kernel/dumpstack.c |    1 
 drivers/acpi/apei/ghes.c    |  397 ++++++++++++++++++++++++++++++++++++--------
 kernel/panic.c              |    1 
 lib/ioremap.c               |    2 
 mm/vmalloc.c                |    1 
 6 files changed, 333 insertions(+), 70 deletions(-)

WTF?

Sigh, please integrate all this into EDAC (drivers/edac/) properly, instead of turning it into YET ANOTHER hardware vendor special hw-errors thing. We can do better than this. EDAC is almost there: it has support for Nehalem, AMD, a couple of older chips.

Guys, instead of carving out a special driver area where you can produce crap without anyone looking too much, and pretending that the EDAC code does not exist, please try to work with others who are aiming higher and who are using saner interfaces.

Just look at the higher level structure in drivers/acpi/apei/:

apei-base.c apei-internal.h cper.c einj.c erst.c erst-dbg.c ghes.c hest.c Kconfig Makefile

ghes, einj, cper, erst? Someone's been abbreviating too much.

einj.c: it's about the 3rd separate 'error injection' concept that got introduced
...

Please _THINK_ for goodness's sake and try to get some usable, coherent, generic interface to users - instead of just directly implementing whatever crap hw designers came up with.

So unless Linus or Andrew overrules me i'll NAK this before the insanity spreads too much:

(Someone should have NAK-ed it when the first iteration was merged.)

Thanks,

Ingo

author
#11 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 28 lines · Ingo Molnar
Quoted 17 lines · Huang Ying

Generic Hardware Error Source provides a way to report platform hardware errors (such as that from chipset). It works in so called "Firmware First" mode, that is, hardware errors are reported to firmware firstly, then reported to Linux by firmware. This way, some non-standard hardware error registers or non-standard hardware link can be checked by firmware to produce more valuable hardware error information for Linux.

This patch adds POLL/IRQ/NMI notification types support.

Because the memory area used to transfer hardware error information from BIOS to Linux can be determined only in NMI, IRQ or timer handler, but general ioremap can not be used in atomic context, so a special version of atomic ioremap is implemented for that.

Quoted 8 lines
---
 arch/x86/kernel/acpi/boot.c |    1 
 arch/x86/kernel/dumpstack.c |    1 
 drivers/acpi/apei/ghes.c    |  397 ++++++++++++++++++++++++++++++++++++--------
 kernel/panic.c              |    1 
 lib/ioremap.c               |    2 
 mm/vmalloc.c                |    1 
 6 files changed, 333 insertions(+), 70 deletions(-)
Quoted 6 lines

WTF?

Sigh, please integrate all this into EDAC (drivers/edac/) properly, instead of turning it into YET ANOTHER hardware vendor special hw-errors thing. We can do better than this. EDAC is almost there: it has support for Nehalem, AMD, a couple of older chips.

I think APEI (ACPI Platform Error Interface) is another driver. Why integrate two drivers?

Quoted 10 lines

Guys, instead of carving out a special driver area where you can produce crap without anyone looking too much, and pretending that the EDAC code does not exist, please try to work with others who are aiming higher and who are using saner interfaces.

Just look at the higher level structure in drivers/acpi/apei/:

apei-base.c apei-internal.h cper.c einj.c erst.c erst-dbg.c ghes.c hest.c Kconfig Makefile

ghes, einj, cper, erst? Someone's been abbreviating too much.

Maybe they are not good name. But they are defined in ACPI specification. Using the same name makes it easier for people to link the specification to corresponding implementation.

Quoted 2 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced
...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Best Regards,
Huang Ying

#12 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 7 lines
Quoted 4 lines

Sigh, please integrate all this into EDAC (drivers/edac/) properly, instead of turning it into YET ANOTHER hardware vendor special hw-errors thing. We can do better than this. EDAC is almost there: it has support for Nehalem, AMD, a couple of older chips.

I think APEI (ACPI Platform Error Interface) is another driver. Why integrate two drivers?

Yes they're solving quite different problems from EDAC with different interfaces and for different devices in the ACPI space.

The earlier nack seems to be based on a lot of confusion on what the code does.

Besides it nacks code in areas Ingo doesn't even maintain. (if he's allowed to nack random other code he doesn't like do I get this right too? :-)

Quoted 5 lines
Quoted 2 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced
...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Also having multiple error injecting interfaces is a good thing.

Error injection is hard and one size definitely doesn't fit all. You need quite different ones depending on what you want to test, in which context etc.

For hwpoison we currently have three different injectors at least and I expect that to even grow more in the future as different features get added.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#26 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Huang Ying
Quoted 7 lines · Huang Ying
Quoted 4 lines

Sigh, please integrate all this into EDAC (drivers/edac/) properly, instead of turning it into YET ANOTHER hardware vendor special hw-errors thing. We can do better than this. EDAC is almost there: it has support for Nehalem, AMD, a couple of older chips.

I think APEI (ACPI Platform Error Interface) is another driver. Why integrate two drivers?

Sigh. I did not say integrate the drivers - integrate the _error event facilities_.

You can have drivers/edac/apei/ghes* bits just fine (in fact it would be desirable, to keep things modular).

Really, just read the two Kconfig entries:

bool "EDAC (Error Detection And Correction) reporting"

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc..

...

tristate "APEI Generic Hardware Error Source"

Generic Hardware Error Source provides a way to report platform hardware errors (such as that from chipset).

drivers/acpi/apei/ overlaps and duplicates drivers/edac/. We dont want two facilities, two ABIs, two sets of behavior. erst-dbg even defines a /dev node with two ioctls, and a debugfs file to read/write records ...

I have NAK-ed various attempts to extend /dev/mcelog and asked for it to be done properly, and work has begun on that - but the debugfs interface here just tries to work around those objections by stealth.

I'd like you and Andi to listen not just to the letter of NAKs but to the spirit as well. If you get a NAK in one subsystem you should not just try to route around the NAK, go to some other subsystem, figure out a slightly different scheme and try to sneak crap upstream ...

If you disagree with the mcelog NAK, if you disagree with EDAC directions then at least do it openly and honestly and Cc: the parties that sent you the NAK and work with the EDAC guys to migrate to the facility you are advancing ...

Thanks,

Ingo

#13 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Andi Kleen
Quoted 10 lines · Andi Kleen
Quoted 7 lines
Quoted 4 lines

Sigh, please integrate all this into EDAC (drivers/edac/) properly, instead of turning it into YET ANOTHER hardware vendor special hw-errors thing. We can do better than this. EDAC is almost there: it has support for Nehalem, AMD, a couple of older chips.

I think APEI (ACPI Platform Error Interface) is another driver. Why integrate two drivers?

Yes they're solving quite different problems from EDAC with different interfaces and for different devices in the ACPI space.

That's my whole point, _why_ do they have different interfaces?

EDAC is the upstream mechanism to organize hardware error reporting and to get hardware errors to user-space. It is already successful in handling a wide range of hardware in a similar fashion.

Furthermore, there is work ongoing to do the reporting via perf event channels, some of that work is upstream already. Boris is working on persistent events, on RAS tooling (tools/ras/) and on event injection. Here's a past submission of his work:

http://lwn.net/Articles/394522/

You are now doing a completely separate thing here, detaching a big CPU vendor from the main body of Linux code that deals with this stuff.

IMHO that's not helpful _at all_.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced ...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Also having multiple error injecting interfaces is a good thing.

It's never a good thing to have separate, vendor dependent interfaces for what to the user is basically the same conceptual thing!

Quoted 2 lines

Error injection is hard and one size definitely doesn't fit all. You need quite different ones depending on what you want to test, in which context etc.

And that kind of variance is in your opinion a good reason to introduce separate user ABIs for it?

( And i dont care that there might be no 'end user' for hardware error injection per
se right now. There is certainly an 'end user' for hardware error events and even _there_ you are introducing and pushing for separate, incompatible interfaces. )

We have really good historic data here: we got the _biggest_ practical advantage from event enumeration (/debug/tracing/events/) when we extended it in a generic, unified way to the rich topology that the hardware and the kernel gives us.

That way we got new, useful tools like powertop, timechart or pytimechart or the edac tool, which can concentrate on a single, well-defined event topology and event ABI.

Why do these tools like this kind of unified event enumeration and reporting facilities, which you are fighting against so hard? Because of the big technological advantage of having to deal with one enumeration and reporting facility alone. They can get power events, scheduling events, timer events, kmalloc events all from the same source - even though these subsystems have barely anything in common! Tools can then combine these seemingly unrelated events into something new and useful.

It's a very extensible model, and with every new event type added, the tool space gets richer _together_.

Error event injection to simulate/trigger various error conditions in those events is a natural extension to the whole events framework - not something that should be in a randomly different way.

What you are doing here is to fragment the whole landscape into small, incompatible, vendor specific bits. Some of it is in /dev, some of it is in debugfs, some things report via signals, etc. etc.

It's inconsistent, messy and doesnt integrate well with the events framework we are building.

That was the main basis of my prior NAK, and you have said _nothing_ in the past that invalidates the fundamental points of that NAK.

Instead you started, by stealth and by duplicity, looking for ways to get around that conceptual NAK.

Quoted 2 lines

For hwpoison we currently have three different injectors at least and I expect that to even grow more in the future as different features get added.

That's insane!

Ingo

#14 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Em 25-10-2010 09:15, Ingo Molnar escreveu:

Quoted 24 lines · Andi Kleen
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines

Sigh, please integrate all this into EDAC (drivers/edac/) properly, instead of turning it into YET ANOTHER hardware vendor special hw-errors thing. We can do better than this. EDAC is almost there: it has support for Nehalem, AMD, a couple of older chips.

I think APEI (ACPI Platform Error Interface) is another driver. Why integrate two drivers?

Yes they're solving quite different problems from EDAC with different interfaces and for different devices in the ACPI space.

That's my whole point, _why_ do they have different interfaces?

EDAC is the upstream mechanism to organize hardware error reporting and to get hardware errors to user-space. It is already successful in handling a wide range of hardware in a similar fashion.

Furthermore, there is work ongoing to do the reporting via perf event channels, some of that work is upstream already. Boris is working on persistent events, on RAS tooling (tools/ras/) and on event injection. Here's a past submission of his work:

Quoted 6 lines

http://lwn.net/Articles/394522/

You are now doing a completely separate thing here, detaching a big CPU vendor from the main body of Linux code that deals with this stuff.

IMHO that's not helpful _at all_.

I agree with Ingo NAK.

Having vendor-dependent API's for errors is not the way to solve those issues. We should focus on an unique hardware error report facility that will provide a clean, consistent, vendor-independent interface to userspace. EDAC successfully achieved this target for the current designs, and it is evolving to cover newer hardware needs.

We had some discussions with Intel during the Collaboration summit about that, trying to integrate Nehalem EX on such environment, with, unfortunately, didn't happen, as Intel didn't release any (public) datasheet describing Nehalem EX memory controller, nor wrote such driver.

As most of us will be in Boston next week, I've reserved a BoF at Plumbers for us to discuss about this subject:

http://www.linuxplumbersconf.org/2010/ocw/proposals/921

Quoted 63 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced ...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Also having multiple error injecting interfaces is a good thing.

It's never a good thing to have separate, vendor dependent interfaces for what to the user is basically the same conceptual thing!

Quoted 2 lines

Error injection is hard and one size definitely doesn't fit all. You need quite different ones depending on what you want to test, in which context etc.

And that kind of variance is in your opinion a good reason to introduce separate user ABIs for it?

( And i dont care that there might be no 'end user' for hardware error injection per
se right now. There is certainly an 'end user' for hardware error events and even _there_ you are introducing and pushing for separate, incompatible interfaces. )

We have really good historic data here: we got the _biggest_ practical advantage from event enumeration (/debug/tracing/events/) when we extended it in a generic, unified way to the rich topology that the hardware and the kernel gives us.

That way we got new, useful tools like powertop, timechart or pytimechart or the edac tool, which can concentrate on a single, well-defined event topology and event ABI.

Why do these tools like this kind of unified event enumeration and reporting facilities, which you are fighting against so hard? Because of the big technological advantage of having to deal with one enumeration and reporting facility alone. They can get power events, scheduling events, timer events, kmalloc events all from the same source - even though these subsystems have barely anything in common! Tools can then combine these seemingly unrelated events into something new and useful.

It's a very extensible model, and with every new event type added, the tool space gets richer _together_.

Error event injection to simulate/trigger various error conditions in those events is a natural extension to the whole events framework - not something that should be in a randomly different way.

What you are doing here is to fragment the whole landscape into small, incompatible, vendor specific bits. Some of it is in /dev, some of it is in debugfs, some things report via signals, etc. etc.

It's inconsistent, messy and doesnt integrate well with the events framework we are building.

That was the main basis of my prior NAK, and you have said _nothing_ in the past that invalidates the fundamental points of that NAK.

Instead you started, by stealth and by duplicity, looking for ways to get around that conceptual NAK.

Quoted 2 lines

For hwpoison we currently have three different injectors at least and I expect that to even grow more in the future as different features get added.

That's insane!

Ingo

#17 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Ingo Molnar
Quoted 10 lines · Ingo Molnar
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced ...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Also having multiple error injecting interfaces is a good thing.

It's never a good thing to have separate, vendor dependent interfaces for what to the user is basically the same conceptual thing!

Perhaps a simple example (simplified, in practice there are more complications) makes it more clear:

The memory error handler does different actions depending on what the state the page the error is happening on is in.

To get reasonable coverage of the recovery code you need to present it with pages in different states (like locked, clean, dirty, IO etc. etc. )

Now it turns out this is very hard to do if you just inject the error at the hardware level, because there are lots of races and problems ensuring the page is still in the expected state etc.etc.

So one of the solution hwpoison did for this was to have another injector that works on the process level. At the process level you can get pages into different stages and reasonably cleanly inject the right error with the right context. This is essentially error injection at the VM level.

Again this is simplified, for coverage we actually needed multiple injectors that work at different entry points, e.g. for example to make sure buffered file system pages are correctly handled too.

Now that's great, but we still need other injectors that work on other level, otherwise the part that talks to the hardware are not covered at all

But you cannot test all the code paths of that code either using a single hardware injector. So there's another one that can fake different contexts at the software level and provides reasonable
coverage of this code.

But then you still didn't test the whole hardware to software error path. Now yes you could use a EDAC like ECC bits injector (which BTW doesn't really need a kernel driver, we did it just using shell scripts fine before). But that also only tests one path and not the others possibilities, and also only works on specific hardware in specific modes with very careful setup.

But that's just one type of error for one system. So you need other interfaces for other hardware and for other errors etc.etc.

In some cases you also need to talk to the BIOS to do this injection for various reasons, that is where ACPI comes in (and all these acronyms you seem to object to)

Also it's not enough to do single error injection once on some system. You need a repeatable regression test that ensure the error handling stays operable for kernels as they evolve. This requires that the error injection is reasonably portable.

For this I tried to have a "software only" injector for nearly everything just to make sure the code can be always tested. Unfortunately the software injectors, especially the ones aiming at larger coverage, also have quite different interface requirements than hardware interfaces.

But again you still need to test the full hardware too, otherwise we don't know if the error handling is really working on a real system in practice.

Error injection is just messy. There is no single general solution that works for everything and solves all problems, but you really need a pragmatic approach for every subsystem.

In the end it means you end up with lots of different injectors, all tied to some specific problem.

Would it be nice if there was a single great injector that covers everything? Yes
Is it realistic? No.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#18 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 10 lines · Andi Kleen
Quoted 8 lines · Ingo Molnar
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced ...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Also having multiple error injecting interfaces is a good thing.

Quoted 8 lines
Quoted 2 lines

It's never a good thing to have separate, vendor dependent interfaces for what to the user is basically the same conceptual thing!

Perhaps a simple example (simplified, in practice there are more complications) makes it more clear:

The memory error handler does different actions depending on what the state the page the error is happening on is in.

What you appear to be arguing for is the ability to inject different types of events.

_OF COURSE_ we want that.

Just like we want to be able to _receive_ multiple types of events from wildly different hardware and wildly different kernel subsystems ...

Duh.

That desire does not necessiate 'three different injectors' at all. It does not necessiate multiple incompatible facilities with random ABIs.

What we want is a single injector facility visible to RAS/hw-testing/etc. apps, and a way to pass in attributes that specify the kind of event that we want to trigger.

Also note that you completely ignored the other basis of my objection and NAK: that the whole ad-hoc event log export that this code does via the /dev/erst-dbg ABI is actively harmful.

Quoted 2 lines

Would it be nice if there was a single great injector that covers everything? Yes Is it realistic? No.

Everyone else working on this area thinks it's realistic, and is in fact working on such a facility.

The main thing that is causing confusion here is not the technical viability of such a project (it's evidently doable and desirable), but your unwillingness to cooperate. If Intel goes into random directions and essentially obstructs upstream projects then we wont have this implemented on Intel CPUs sanely and cleanly - despite Mauro's best efforts on the Nehalem code.

But you should really not bring that up as some kind of positive argument ...

Thanks,

Ingo

#19 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 8 lines · Ingo Molnar
Quoted 2 lines

The memory error handler does different actions depending on what the state the page the error is happening on is in.

What you appear to be arguing for is the ability to inject different types of events.

_OF COURSE_ we want that.

Quoted 7 lines

Just like we want to be able to _receive_ multiple types of events from wildly different hardware and wildly different kernel subsystems ...

Duh.

That desire does not necessiate 'three different injectors' at all. It does not necessiate multiple incompatible facilities with random ABIs.

And note that once there's a generic facility that allows event injection, the actual low level implementation might of course be hardware specific. There's no reduction in actual feature richness: if the hw can do fancy things, it can be expressed via a generic facility as well.

What i object to is the narrow hardware specificity (and ad-hocness) of the high level interface and its non-integration into existing facilities.

Thanks,

Ingo

#20 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Ingo Molnar
Quoted 16 lines · Ingo Molnar
Quoted 13 lines · Andi Kleen
Quoted 10 lines · Ingo Molnar
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced ...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Also having multiple error injecting interfaces is a good thing.

It's never a good thing to have separate, vendor dependent interfaces for what to the user is basically the same conceptual thing!

Quoted 8 lines
Quoted 5 lines

Perhaps a simple example (simplified, in practice there are more complications) makes it more clear:

The memory error handler does different actions depending on what the state the page the error is happening on is in.

What you appear to be arguing for is the ability to inject different types of events.

Different events in different contexts with different drivers with different parameters using different tools.

Commonality: about 0% exept there's "error" somewhere in the description.

-Andi

#21 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 20 lines · Andi Kleen
Quoted 19 lines · Ingo Molnar
Quoted 16 lines · Andi Kleen
Quoted 10 lines · Ingo Molnar
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

einj.c: it's about the 3rd separate 'error injection' concept that got introduced ...

EINJ is a true platform feature, not just software feature. We need to support it to debug various hardware error features.

Also having multiple error injecting interfaces is a good thing.

It's never a good thing to have separate, vendor dependent interfaces for what to the user is basically the same conceptual thing!

Perhaps a simple example (simplified, in practice there are more complications) makes it more clear:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

The memory error handler does different actions depending on what the state the page the error is happening on is in.

What you appear to be arguing for is the ability to inject different types of events.

Different events in different contexts with different drivers with different parameters [...]

Correct.

Quoted 1 line

[...] using different tools.

That's possible, but i'd expect tools/ras/ to be populated with uniformly working tools. There's little sense in fragmenting the hw-testing field...

Quoted 1 line

Commonality: about 0% exept there's "error" somewhere in the description.

Wrong. Their main purpose is common: they are events attached to existing hardware topologies, which events can be configured, which events can be received and which can be injected with attributes for rare-event simulation purposes.

The tool people have spoken to us clear and loud that they want to _receive_ events in a unified and structured way - not via lots of separate ABIs from facilities that have mismatching capabilities.

We want to be able to inject _other_ events as well, not just hw-error ones - especially rare ones.

I.e. there's clear, demonstrated, patches-pending demand for uniformity and there's similar demand for a broader concept.

You are now making the point that somehow the receipt and sending/injecting of 'hw errors on Intel hardware' should be a separate, fragmented, disoriented, messy piece of interface design, closely matching some ACPI spec detail, which should be disassociated from the preferred mechanism of error reporting?

Your argument makes absolutely no sense to me.

The kernel is an abstraction machine: common hw aspects should be generalized to the extent it makes sense, with reasonable extensions for anything we dont want (or cannot) generalize.

There's _tons_ of interesting structure here to be taken advantage of: just look at what Boris is trying to achieve with his EDAC tooling patches. See what Lin Ming is trying to do by moving event descriptors to /sys, so that events can come with elements of our hw and sw topology in a natural way.

There is absolutely no justification whatsoever for the new /dev/erst-dbg ABI ...

Furthermore, you have ignored my other argument for the second time now: why does this code not do the event _reporting_ via the facilities we use and prefer? As far as users are concerned, the ability to receive hardware error events in a unified way is an even more important aspect than the matter of event injection.

Once you do that i think you will see how naturally error injection fits into the picture as well. It is an aspect of pretty much any event (not just hw-error events) that we want to be able to 'inject/simulate' them, to test tools.

Your refusal to even consider this possibility and to look at the EDAC/RAS patches that deal with this is puzzling to me.

Thanks,

Ingo

#22 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 9 lines
Quoted 2 lines

Different events in different contexts with different drivers with different parameters [...]

Correct.

Quoted 1 line

[...] using different tools.

That's possible, but i'd expect tools/ras/ to be populated with uniformly working tools. There's little sense in fragmenting the hw-testing field...

First if you want to avoid fragmentation please contribute to mce-test

git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git

That's the standard area for tests in this area for several years with many contributors. If anyone has anything new they want to inject and it roughly fits hardware errors it can be placed there. These days it already tests more than just mces.

Then the tools are actually more like test suites that do all kind of different things. For example the testers for hwpoison high level is a set of programs that get continuously extended. There's no straight forward way to do all this from the command line, because you need to write quite a lot of code just to get the basic context needed for the specific code path.

As an example of this see the cases in tinjpage:

http://git.kernel.org/?p=utils/cpu/mce/mce-test.git;a=blob;f=tsrc/tinjpage.c;h=1042c132a3235c6bc0fbbe4ee8f68f0c6f96804f;hb=HEAD

Compare it to random_offline which tests global soft offline coverage

http://git.kernel.org/?p=utils/cpu/mce/mce-test.git;a=blob;f=tsrc/random_offline;h=c380a86075511de4fedb0cff9bf99a53d9215cf0;hb=HEAD

Compare it to the file system stress suite which tests file system buffer recovery:

http://git.kernel.org/?p=utils/cpu/mce/mce-test.git;a=tree;f=stress;h=e0c7c281ea9a2753d326d6ab9e0dbe566f762cf1;hb=HEAD

And compare it to the mce coverage test suite which tests low level machine check coverage:

http://git.kernel.org/?p=utils/cpu/mce/mce-test.git;a=tree;f=cases/soft-inj;h=b0eac7aad53709c0ca7899d56698445646a51c3a;hb=HEAD

with mce-inject (software) as base:

http://git.kernel.org/?p=utils/cpu/mce/mce-inject.git;a=blob;f=mce.y;h=9a8bb0385e4c3f35f8115b42e0c859623ff9cde7;hb=HEAD

and with APEI as base

http://git.kernel.org/?p=utils/cpu/mce/mce-test.git;a=tree;f=cases/apei-inj;h=bbdffe6528f763b89b9ee1f954869a0f90d4deda;hb=HEAD

They are really all quite different.

On merging them:

Well ok in theory one could have ras test1|test2|test3

But you would end up like git and perf where you have lots of different tools just linked into the same executable. Not really an advantage, would you agree on that? Ok i understand in the git/perf case there's also a common library, but at least in the error injection case there isn't really.

Anyways if the request is to link everything into a single binary it could be looked at, but I must admit I personally don't see any advantage from that.

Or you could have a single kernel inject interface with a bazillion modi and different options that needs to be extended all the time to cover some new case. Aka the ioctl multiplexer from hell. I don't think that's really
an appealing alternative. It would work if all the injections were very similar, but they are really not. They are all different.

Current way is to have own files in debugfs for each
or put in other places where it fits (e.g. madvise for in process injection)

Is the problem that there is no cleanly defined place in debugfs for it? Maybe could simply define a standard directory structure in debugfs?

I don't have a problem with that. Right now the approach was to put it into a directory per subsystem, but perhaps there could be something better.

Quoted 2 lines

Your refusal to even consider this possibility and to look at the EDAC/RAS patches that deal with this is puzzling to me.

What I find puzzling is that you really continue to ignore all the practical details, and still nack other people's work without even trying to understand it.

That's not really the old Ingo I used to know.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#25 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Andi Kleen
Quoted 5 lines · Andi Kleen
Quoted 5 lines
Quoted 4 lines

Sigh, please integrate all this into EDAC (drivers/edac/) properly, instead of turning it into YET ANOTHER hardware vendor special hw-errors thing. We can do better than this. EDAC is almost there: it has support for Nehalem, AMD, a couple of older chips.

Quoted 8 lines
Quoted 2 lines

I think APEI (ACPI Platform Error Interface) is another driver. Why integrate two drivers?

Yes they're solving quite different problems from EDAC with different interfaces and for different devices in the ACPI space.

The earlier nack seems to be based on a lot of confusion on what the code does.

Errm. That patch series carries a lot of other weird stuff including a new "memory allocator", a new ioremap implementation private to the acpi code and new character device driver for hardware error reporting.

Quoted 8 lines

Subject: [PATCH -v2 5/9] Hardware error device core

Hardware error device is a kind of device which can report hardware errors. The examples of hardware error device include APEI GHES, PCIe AER, etc.

Hardware error device core in this patch provides common services for various hardware error devices.

But it does not even make an attempt to explain why this error reporting cannot be done via the existing interfaces and why they can't be extended to fit your needs. What's so special about APEI GHES and PCIe AER that we need another incompatible "just fits your needs" ABI which makes tooling folks deal with another completely different interface ?

The only explanation I have is that you are simply not willing to work with others and this is just another proof of a repeating problem.

Thanks,

tglx

#15 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Mauro Carvalho Chehab
Quoted 4 lines · Mauro Carvalho Chehab

We had some discussions with Intel during the Collaboration summit about that, trying to integrate Nehalem EX on such environment, with, unfortunately, didn't happen, as Intel didn't release any (public) datasheet describing Nehalem EX memory controller, nor wrote such driver.

The chipset registers that are needed to write an EDAC driver for Nehalem-EX (a.k.a Xeon
7500 series) are not accessible to OS (ring 0) code. Documenting them wouldn't change this.

Quoted 4 lines

As most of us will be in Boston next week, I've reserved a BoF at Plumbers for us to discuss about this subject:

http://www.linuxplumbersconf.org/2010/ocw/proposals/921

An excellent idea. See you there.

-Tony

#23 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Andi Kleen
Quoted 3 lines · Andi Kleen

[...]

They are really all quite different.

The differences in those tools do not seem natural. Those tools are mostly just different for difference's sake - which is sad.

They could also admittedly benefit from a proper build mechanism and other integration goodies. For example when building mce-inject i get:

  $ make
  Makefile:42: .depend: No such file or directory

When running the mce-inject tool it apparently hangs:

  $ ./mce-inject 

(it's waiting for stdin)

it does not recognize any of the standard arguments:

  $ ./mce-inject -h
  -h: No such file or directory
  $ ./mce-inject --help
  --help: No such file or directory
  $ 

That's rather user-unfriendly.

Also, that's all besides the point, exactly _why_ should bad tooling examples be justification for us to continue that bad example in kernel-space and to ignore good user-space tooling examples?

Also, my NAK is not really against your user-space tooling - my NAK is against the kernel bits.

Quoted 3 lines

On merging them:

Well ok in theory one could have ras test1|test2|test3

It's a good first step to realize that.

Quoted 2 lines

But you would end up like git and perf where you have lots of different tools just linked into the same executable. [...]

... or LTP, which too is a suite of many tests.

For testing it's especially good to think in 'suites', as there are many repetitive components and people quite often tend to want to use all the tests when they are validating, certifying, debugging a particular piece of hardware.

Quoted 1 line

[...] Not really an advantage, would you agree on that?

If you only look at Git, perf and LTP as examples then them offering a consistent, integrated command, configuration and handling interface is _wildly_ advantageous.

There's a common help system, common documentation, common parameters, common workflow and a common philosophy behind those tools - and more. There's development process advantages as well: beyond sharing code via common libraries the developers cross much easier and generally advantages of economy of scale apply.

Note, i'm not telling you to follow those examples. I only point out that they exist and that we try to shape the kernel interfaces based on sane examples not based on insane examples.

Quoted 2 lines

Ok i understand in the git/perf case there's also a common library, but at least in the error injection case there isn't really.

There isnt really mostly because you are not making use of common facilities. That's my whole point. It's a bug, not a feature. You make this area flow apart into inconsistent utilities, there's no coherency.

Which is fine to me as long as you dont contaminate the kernel with that kind of incoherency ...

Quoted 2 lines

Anyways if the request is to link everything into a single binary it could be looked at, but I must admit I personally don't see any advantage from that.

Why do you limit the advantages of Git et al to 'linking into a single binary' artificially? It isnt the only or even main advantage.

( That claim isnt even true technically, perf for example supports and uses script
extensions that are separate from the main binary. Git has similar helpers as well although it tends to integrate all core functionality. )

Quoted 3 lines

Or you could have a single kernel inject interface with a bazillion modi and different options that needs to be extended all the time to cover some new case. Aka the ioctl multiplexer from hell. [...]

Why use an ioctl multiplexer from hell?

A proper system call or sysfs based approach should be used - that way the hierarchy and structure is achieved via a VFS namespace.

CPU events would be under /sys/devices/system/cpu/cpu0/events/
IO-APIC events would be under /sys/devices/system/ioapic/ioapic0/events/
NUMA node events would be under /sys/devices/system/node/node0/events/
PCI chipset events would be under /sys/devices/pci0000:00/events/

etc.

There would be a /sys/class/events/ iterator to find all events, etc.

There is no messy ioctl demux - just a clean hiearchy of hw structure, and event and hardware specific implementations of them (with a good deal of sane default behavior, as many events dont need special treatment).

The main 'global' property that is absolutely needed is event enumeration.

Regular event reporting is event 'output' - while injection is really event 'input' with custom handlers to make it trigger under the right circumstances, but it's essentially the same abstract model that stands behind them.

Quoted 2 lines

[...] I don't think that's really an appealing alternative. It would work if all the injections were very similar, but they are really not. They are all different.

If you are artificially limiting options to an insane solution then of course it looks all unappealing to you ...

How about not doing that and considering the model we outlined?

Quoted 2 lines

Current way is to have own files in debugfs for each or put in other places where it fits (e.g. madvise for in process injection)

As i mentioned it several times (and even in the previous mail) we are moving it to sysfs - several versions of patches have been posted.

So why are you pretending that debugfs is our main goal? It isnt.

Quoted 5 lines

Is the problem that there is no cleanly defined place in debugfs for it? Maybe could simply define a standard directory structure in debugfs?

I don't have a problem with that. Right now the approach was to put it into a directory per subsystem, but perhaps there could be something better.

Right. A first good step would be to log all those ERST events via TRACE_EVENT() and map out any missing bits you may need to get them logged.

Another useful area would be to help out Ling Ming finish up the sysfs bits, and to have events attach to existing topologies that Linux enumerates already.

Another good place to help would be Boris and the RAS tool, which involves the definition of new events that cover all the relevant event sources, and the population of tools/edac/ with tooling. That too could grow APEI and ERST logging (and later, injection) awareness.

Yet another useful area would be to define injection capabilities to TRACE_EVENT() type of events.

Quoted 5 lines
Quoted 2 lines

Your refusal to even consider this possibility and to look at the EDAC/RAS patches that deal with this is puzzling to me.

What I find puzzling is that you really continue to ignore all the practical details, and still nack other people's work without even trying to understand it.

If only you listed practical details then we could address them ...

But as long as you come up with vague objections there's little i can do but to point out crap when it happens later: when you ignore what i suggest and then post a messy solution a few months down the line.

Quoted 1 line

That's not really the old Ingo I used to know.

That comes with me being a maintainer i'm afraid, i'm more directly affected by bad patches so i object to them more frequently. I'm also kind of expected to do that.

Thanks,

Ingo

#27 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Ingo Molnar
Quoted 3 lines · Ingo Molnar

drivers/acpi/apei/ overlaps and duplicates drivers/edac/. We dont want two facilities, two ABIs, two sets of behavior. erst-dbg even defines a /dev node with two ioctls, and a debugfs file to read/write records ...

As mentioned above these 4-letter names from from the ACPI specification. ERST is perhaps the dumbest name of them all - "Error Record Serialization Table" is ACPI-speak for platform level non-volatile memory. This code simply provides a mechanism for Linux to stash some information in nvram before the system is reset, and to retrieve it after the reboot.

The naming could be better - but I don't see any overlap with EDAC here.

-Tony

#16 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Tony Luck

Em 25-10-2010 15:07, Tony Luck escreveu:

Quoted 11 lines
Quoted 4 lines · Mauro Carvalho Chehab

We had some discussions with Intel during the Collaboration summit about that, trying to integrate Nehalem EX on such environment, with, unfortunately, didn't happen, as Intel didn't release any (public) datasheet describing Nehalem EX memory controller, nor wrote such driver.

The chipset registers that are needed to write an EDAC driver for Nehalem-EX (a.k.a Xeon
7500 series) are not accessible to OS (ring 0) code. Documenting them wouldn't change this.

Yeah, I know.

The error reporting mechanism could do something similar to i7core_edac driver to parse the MCE NMI errors to userspace via EDAC interface, but without any way to get the memory topology, this wouldn't work. With some documentation, maybe we could find a way for a kernel code to retrieve the memory topology, maybe via BIOS, and make it work.

Quoted 6 lines
Quoted 4 lines

As most of us will be in Boston next week, I've reserved a BoF at Plumbers for us to discuss about this subject:

http://www.linuxplumbersconf.org/2010/ocw/proposals/921

An excellent idea. See you there.

OK,

See you there.

Thanks,
Mauro

maintainer
#28 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Tony Luck
Quoted 6 lines · Tony Luck
Quoted 3 lines · Ingo Molnar

drivers/acpi/apei/ overlaps and duplicates drivers/edac/. We dont want two facilities, two ABIs, two sets of behavior. erst-dbg even defines a /dev node with two ioctls, and a debugfs file to read/write records ...

Quoted 7 lines

As mentioned above these 4-letter names from from the ACPI specification. ERST is perhaps the dumbest name of them all - "Error Record Serialization Table" is ACPI-speak for platform level non-volatile memory. This code simply provides a mechanism for Linux to stash some information in nvram before the system is reset, and to retrieve it after the reboot.

The naming could be better - but I don't see any overlap with EDAC here.

You may be right but what we actually want is a consistent RAS infrastructure. Didn't you point out at the last edac meeting in Boston that concerning RAS Linux were in the stone ages? (at least this is what I remember reading).

What we should do is put all that post-system-reset error info, ECC errors mapping to DRAM devices, L3 cache index manipulation based on excessive errors - you name it - together and stick it in ras/ or drivers/ras or whatever. And all with a nice and easy to use userspace tool on top.

Now it looks like a wart on arch/x86/ which truly doesn't belong there. And I don't buy all that crap that it can't be done right.

Thanks.

Signature · 2 lines
Regards/Gruss,
    Boris.
#29 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 4 lines · Borislav Petkov

You may be right but what we actually want is a consistent RAS infrastructure. Didn't you point out at the last edac meeting in Boston that concerning RAS Linux were in the stone ages? (at least this is what I remember reading).

That meeting was in San Francisco - but your recollection is correct. Right now we have ways to count errors, and to attribute them to specific hardware components (if we are lucky). This is only the beginning of the feature set that is needed to be "advanced RAS".

Quoted 5 lines

What we should do is put all that post-system-reset error info, ECC errors mapping to DRAM devices, L3 cache index manipulation based on excessive errors - you name it - together and stick it in ras/ or drivers/ras or whatever. And all with a nice and easy to use userspace tool on top.

This is what we should be working towards. I don't think we have a clear picture of what that high level infrastructure looks like. It needs to be very flexible to take input from all sorts of platform specific "driver" code that collects data. The "perf events" mechanism looks plausible as a transport mechanism for reporting corrected (or otherwise non-fatal) events. But the errors that didn't kill the system are only part of the RAS picture.

Quoted 2 lines

Now it looks like a wart on arch/x86/ which truly doesn't belong there. And I don't buy all that crap that it can't be done right.

Of course it is a wart ... look up ACPI in any dictionary and you'll find a picture of a stereotypical Halloween witch :-) I don't see other architectures lining up to support ACPI ... but we shouldn't just ignore it in x86. The APEI pieces that were added to ACPI 4.0 have some interesting and useful features. Most of them are already implemented on shipping platforms because the APEI bits were simply documenting WHEA (Windows Hardware Error Architecture) features. Look for this stuff in dmesg:

ACPI: HEST 000000007fb1c000 000A8 (v01 INTEL SFC4UR 00000001 INTL 00000001)
ACPI: BERT 000000007fb1b000 00030 (v01 INTEL SFC4UR 00000001 INTL 00000001)
ACPI: ERST 000000007fb1a000 00230 (v01 INTEL SFC4UR 00000001 INTL 00000001)
ACPI: EINJ 000000007fb19000 00130 (v01 INTEL SFC4UR 00000001 INTL 00000001)

-Tony

maintainer
#30 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 11 lines · Tony Luck
Quoted 4 lines · Borislav Petkov

You may be right but what we actually want is a consistent RAS infrastructure. Didn't you point out at the last edac meeting in Boston that concerning RAS Linux were in the stone ages? (at least this is what I remember reading).

That meeting was in San Francisco - but your recollection is correct. Right now we have ways to count errors, and to attribute them to specific hardware components (if we are lucky). This is only the beginning of the feature set that is needed to be "advanced RAS".

Yep.

Quoted 6 lines
Quoted 5 lines

What we should do is put all that post-system-reset error info, ECC errors mapping to DRAM devices, L3 cache index manipulation based on excessive errors - you name it - together and stick it in ras/ or drivers/ras or whatever. And all with a nice and easy to use userspace tool on top.

Quoted 6 lines

This is what we should be working towards. I don't think we have a clear picture of what that high level infrastructure looks like. It needs to be very flexible to take input from all sorts of platform specific "driver" code that collects data. The "perf events" mechanism looks plausible as a transport mechanism for reporting corrected (or otherwise non-fatal) events.

Also agreed.

Quoted 2 lines

But the errors that didn't kill the system are only part of the RAS picture.

Concerning fatal errors, take a look at drivers/edac/mce_amd.(c|h)¹ - this is not in arch/x86/ and still decodes MCEs in the kernel. And it works fine - it even helped in several cases where people simply read their serial console/dmesg and didn't have to collect it first and run it through some tool to understand which functional unit in the CPU is mchecking.

And I have an error injection module which can inject MCEs using 2 /sysfs files only. It is software injection only for now but still, you can even inject in the shell.

So I think having RAS decoupled from x86 proper could work but it has to be done smart. In the example above, I've hooked into the machine check notifier chain. And yes, this is just an example but you get the idea and where we want to go.

Quoted 5 lines
Quoted 2 lines

Now it looks like a wart on arch/x86/ which truly doesn't belong there. And I don't buy all that crap that it can't be done right.

Of course it is a wart ... look up ACPI in any dictionary and you'll find a picture of a stereotypical Halloween witch :-)

LOL. Can I have the ACPI witch on a t-shirt please?

Quoted 3 lines

I don't see other architectures lining up to support ACPI ... but we shouldn't just ignore it in x86. The APEI pieces that were added to ACPI 4.0 have some interesting and useful features.

Yeah, I like the error info after system reset thing using nvram. This might make a lot of sense with certain critical errors where we syncflood the ht links to prevent corrupted data propagation.

Quoted 8 lines

Most of them are already implemented on shipping platforms because the APEI bits were simply documenting WHEA (Windows Hardware Error Architecture) features. Look for this stuff in dmesg:

ACPI: HEST 000000007fb1c000 000A8 (v01 INTEL SFC4UR 00000001 INTL 00000001)
ACPI: BERT 000000007fb1b000 00030 (v01 INTEL SFC4UR 00000001 INTL 00000001)
ACPI: ERST 000000007fb1a000 00230 (v01 INTEL SFC4UR 00000001 INTL 00000001)
ACPI: EINJ 000000007fb19000 00130 (v01 INTEL SFC4UR 00000001 INTL 00000001)

Yeah, I'm not saying we shouldn't have those - I'm just saying that we should think up a good infrastructure design first and hook them into it so that users can have the highest benefit.

And then have a single tool which talks to the high level interface and all different arches implement whatever makes sense for them. Basically what you said above about the flexible high level infrastructure.

Thanks.

¹in current git, in 2.6.36 the files were called edac_mce_amd(c|h).

Signature · 6 lines
Regards/Gruss,
    Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#31 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 6 lines · Borislav Petkov

Concerning fatal errors, take a look at drivers/edac/mce_amd.(c|h)¹ - this is not in arch/x86/ and still decodes MCEs in the kernel. And it works fine - it even helped in several cases where people simply read their serial console/dmesg and didn't have to collect it first and run it through some tool to understand which functional unit in the CPU is mchecking.

That looks neat ... but end-users seem to have some conflicting requirements here. Your uses seem to like it but the LLNL folks at the S.F. meeting said that solutions that involved looking at console logs from thousands of machines in a cluster were not acceptable.

I doubt very much if any end-user cares which unit *within* a cpu failed (their replaceable unit is the whole of the cpu). So much of your driver could be replaced with: printk("CPU%d is bad\n", cpu);

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#32 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Borislav Petkov
Quoted 6 lines · Borislav Petkov

Concerning fatal errors, take a look at drivers/edac/mce_amd.(c|h)¹ - this is not in arch/x86/ and still decodes MCEs in the kernel. And it works fine - it even helped in several cases where people simply read their serial console/dmesg and didn't have to collect it first and run it through some tool to understand which functional unit in the CPU is mchecking.

That looks neat ... but end-users seem to have some conflicting requirements here. Your uses seem to like it but the LLNL folks at the S.F. meeting said that solutions that involved looking at console logs from thousands of machines in a cluster were not acceptable.

I doubt very much if any end-user cares which unit *within* a cpu failed (their replaceable unit is the whole of the cpu). So much of your driver could be replaced with: printk("CPU%d is bad\n", cpu);

-Tony

reviewer
#34 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Ingo Molnar
Quoted 1 line

Everybody knows that Linux has a lot to learn about RAS.

I think to catch up, we need to play to Linux's strengths of continuous improvement. If we halt patches in this area then we could wait forever for the "perfect design".

If Linus Torvalds disagrees and wants to NAK this series, I can live with that. But it isn't my recommendation.

thanks,
-Len Brown, Intel Open Source Technology Center

#35 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

B1;2401;0cLen,

Quoted 7 lines · Len Brown
Quoted 1 line

Everybody knows that Linux has a lot to learn about RAS.

I think to catch up, we need to play to Linux's strengths of continuous improvement. If we halt patches in this area then we could wait forever for the "perfect design".

it's not about perfect design. It's about creating new user space ABIs. The patches introduce another error reporting user space ABI with an ad hoc "fits the needs" design.

This is my major point of objection.

I agree that Linux needs improvement on the RAS side, but does this lack of features justify a new user space ABI which is totally disconnected to existing RAS facilities ?

No, it does not. It's not our problem that Intel wasted time on creating another character device driver to report errors to user space. The time spent to do so would have been sufficient to do a proper integration into the existing infrastructure.

I would not care at all if these patches would just introduce some weird in kernel interfaces as we can clean that up at will. But introducing a new user space ABI is setting the disconnect of RAS related facilities into stone.

Quoted 1 line

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Thanks,

tglx

maintainer
#33 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Tony Luck
Quoted 8 lines · Tony Luck
Quoted 6 lines · Borislav Petkov

Concerning fatal errors, take a look at drivers/edac/mce_amd.(c|h)¹ - this is not in arch/x86/ and still decodes MCEs in the kernel. And it works fine - it even helped in several cases where people simply read their serial console/dmesg and didn't have to collect it first and run it through some tool to understand which functional unit in the CPU is mchecking.

Quoted 8 lines

That looks neat ... but end-users seem to have some conflicting requirements here. Your uses seem to like it but the LLNL folks at the S.F. meeting said that solutions that involved looking at console logs from thousands of machines in a cluster were not acceptable.

I doubt very much if any end-user cares which unit *within* a cpu failed (their replaceable unit is the whole of the cpu). So much of your driver could be replaced with: printk("CPU%d is bad\n", cpu);

Yeah, nobody said this is finished. The next step is using perf infrastructure to convey those decoded errors to userspace, say, to a ras daemon or similar which can do all sorts of reporting, statistics, policy decisions, injection, paint graphs, whatever...

I sent out two patchsets as an rfc already and am working on the 3rd one so we're getting there. Here's the last one:
http://kerneltrap.org/mailarchive/linux-kernel/2010/8/6/4603847

Also, I'm open to all suggestions on how to make it more usable and user-friendly.

Thanks.

Signature · 6 lines
Regards/Gruss,
    Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#36 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Thomas Gleixner
Quoted 11 lines · Thomas Gleixner
Quoted 1 line

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Btw., it's not just about EDAC - the firmware can store Linux events persistently (beyond allowing the firmware to insert its own RAS events), that is obviously _hugely_ useful for kernel debugging in general. We could inject debugging events there and recover them after a crash, etc.

As long as it's all integrated into the standard event logging facilities it could be very useful (and i dont generally complain about things that are insignificant).

As /dev/erst-dbg it's not useful at all - in fact it might close the door to sane future usage of this hw facility if some crappy user-space learns to rely on the /dev/erst-dbg ABI.

Thanks,

Ingo

author
#37 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 10 lines · Ingo Molnar
Quoted 8 lines · Thomas Gleixner
Quoted 1 line

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

Quoted 8 lines
Quoted 3 lines

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Btw., it's not just about EDAC - the firmware can store Linux events persistently (beyond allowing the firmware to insert its own RAS events), that is obviously _hugely_ useful for kernel debugging in general. We could inject debugging events there and recover them after a crash, etc.

Yes. It can be used by other kernel subsystems other than RAS. A kernel API is provided already. The design of the kernel API makes it easy to be used by various kernel subsystems. As the first step, we plan to support saving kernel log before panic and reading it back after reboot.

Best Regards,
Huang Ying

#38 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 20 lines · Huang Ying
Quoted 10 lines · Ingo Molnar
Quoted 8 lines · Thomas Gleixner
Quoted 1 line

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

Quoted 8 lines
Quoted 3 lines

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Btw., it's not just about EDAC - the firmware can store Linux events persistently (beyond allowing the firmware to insert its own RAS events), that is obviously _hugely_ useful for kernel debugging in general. We could inject debugging events there and recover them after a crash, etc.

Quoted 4 lines

Yes. It can be used by other kernel subsystems other than RAS. A kernel API is provided already. The design of the kernel API makes it easy to be used by various kernel subsystems. As the first step, we plan to support saving kernel log before panic and reading it back after reboot.

And that's the problem: we have good facilities already that deal with similar things. We have NMI-safe event logging, event enumeration, dump-on-panic code and all sorts of goodies there.

But what did Andi's guidance/design lead you to do instead?

You stuck a useful hw feature into a vendor specific area of the kernel and exported it to /dev/erst-dbg via a crappy ABI. You also did it in the worst possible imaginable way: you avoided talking to the people who maintain and know the RAS/EDAC/debugging/instrumentation code, and you tried to create an ABI to export it in the most raw form possible - limiting our future options.

All that done so that dealing with those pesky RAS/EDAC, instrumentation and core kernel people can be avoided? ;-)

Sucks IMHO.

Thanks,

Ingo

author
#39 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

Quoted 22 lines · Ingo Molnar
Quoted 20 lines · Huang Ying
Quoted 18 lines · Ingo Molnar
Quoted 11 lines · Thomas Gleixner
Quoted 1 line

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Btw., it's not just about EDAC - the firmware can store Linux events persistently (beyond allowing the firmware to insert its own RAS events), that is obviously _hugely_ useful for kernel debugging in general. We could inject debugging events there and recover them after a crash, etc.

Quoted 8 lines
Quoted 4 lines

Yes. It can be used by other kernel subsystems other than RAS. A kernel API is provided already. The design of the kernel API makes it easy to be used by various kernel subsystems. As the first step, we plan to support saving kernel log before panic and reading it back after reboot.

And that's the problem: we have good facilities already that deal with similar things. We have NMI-safe event logging, event enumeration, dump-on-panic code and all sorts of goodies there.

We have provided an in-kernel API for ERST now. And we plan to implement a kmsg_dumper with ERST. And maybe implement some output support (maybe via some /dev/kmsg extension) for kmsg_dumper if necessary.

Best Regards,
Huang Ying

#41 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Thomas Gleixner
Quoted 4 lines

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Well it didn't fit the needs at all. Is that not enough, Mr Inquisitor?

Really if you want to nack and maintain and design things you need to do a bit more than just arguing from two lines of high level description.

EDAC enumerates hardware and exports some hardware registers and decodes a few errors in a format into the kernel log that is hard to impossible to post-process.

APEI does nothing of that, so it doesn't fit into EDAC.

perf does small parts of it, but a lot of things that are needed it doesn't do either. And for the things it does it's incredible overkill in terms of code size, overhead etc. for the task at hand.

Basically the only facility in perf that could be reused is a simple message passing layer, which is only a few tens lines of code anyways, but only at the cost of doing a lot of changes to get the right semantics out of it.

The main interface in APEI right now is to manage fatal errors after reboot. Short of making it a file system, which didn't really fit either, there's no existing interface that handles that in a half way sensible way.

There's some other stuff but it's reasonably small too.

-Andi

author
#43 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Thomas Gleixner

Hi, Thomas,

Quoted 40 lines · Thomas Gleixner

B1;2401;0cLen,

Quoted 7 lines · Len Brown
Quoted 1 line

Everybody knows that Linux has a lot to learn about RAS.

I think to catch up, we need to play to Linux's strengths of continuous improvement. If we halt patches in this area then we could wait forever for the "perfect design".

it's not about perfect design. It's about creating new user space ABIs. The patches introduce another error reporting user space ABI with an ad hoc "fits the needs" design.

This is my major point of objection.

I agree that Linux needs improvement on the RAS side, but does this lack of features justify a new user space ABI which is totally disconnected to existing RAS facilities ?

No, it does not. It's not our problem that Intel wasted time on creating another character device driver to report errors to user space. The time spent to do so would have been sufficient to do a proper integration into the existing infrastructure.

I would not care at all if these patches would just introduce some weird in kernel interfaces as we can clean that up at will. But introducing a new user space ABI is setting the disconnect of RAS related facilities into stone.

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

Quoted 4 lines

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

As far as I know, EDAC guys plan to use some other "perfect interface" in the future. So I think the current state is really waiting for the "perfect design".

Best Regards,
Huang Ying

#42 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Andi Kleen
Quoted 6 lines · Andi Kleen
Quoted 4 lines

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Well it didn't fit the needs at all. Is that not enough, Mr Inquisitor?

No, it's not enough without a reasonable explanation.

Quoted 3 lines

Really if you want to nack and maintain and design things you need to do a bit more than just arguing from two lines of high level description.

If you want to shove a new facility into the kernel you need to do a bit more than sending that stuff to LKML without explaining why you can't use existing facilities and why it's impossible to extend those existing facilities.

So the questions arise on the high level because you failed to provide a reasonable explanation in the first place.

Quoted 3 lines

EDAC enumerates hardware and exports some hardware registers and decodes a few errors in a format into the kernel log that is hard to impossible to post-process.

You are well aware that EDAC folks are working on consolidating the interfaces and providing better error reporting, but it's out of your interest so you just ignore that effort instead of working together?

Quoted 1 line

APEI does nothing of that, so it doesn't fit into EDAC.

Thanks for this overly detailed explanation.

APEI is about error detection and error reporting, nothing else. So it fits into EDAC, which is an existing Error Detection and Correction reporting facility by definition.

If you see EDAC has shortcomings, the proper answer to that is to go there and work with those folks to make EDAC a fully integrated facility. It's not like there's some disagreement with them.

But you did not even try to talk to them about this and went straight ahead and implemented your own EDAC facility.

Quoted 2 lines

The main interface in APEI right now is to manage fatal errors after reboot. ...

That's completely irrelevant.

It does not matter at all when and wherefrom error data come and whether they were generated before or after reboot. That is the hardware/firmware dependend side of things. Nobody is saying that this isn't necessary.

But it matters very much how we report those errors. And it's not a completely unreasonable request to avoid separate interfaces for the very same problem, especially separate user space ABIs.

If an existing facility has shortcomings, then the usual way is to extend it for the sake of all existing users of that facility. We try to consolidate stuff all over the place and avoid stuff which is artificially separate, and that applies to that area as well.

Of course that might be more work and might change the design a bit, but in the end it's a benefit for everyone.

Thanks,

tglx

#40 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Huang Ying
Quoted 28 lines · Huang Ying
Quoted 27 lines · Ingo Molnar
Quoted 24 lines · Huang Ying
Quoted 10 lines · Ingo Molnar
Quoted 8 lines · Thomas Gleixner
Quoted 1 line

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

Quoted 8 lines
Quoted 3 lines

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

Btw., it's not just about EDAC - the firmware can store Linux events persistently (beyond allowing the firmware to insert its own RAS events), that is obviously _hugely_ useful for kernel debugging in general. We could inject debugging events there and recover them after a crash, etc.

Yes. It can be used by other kernel subsystems other than RAS. A kernel API is provided already. The design of the kernel API makes it easy to be used by various kernel subsystems. As the first step, we plan to support saving kernel log before panic and reading it back after reboot.

Quoted 7 lines
Quoted 3 lines

And that's the problem: we have good facilities already that deal with similar things. We have NMI-safe event logging, event enumeration, dump-on-panic code and all sorts of goodies there.

We have provided an in-kernel API for ERST now. And we plan to implement a kmsg_dumper with ERST. And maybe implement some output support (maybe via some /dev/kmsg extension) for kmsg_dumper if necessary.

So my argument/objection was:

" You are introducing a bad ABI here, amongst other problems. Please work with the
people who are maintaining sane RAS/event/error reporting ABIs and facilities. You should have done that to begin with. "

and your answer to that is:

" Hey, we plan to introduce another ad-hoc ABI as well! "

... do you really not see the glaring disconnect?

Ingo

#44 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Huang Ying
Quoted 43 lines · Huang Ying

Hi, Thomas,

Quoted 40 lines · Thomas Gleixner

B1;2401;0cLen,

Quoted 7 lines · Len Brown
Quoted 1 line

Everybody knows that Linux has a lot to learn about RAS.

I think to catch up, we need to play to Linux's strengths of continuous improvement. If we halt patches in this area then we could wait forever for the "perfect design".

it's not about perfect design. It's about creating new user space ABIs. The patches introduce another error reporting user space ABI with an ad hoc "fits the needs" design.

This is my major point of objection.

I agree that Linux needs improvement on the RAS side, but does this lack of features justify a new user space ABI which is totally disconnected to existing RAS facilities ?

No, it does not. It's not our problem that Intel wasted time on creating another character device driver to report errors to user space. The time spent to do so would have been sufficient to do a proper integration into the existing infrastructure.

I would not care at all if these patches would just introduce some weird in kernel interfaces as we can clean that up at will. But introducing a new user space ABI is setting the disconnect of RAS related facilities into stone.

From Kconfig:

EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset or other subsystems:
memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'.

Quoted 7 lines
Quoted 4 lines

So please explain why your error reporting is so different from the above that it justifies a separate facility. And you better come up with a real good explanation other than we looked at EDAC and it did not fit our needs.

As far as I know, EDAC guys plan to use some other "perfect interface" in the future. So I think the current state is really waiting for the "perfect design".

Not sure what you mean by this, but Boris has posted links to his latest patch-set in this thread, see:

http://kerneltrap.org/mailarchive/linux-kernel/2010/8/6/4603847

The Git coordinates are:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git, branch tip/perf/parse-events

The 'persistent events' facility he has prototyped there appears to be a good potential match for the ERST store.

It would be very useful to have another feature there: to mark persistent events as 'dump into syslog on bootup', so that for example the contents of the ERST log could be dumped right on bootup. [but ERST would not be the only persistent event that could be marked like that.]

Note that we dont need/want other ABI accesses to the ERST log (i.e. we dont want /dev/erst-dbg), because we want the benefits of the generalization: tooling (RAS and other tooling) should learn how to deal with persistent events - not learn how to deal with ERST logs ... or with warm bootup RAM-embedded logs ... or to deal with kcrash embedded kernel logs ... etc.

There are many obvious advantages from implementing it like that: there's no need to special-code ERST to printk or ERST to whatever other facility cross links - it would be part of a generic/uniform event logging facility to begin with. ERST would only implement its own, narrow, hardware-specific event accessor methods - nothing else. Basically a small 'event driver'. This would be the most optimal, smallest, easiest to maintain approach - with no facility duplication and no fragmentation.

It's certainly more work as well _for the first such example_ - but from that point on any new hardware facility can be added with ease, and those too will fit into existing tooling in a very natural way.

So please help out with the persistent events work. If you need any pointers we'd be glad to help.

Thanks,

Ingo

#24 lore raw

Re: [NAK] Re: [PATCH -v2 9/9] ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support

In reply to Ingo Molnar

Btw., just for the record. Two days ago you started getting personal:

Quoted 1 line · Andi Kleen

That's not really the old Ingo I used to know.

But when i (again) outlayed all the technical reasons for the NAK, you did not answer. You also did not answer Thomas's technical mail either.

I've seen this behavior many times from you: when the technical argument goes against you, when many people are telling you that you are mostly wrong, you do not concede, you do not argue in support of your position, you simply ignore the discussion from that point on and you pretend that the discussion does not exist anymore.

Then a few weeks/months down the line this same pattern repeats: there's another similar incident somewhere else, and i'm (or others) are forced to NAK the hard way. You then claim it's unreasonable and you act as if the prior discussions did not happen at all. Rinse and repeat. Most people dont remember so it even looks plausible to the casual observer.

The thing is, upstream NAKs need to be addressed in good faith.

Again: i'm NAK-ing the use of the x86 NMI notifier chain in this fashion and i'm NAK-ing the exports that this patch is adding to arch/x86/. It's not the proper approach for the many reasons we outlined - debug facilities want to be organized in the core, not spread out to vendor-specific fringes.

I wouldnt mind as much if this was a driver for hw few people care about - but this looks like a useful piece of Intel hardware whose Linux support you are messing up thoroughly by exporting an ABI in the worst possible way. We can and should do better than this.

Thanks,

Ingo