mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC 0/4] firmware: arm: Add Platform Fault Detection Interface support
@ 2026-11-19 15:36 Ahmed Azeem
  2026-11-19 15:36 ` [PATCH RFC 1/4] uapi: firmware: arm: Add PFDI userspace ABI Ahmed Azeem
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ahmed Azeem @ 2026-11-19 15:36 UTC (permalink / raw)
  To: linux-arm-kernel, Sudeep Holla
  Cc: Jonathan Corbet, Shuah Khan, Randy Dunlap, Mark Rutland,
	Lorenzo Pieralisi, linux-api, linux-doc, linux-kernel, Divin Raj,
	Bertrand Marquis, Ahmed Azeem

Hi all,

This series proposes an arm64 driver for the Arm Platform Fault
Detection
Interface (PFDI), providing a common Linux interface for privileged
userspace to discover and invoke firmware diagnostics.

We are posting this series as an RFC to seek community feedback on both
the proposed Linux interface and the underlying firmware specification
before the specification is finalized. This series and its validation
use
the PFDI 1.0 ALP0 specification [1]. The current public revision is PFDI
1.0 BET0 [2]. Feedback on the software integration will help identify
any
changes needed to align an upstream implementation with the evolving
specification.

PFDI defines firmware calls for discovering a PE's test engine and test
parts, executing online tests, retrieving out-of-reset test results,
checking
firmware integrity, and injecting responses to validate error handling
[1].
Trusted Firmware-A documents an implementation of these services [3].

A practical use case is a safety-critical or high-availability platform
that uses manufacturer-provided software tests in firmware to detect
faults at boot and during operation. These tests can complement hardware
error-detection mechanisms by targeting failure modes that those
mechanisms do not cover. Firmware performs the boot-time tests, Linux
software can retrieve their results and request online tests at
intervals
chosen by the platform's diagnostic application. The diagnostic coverage
depends on the tests implemented by the platform.

The Linux use case is a privileged diagnostic application that needs to
discover the tests available on a CPU, run a selected range, and
retrieve
the outcome, including a failing test identifier where firmware provides
one. A common driver and documented userspace ABI would allow that
application to use the same interface across platforms implementing
PFDI,
while keeping the test implementation in platform firmware.

Kernel mediation is needed to issue the SMC calls and coordinate them
with
CPU placement and lifetime. PFDI operations are PE-local [1], so
executing
a request on the intended CPU is part of the interface's correctness.
The proposed driver uses a worker bound to each target CPU and exposes
/dev/cpu/<cpu>/pfdi. Requests and results are carried through typed
ioctls;
device nodes default to mode 0600, and each CPU device permits one open
owner at a time.

The driver leaves the choice of test ranges, execution frequency, and
response to a reported fault to userspace. It adds no periodic test loop
or automatic recovery policy. The intended upstream benefit is a shared
firmware access mechanism that platform diagnostic tools can build on,
without embedding their deployment-specific policy in the kernel.

The four patches provide:

1. A UAPI header, ioctl allocation, ABI documentation, and MAINTAINERS
   entry.
2. The firmware driver, per-CPU devices, and query operations.
3. Test execution, out-of-reset result retrieval, and error injection.
4. Worker serialization and CPU hotplug lifetime handling.

Error injection is included to exercise the software path that consumes
PFDI responses. The proposed ABI also returns the firmware's 64-bit
failing
test identifier for test execution and out-of-reset result queries.

Arm's public reference software documentation describes firmware, Linux
driver, and userspace components for a PFDI stack [4]. Its default
reference
test backend is a placeholder, so this provides integration context
rather
than evidence of hardware diagnostic coverage.

Validation of this revision:

Runtime validation was performed on Arm Zena CSS using its reference
PFDI
firmware and userspace stack, exercising service startup, per-core
diagnostic execution, out-of-reset result queries, CLI operations,
monitoring, and forced-error handling. As the default reference firmware
test backend is an integration placeholder rather than a production test
library, this validates the end-to-end userspace, Linux, SMC, and
firmware
paths rather than hardware diagnostic coverage.

I would appreciate feedback on the specification's suitability for Linux
integration, the proposed per-CPU ioctl ABI, the worker and hotplug
model,
and whether this belongs under drivers/firmware. In particular, is this
the right scope for a common PFDI interface, and should error injection
be exposed separately from normal diagnostic operations?

[1] Arm Platform Fault Detection Interface Specification, document
110468,
    version 1.0 ALP0:
    https://documentation-service.arm.com/static/68593b17961937560be90fbe

[2] Arm Platform Fault Detection Interface Specification, document
110468,
    version 1.0 BET0:
    https://support.arm.com/documentation/110468/1-0bet0/?lang=en

[3] Trusted Firmware-A PFDI implementation documentation:
    https://tf-a.docs.trustedfirmware.org/en/latest/components/pfdi.html

[4] Arm Zena CSS PFDI design documentation:
    https://arm-zena-css.docs.arm.com/en/latest/design/platform_fault_detection_interface.html

To: linux-arm-kernel@lists.infradead.org
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: linux-api@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Divin Raj <divin.raj@arm.com>
Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>

Signed-off-by: Ahmed Azeem <ahmed.azeem@arm.com>
---
Divin Raj (4):
      uapi: firmware: arm: Add PFDI userspace ABI
      firmware: arm: Add PFDI misc driver skeleton
      firmware: arm: Add PFDI run, result, and error injection support
      firmware: arm: Harden PFDI worker and hotplug handling

 Documentation/ABI/testing/dev-cpu-pfdi             | 103 +++
 Documentation/userspace-api/ioctl/ioctl-number.rst |   1 +
 MAINTAINERS                                        |   8 +
 drivers/firmware/Kconfig                           |  14 +
 drivers/firmware/Makefile                          |   1 +
 drivers/firmware/arm_pfdi.c                        | 948 +++++++++++++++++++++
 include/uapi/linux/pfdi.h                          |  89 ++
 7 files changed, 1164 insertions(+)
---
base-commit: 20eef29b7c8465ac98d7dd6d6f2ac07a8d8056ca
change-id: 20261119-topics-ahmaze01-upstream-pfdi-rfc-534c8594d266

Best regards,
-- 
Ahmed Azeem <ahmed.azeem@arm.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-19 21:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 15:36 [PATCH RFC 0/4] firmware: arm: Add Platform Fault Detection Interface support Ahmed Azeem
2026-11-19 15:36 ` [PATCH RFC 1/4] uapi: firmware: arm: Add PFDI userspace ABI Ahmed Azeem
2026-11-19 21:35   ` Jonathan Cameron
2026-11-19 15:36 ` [PATCH RFC 2/4] firmware: arm: Add PFDI misc driver skeleton Ahmed Azeem
2026-11-19 15:36 ` [PATCH RFC 3/4] firmware: arm: Add PFDI run, result, and error injection support Ahmed Azeem
2026-11-19 15:36 ` [PATCH RFC 4/4] firmware: arm: Harden PFDI worker and hotplug handling Ahmed Azeem

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®