Linux ACPI
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kaihengf@nvidia.com>
To: rafael@kernel.org, linux-acpi@vger.kernel.org
Cc: tony.luck@intel.com, bp@alien8.de, guohanjun@huawei.com,
	mchehab@kernel.org, xueshuai@linux.alibaba.com, lenb@kernel.org,
	kees@kernel.org, gustavoars@kernel.org,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kai-Heng Feng <kaihengf@nvidia.com>
Subject: [PATCH v3 0/3] ACPI: APEI: GHES: Add NVIDIA Vera CPER decoding
Date: Tue,  4 Aug 2026 20:23:14 +0800	[thread overview]
Message-ID: <20260804122318.88193-1-kaihengf@nvidia.com> (raw)
In-Reply-To: <20260724122054.36162-1-kaihengf@nvidia.com>

The NVIDIA GHES driver currently decodes the vendor CPER section used by
Grace systems. Vera uses a different section GUID and event layout.

Refactor the Grace path into testable decode and print helpers, add the Vera
event decoder, and cover both formats with KUnit. The Vera parser follows
the extensible CPU information and event-context wire contracts: it accepts
new minor versions and extended information headers, validates every one of
the wire format's 0 to 255 contexts without allocation, and retains a valid
prefix when a later context is malformed.

Printing walks the validated raw context span a second time. It limits
verbose output to 16 contexts and 32 key/value entries per section while
still validating the complete record. Existing one-context output remains
unchanged.

The companion ras-tools series adds a fail-closed NVIDIA EINJ validator for
the non-fatal Grace CMET-INFO and Vera CMET-NULL samples.

Changes since v2:
 - Move EINJ tooling out of the kernel series and into ras-tools.
 - Follow the Vera CtxSize padding and alignment contract while retaining
   the legacy opaque-context encoding.
 - Accept compatible CPU information extensions and validate the complete
   8-bit context count with an allocation-free cursor.
 - Bound verbose context and entry output independently, while reporting
   omitted contexts and entries.
 - Add wire-layout assertions, partial-context handling, severity-aware
   diagnostics, and 52 Grace/Vera KUnit cases.

Verification:
 - x86_64 KUnit: 52/52 passed.
 - ARM64 KASAN+UBSAN KUnit under QEMU/HVF: 52/52 passed.
 - ARM64 GCC and Clang, built-in and module configurations, W=1: passed.
 - ARM64 GCC full Image link: passed.
 - ARM64 sparse C=2 with __CHECK_ENDIAN__: passed (one unrelated existing
   arm64 vDSO declaration warning).
 - Strict source checkpatch and git diff --check: passed.
 - The raw live sections were decoded independently by libcper at commit
   b83878a4aca9: Vera as an 80-byte CPU CMET-NULL event with one empty
   type-1 context, and Grace as a 544-byte CMET-INFO section with 32
   registers.
 - Vera live EINJ: a real 80-byte CMET-NULL CPER from GHES source 8193,
   event type/subtype 0, one 16-byte context, and zero entries (not the
   firmware-rejection record seen with the old selector).
 - Grace live EINJ: a real 544-byte CMET-INFO CPER from GHES source 896,
   severity 3, with all 32 register addresses decoded in order.
 - Both live runs reached the runner's PASS gate with empty tool stderr,
   captured the raw tracepoint record, and restored every EINJ control
   byte-for-byte.

Kai-Heng Feng (3):
  ACPI: APEI: GHES: Refactor Grace decoder helpers
  ACPI: APEI: GHES: Add NVIDIA Vera decoder
  ACPI: APEI: GHES: Add Grace and Vera KUnit coverage

 MAINTAINERS                                   |    2 +-
 drivers/acpi/apei/Kconfig                     |   24 +-
 drivers/acpi/apei/Makefile                    |    1 +
 drivers/acpi/apei/ghes-nvidia-test-fixtures.h |  233 +++
 drivers/acpi/apei/ghes-nvidia-test.c          | 1274 +++++++++++++++++
 drivers/acpi/apei/ghes-nvidia.c               |  767 +++++++++-
 drivers/acpi/apei/ghes-nvidia.h               |  109 ++
 7 files changed, 2364 insertions(+), 46 deletions(-)
 create mode 100644 drivers/acpi/apei/ghes-nvidia-test-fixtures.h
 create mode 100644 drivers/acpi/apei/ghes-nvidia-test.c
 create mode 100644 drivers/acpi/apei/ghes-nvidia.h


base-commit: 848acc8ffe1b7cd5f1bf427b93069becfebc2c9d
-- 
2.50.1 (Apple Git-155)

  parent reply	other threads:[~2026-08-04 12:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 12:20 [PATCH v2 RESEND 0/4] ACPI: APEI: GHES: Add NVIDIA Vera CPER decoder and tests Kai-Heng Feng
2026-07-24 12:20 ` [PATCH v2 RESEND 1/4] ACPI: APEI: GHES: Refactor Grace decoder helpers Kai-Heng Feng
2026-07-26  8:10   ` Shuai Xue
2026-07-24 12:20 ` [PATCH v2 RESEND 2/4] ACPI: APEI: GHES: Add NVIDIA Vera decoder Kai-Heng Feng
2026-07-26  8:21   ` Shuai Xue
2026-07-24 12:20 ` [PATCH v2 RESEND 3/4] ACPI: APEI: GHES: Add Grace and Vera KUnit coverage Kai-Heng Feng
2026-07-26  8:30   ` Shuai Xue
2026-07-24 12:20 ` [PATCH v2 RESEND 4/4] selftests: firmware: Add NVIDIA GHES EINJ selftest Kai-Heng Feng
2026-07-26  9:02   ` Shuai Xue
2026-08-04 12:23 ` Kai-Heng Feng [this message]
2026-08-04 12:23   ` [PATCH v3 1/3] ACPI: APEI: GHES: Refactor Grace decoder helpers Kai-Heng Feng
2026-08-04 12:23   ` [PATCH v3 2/3] ACPI: APEI: GHES: Add NVIDIA Vera decoder Kai-Heng Feng
2026-08-04 12:23   ` [PATCH v3 3/3] ACPI: APEI: GHES: Add Grace and Vera KUnit coverage Kai-Heng Feng

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=20260804122318.88193-1-kaihengf@nvidia.com \
    --to=kaihengf@nvidia.com \
    --cc=bp@alien8.de \
    --cc=guohanjun@huawei.com \
    --cc=gustavoars@kernel.org \
    --cc=kees@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rafael@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=xueshuai@linux.alibaba.com \
    /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