Re: [PATCH v2 RESEND 4/4] selftests: firmware: Add NVIDIA GHES EINJ selftest

From: Shuai Xue

Date: Sun Jul 26 2026 - 05:02:41 EST




On 7/24/26 8:20 PM, Kai-Heng Feng wrote:
Exercise the full driver path on real Grace and Vera hardware using
ACPI EINJ to inject CPER sections and validate the kernel log output.
KUnit covers the parser in isolation; this test covers the path from
firmware notification through GUID dispatch to decoded output.

Signed-off-by: Kai-Heng Feng <kaihengf@xxxxxxxxxx>
---
v2:
- No change.

tools/testing/selftests/firmware/Makefile | 4 +-
tools/testing/selftests/firmware/config | 5 +
tools/testing/selftests/firmware/einj_lib.sh | 189 ++++++++++++++++++
.../selftests/firmware/ghes_nvidia_einj.sh | 144 +++++++++++++
.../firmware/ghes_nvidia_einj_profiles.sh | 46 +++++
5 files changed, 386 insertions(+), 2 deletions(-)
create mode 100644 tools/testing/selftests/firmware/einj_lib.sh
create mode 100755 tools/testing/selftests/firmware/ghes_nvidia_einj.sh
create mode 100755 tools/testing/selftests/firmware/ghes_nvidia_einj_profiles.sh

diff --git a/tools/testing/selftests/firmware/Makefile b/tools/testing/selftests/firmware/Makefile
index 7992969deaa2..b753dd123860 100644
--- a/tools/testing/selftests/firmware/Makefile
+++ b/tools/testing/selftests/firmware/Makefile
@@ -3,8 +3,8 @@
CFLAGS = -Wall \
-O2
-TEST_PROGS := fw_run_tests.sh
-TEST_FILES := fw_fallback.sh fw_filesystem.sh fw_upload.sh fw_lib.sh
+TEST_PROGS := fw_run_tests.sh ghes_nvidia_einj.sh
+TEST_FILES := fw_fallback.sh fw_filesystem.sh fw_upload.sh fw_lib.sh einj_lib.sh ghes_nvidia_einj_profiles.sh
TEST_GEN_FILES := fw_namespace

I am not sure this belongs in the generic firmware selftests.

This test requires root, debugfs, ACPI EINJ, NVIDIA-specific vendor EINJ
metadata, a bound NVDA2012 device, and it writes EINJ controls before
triggering error_inject. Even if the selected profiles are intended to be
informational, this looks more like a platform RAS validation tool than a
generic kselftest that should run as part of the firmware selftest suite.

Would ras-tools be a better place for this? Tony Luck maintains that tree
for RAS-related test and injection tooling, and this script seems to fit
there better than tools/testing/selftests/firmware/.

Please see:

https://git.kernel.org/pub/scm/linux/kernel/git/aegl/ras-tools.git

Thanks,
Shuai