From: Himanshu Chauhan <hchauhan@ventanamicro.com>
To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org,
acpica-devel@lists.linux.dev
Cc: apatel@ventanamicro.com, cleger@rivosinc.com,
tony.luck@intel.com, Himanshu Chauhan <hchauhan@ventanamicro.com>,
robert.moore@intel.com, conor@kernel.org, james.morse@arm.com,
paul.walmsley@sifive.com, palmer@dabbelt.com, ardb@kernel.org,
lenb@kernel.org
Subject: [RFC PATCH v2 00/10] Add RAS support for RISC-V architecture
Date: Wed, 29 Oct 2025 16:56:38 +0530 [thread overview]
Message-ID: <20251029112649.3811657-1-hchauhan@ventanamicro.com> (raw)
RAS stands for Reliability, Availability and Serviceability.
This series implements the RAS support for RISC-V architecture using
RISC-V RERI specification. It is conformant to ACPI platform error
interfaces (APEI). It uses the highest priority Supervisor Software
Events (SSE)[2] to deliver the hardware error events to the kernel.
The SSE implementation has already been merged in OpenSBI. Clement
has sent a patch series for its implemenation in Linux kernel.[5]
The GHES driver framework is used as is with the following changes for RISC-V:
1. Register each ghes entry with SSE layer. Ghes notification vector is SSE event.
2. Add RISC-V specific entries for processor type and ISA string
3. Add fixmap indices GHES SSE Low and High Priority to help map and read from
physical addresses present in GHES entry.
4. Other changes to build/configure the RAS support
How to Use:
----------
This RAS stack consists of Qemu[3], OpenSBI, EDK2[4], Linux kernel and devmem utility to inject and trigger
errors. Qemu [Ref.] has support to emulate RISC-V RERI. The RAS agent is implemented in OpenSBI which
creates CPER records. EDK2 generates HEST table and populates it with GHES entries with the help of
OpenSBI.
Qemu Command:
------------
<qemu-dir>/build/qemu-system-riscv64 \
-s -accel tcg -m 4096 -smp 2 \
-cpu rv64,smepmp=false \
-serial mon:stdio \
-d guest_errors -D ./qemu.log \
-bios <opensbi-dir>/build/platform/generic/firmware/fw_dynamic.bin \
-monitor telnet:127.0.0.1:55555,server,nowait \
-device virtio-gpu-pci -full-screen \
-device qemu-xhci \
-device usb-kbd \
-blockdev node-name=pflash0,driver=file,read-only=on,filename=<edk2-build-dir>/RiscVVirtQemu/RELEASE_GCC5/FV/RISCV_VIRT_CODE.fd \
-blockdev node-name=pflash1,driver=file,filename=<edk2-build-dir>/RiscVVirtQemu/RELEASE_GCC5/FV/RISCV_VIRT_VARS.fd \
-M virt,pflash0=pflash0,pflash1=pflash1,rpmi=true,reri=true,aia=aplic-imsic \
-kernel <kernel image> \
-initrd <rootfs image> \
-append "root=/dev/ram rw console=ttyS0 earlycon=uart8250,mmio,0x10000000"
Error Injection & Triggering:
----------------------------
devmem 0x4010040 32 0x2a1
devmem 0x4010048 32 0x9001404
devmem 0x4010044 8 1
The above commands injects a TLB error on CPU 0.
Sample Output (CPU 0):
---------------------
[ 34.370282] {1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1
[ 34.371375] {1}[Hardware Error]: event severity: recoverable
[ 34.372149] {1}[Hardware Error]: Error 0, type: recoverable
[ 34.372756] {1}[Hardware Error]: section_type: general processor error
[ 34.373357] {1}[Hardware Error]: processor_type: 3, RISCV
[ 34.373806] {1}[Hardware Error]: processor_isa: 6, RISCV64
[ 34.374294] {1}[Hardware Error]: error_type: 0x02
[ 34.374845] {1}[Hardware Error]: TLB error
[ 34.375448] {1}[Hardware Error]: operation: 1, data read
[ 34.376100] {1}[Hardware Error]: target_address: 0x0000000000000000
References:
----------
[1] RERI Specification: https://github.com/riscv-non-isa/riscv-ras-eri/releases/download/v1.0/riscv-reri.pdf
[2] SSE Section in OpenSBI v3.0: https://github.com/riscv-non-isa/riscv-sbi-doc/releases/download/v3.0/riscv-sbi.pdf
[3] Qemu source (with RERI emulation support): https://github.com/ventanamicro/qemu.git (branch: dev-upstream)
[4] EDK2: https://github.com/ventanamicro/edk2.git (branch: dev-upstream)
[5] SSE Kernel Patches (v7): https://lore.kernel.org/all/20250908181717.1997461-1-cleger@rivosinc.com/
Changes in v2:
- Made changes to be conformant with SSE v7 patches
- Fixed some bot warnings
Himanshu Chauhan (10):
riscv: Define ioremap_cache for RISC-V
riscv: Define arch_apei_get_mem_attribute for RISC-V
acpi: Introduce SSE in HEST notification types
riscv: Add fixmap indices for GHES IRQ and SSE contexts
riscv: conditionally compile GHES NMI spool function
riscv: Add functions to register ghes having SSE notification
riscv: Add RISC-V entries in processor type and ISA strings
riscv: Introduce HEST SSE notification handlers
riscv: Select HAVE_ACPI_APEI required for RAS
riscv: Enable APEI GHES driver in defconfig
arch/riscv/Kconfig | 1 +
arch/riscv/configs/defconfig | 3 +
arch/riscv/include/asm/acpi.h | 20 ++++
arch/riscv/include/asm/fixmap.h | 8 ++
arch/riscv/include/asm/io.h | 3 +
drivers/acpi/apei/Kconfig | 5 +
drivers/acpi/apei/ghes.c | 103 +++++++++++++++--
drivers/firmware/efi/cper.c | 3 +
drivers/firmware/riscv/riscv_sbi_sse.c | 147 +++++++++++++++++++++++++
include/acpi/actbl1.h | 3 +-
include/linux/riscv_sbi_sse.h | 16 +++
11 files changed, 300 insertions(+), 12 deletions(-)
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2025-10-29 11:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 11:26 Himanshu Chauhan [this message]
2025-10-29 11:26 ` [RFC PATCH v2 01/10] riscv: Define ioremap_cache for RISC-V Himanshu Chauhan
2025-10-29 11:26 ` [RFC PATCH v2 02/10] riscv: Define arch_apei_get_mem_attribute " Himanshu Chauhan
2025-10-29 11:26 ` [RFC PATCH v2 03/10] acpi: Introduce SSE in HEST notification types Himanshu Chauhan
2025-11-05 8:33 ` Clément Léger
2025-10-29 11:26 ` [RFC PATCH v2 04/10] riscv: Add fixmap indices for GHES IRQ and SSE contexts Himanshu Chauhan
2025-11-05 8:41 ` Clément Léger
2025-10-29 11:26 ` [RFC PATCH v2 05/10] riscv: conditionally compile GHES NMI spool function Himanshu Chauhan
2025-10-29 11:26 ` [RFC PATCH v2 06/10] riscv: Add functions to register ghes having SSE notification Himanshu Chauhan
2025-11-05 10:33 ` Clément Léger
2025-10-29 11:26 ` [RFC PATCH v2 07/10] riscv: Add RISC-V entries in processor type and ISA strings Himanshu Chauhan
2025-10-29 11:26 ` [RFC PATCH v2 08/10] riscv: Introduce HEST SSE notification handlers Himanshu Chauhan
2025-10-29 11:26 ` [RFC PATCH v2 09/10] riscv: Select HAVE_ACPI_APEI required for RAS Himanshu Chauhan
2025-10-29 11:26 ` [RFC PATCH v2 10/10] riscv: Enable APEI GHES driver in defconfig Himanshu Chauhan
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=20251029112649.3811657-1-hchauhan@ventanamicro.com \
--to=hchauhan@ventanamicro.com \
--cc=acpica-devel@lists.linux.dev \
--cc=apatel@ventanamicro.com \
--cc=ardb@kernel.org \
--cc=cleger@rivosinc.com \
--cc=conor@kernel.org \
--cc=james.morse@arm.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robert.moore@intel.com \
--cc=tony.luck@intel.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