mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Alex Kluver" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Alex Kluver <alex.kluver@hpe.com>,
	Russ Anderson <russ.anderson@hpe.com>,
	Kyle Meyer <kyle.meyer@hpe.com>, Steve Wahl <steve.wahl@hpe.com>,
	Borislav Petkov <bp@suse.de>, Ard Biesheuvel <ardb@kernel.org>,
	x86 <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [tip: efi/core] cper,edac,efi: Memory Error Record: bank group/address and chip id
Date: Wed, 30 Sep 2020 05:22:22 -0000	[thread overview]
Message-ID: <160144334264.7002.3839568523655548553.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200819143544.155096-3-alex.kluver@hpe.com>

The following commit has been merged into the efi/core branch of tip:

Commit-ID:     612b5d506d066cdf0a739963e7cd28642d500ec1
Gitweb:        https://git.kernel.org/tip/612b5d506d066cdf0a739963e7cd28642d500ec1
Author:        Alex Kluver <alex.kluver@hpe.com>
AuthorDate:    Wed, 19 Aug 2020 09:35:44 -05:00
Committer:     Ard Biesheuvel <ardb@kernel.org>
CommitterDate: Thu, 17 Sep 2020 10:19:52 +03:00

cper,edac,efi: Memory Error Record: bank group/address and chip id

Updates to the UEFI 2.8 Memory Error Record allow splitting the bank field
into bank address and bank group, and using the last 3 bits of the extended
field as a chip identifier.

When needed, print correct version of bank field, bank group, and chip
identification.

Based on UEFI 2.8 Table 299. Memory Error Record.

Signed-off-by: Alex Kluver <alex.kluver@hpe.com>
Reviewed-by: Russ Anderson <russ.anderson@hpe.com>
Reviewed-by: Kyle Meyer <kyle.meyer@hpe.com>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Acked-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20200819143544.155096-3-alex.kluver@hpe.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/edac/ghes_edac.c    |  9 +++++++++
 drivers/firmware/efi/cper.c |  9 +++++++++
 include/linux/cper.h        |  8 ++++++++
 3 files changed, 26 insertions(+)

diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
index 741e760..8a44f32 100644
--- a/drivers/edac/ghes_edac.c
+++ b/drivers/edac/ghes_edac.c
@@ -372,6 +372,12 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)
 		p += sprintf(p, "rank:%d ", mem_err->rank);
 	if (mem_err->validation_bits & CPER_MEM_VALID_BANK)
 		p += sprintf(p, "bank:%d ", mem_err->bank);
+	if (mem_err->validation_bits & CPER_MEM_VALID_BANK_GROUP)
+		p += sprintf(p, "bank_group:%d ",
+			     mem_err->bank >> CPER_MEM_BANK_GROUP_SHIFT);
+	if (mem_err->validation_bits & CPER_MEM_VALID_BANK_ADDRESS)
+		p += sprintf(p, "bank_address:%d ",
+			     mem_err->bank & CPER_MEM_BANK_ADDRESS_MASK);
 	if (mem_err->validation_bits & (CPER_MEM_VALID_ROW | CPER_MEM_VALID_ROW_EXT)) {
 		u32 row = mem_err->row;
 
@@ -399,6 +405,9 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)
 			strcpy(e->label, dimm->label);
 		}
 	}
+	if (mem_err->validation_bits & CPER_MEM_VALID_CHIP_ID)
+		p += sprintf(p, "chipID: %d ",
+			     mem_err->extended >> CPER_MEM_CHIP_ID_SHIFT);
 	if (p > e->location)
 		*(p - 1) = '\0';
 
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index a60acd1..e15d484 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -232,6 +232,12 @@ static int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg)
 		n += scnprintf(msg + n, len - n, "rank: %d ", mem->rank);
 	if (mem->validation_bits & CPER_MEM_VALID_BANK)
 		n += scnprintf(msg + n, len - n, "bank: %d ", mem->bank);
+	if (mem->validation_bits & CPER_MEM_VALID_BANK_GROUP)
+		n += scnprintf(msg + n, len - n, "bank_group: %d ",
+			       mem->bank >> CPER_MEM_BANK_GROUP_SHIFT);
+	if (mem->validation_bits & CPER_MEM_VALID_BANK_ADDRESS)
+		n += scnprintf(msg + n, len - n, "bank_address: %d ",
+			       mem->bank & CPER_MEM_BANK_ADDRESS_MASK);
 	if (mem->validation_bits & CPER_MEM_VALID_DEVICE)
 		n += scnprintf(msg + n, len - n, "device: %d ", mem->device);
 	if (mem->validation_bits & (CPER_MEM_VALID_ROW | CPER_MEM_VALID_ROW_EXT)) {
@@ -254,6 +260,9 @@ static int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg)
 	if (mem->validation_bits & CPER_MEM_VALID_TARGET_ID)
 		scnprintf(msg + n, len - n, "target_id: 0x%016llx ",
 			  mem->target_id);
+	if (mem->validation_bits & CPER_MEM_VALID_CHIP_ID)
+		scnprintf(msg + n, len - n, "chip_id: %d ",
+			  mem->extended >> CPER_MEM_CHIP_ID_SHIFT);
 
 	msg[n] = '\0';
 	return n;
diff --git a/include/linux/cper.h b/include/linux/cper.h
index bd2d8a7..6a511a1 100644
--- a/include/linux/cper.h
+++ b/include/linux/cper.h
@@ -231,10 +231,18 @@ enum {
 #define CPER_MEM_VALID_CARD_HANDLE		0x10000
 #define CPER_MEM_VALID_MODULE_HANDLE		0x20000
 #define CPER_MEM_VALID_ROW_EXT			0x40000
+#define CPER_MEM_VALID_BANK_GROUP		0x80000
+#define CPER_MEM_VALID_BANK_ADDRESS		0x100000
+#define CPER_MEM_VALID_CHIP_ID			0x200000
 
 #define CPER_MEM_EXT_ROW_MASK			0x3
 #define CPER_MEM_EXT_ROW_SHIFT			16
 
+#define CPER_MEM_BANK_ADDRESS_MASK		0xff
+#define CPER_MEM_BANK_GROUP_SHIFT		8
+
+#define CPER_MEM_CHIP_ID_SHIFT			5
+
 #define CPER_PCIE_VALID_PORT_TYPE		0x0001
 #define CPER_PCIE_VALID_VERSION			0x0002
 #define CPER_PCIE_VALID_COMMAND_STATUS		0x0004

  parent reply	other threads:[~2020-09-30  5:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 14:35 [PATCH v2 0/2] UEFI v2.8 Memory Error Record Updates Alex Kluver
2020-08-19 14:35 ` [PATCH v2 1/2] edac,ghes,cper: Add Row Extension to Memory Error Record Alex Kluver
2020-09-15 16:33   ` Borislav Petkov
2020-09-15 17:07     ` Ard Biesheuvel
2020-09-15 17:12       ` Ard Biesheuvel
2020-09-15 17:19         ` Borislav Petkov
2020-09-16 13:09           ` Ard Biesheuvel
2020-09-16 18:10             ` Borislav Petkov
2020-09-16 18:12               ` Russ Anderson
2020-09-18  8:30   ` [tip: efi/core] " tip-bot2 for Alex Kluver
2020-09-30  5:22   ` tip-bot2 for Alex Kluver
2020-08-19 14:35 ` [PATCH v2 2/2] cper,edac,efi: Memory Error Record: bank group/address and chip id Alex Kluver
2020-09-15 16:36   ` Borislav Petkov
2020-09-18  8:30   ` [tip: efi/core] " tip-bot2 for Alex Kluver
2020-09-30  5:22   ` tip-bot2 for Alex Kluver [this message]
2020-09-14 16:44 ` [PATCH v2 0/2] UEFI v2.8 Memory Error Record Updates Russ Anderson
2020-09-15 15:07 ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160144334264.7002.3839568523655548553.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=alex.kluver@hpe.com \
    --cc=ardb@kernel.org \
    --cc=bp@suse.de \
    --cc=kyle.meyer@hpe.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=russ.anderson@hpe.com \
    --cc=steve.wahl@hpe.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®