Re: [PATCH RFC 0/4] firmware: arm: Add Platform Fault Detection Interface support

From: Sudeep Holla

Date: Sun Nov 22 2026 - 14:16:57 EST


On Thu, Nov 19, 2026 at 03:36:02PM +0000, Ahmed Azeem wrote:
> 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.
>

I reviewed the PFDI (Platform Fault Detection Interface) specification
and found some issues that needs to be addressed. In general, this spec
is not on par with other Arm SMCCC based firmware interface specifications.
Many of these issues should have been identified as part of reviews before
the beta release and should also been raised by the team that prototyped
or wrote this driver. I threw my review comments at AI and got them
refactored as below. Hope it helps.

1. State Preservation & Calling Conventions
- Make state preservation a conformance rule:
Move the expectation that firmware saves and restores modified state
from descriptive usage text ($4.6.1) into a formal requirement ($4.6.3)
and cover it in compliance tests ($5.6).
- In general the specification has mixed the terms platform and PE a lot.
It needs to define "system state" and failure behavior:
Specify exact architectural state (e.g., registers, SIMD/FP, SVE, SME)
covered by restoration, how it interacts/matches with SMCCC and PSCI
powerdown rules, and what happens when a test fails, encounters an
internal error, or triggers a system-level fault reaction.
- Clarify calling conventions: Use "SMC/HVC" where both conduits apply
($3.2), and explicitly mandate preserving x5–x17 within PFDI rather than
relying on unpinned SMCCC baseline versions. In one section HVC is allowed
while $3.2 just mentions SMC.

2. Virtualisation, Isolation & PE Scope

- Tighten error-injection isolation:
Because PFDI_FORCE_ERROR leaves an error pending on a PE regardless
of software context, require hypervisors to prevent cross-VM or
cross-OS consumption during context switches or vCPU migration.
I don't fully understand that interface TBH.
- Clarify guest PE identity: Reconcile the requirement for hypervisors
to forward an "originating PE ID" unmodified with the fact that PFDI
functions accept no PE ID parameter or clarify the requirement clearly.
- Define PE vs. system scope per function: Clarify whether "PE" means
the executing CPU or a tested non-CPU resource, explain how drivers
target remote CPUs without a target-PE argument(assuming it needs to
run on that PE, and specify whether PFDI_FW_CHECK is PE-local or
platform-wide. In general, the term platform and PE are mixed in the
document which makes it hard to understand where the rules apply.

3. Function IDs, Execution Timing & Indexing

- Correct SMCCC Function ID classification: Reclassify 0xC400_02D0 –
0xC400_02D7 from "vendor-defined" to the Standard Secure Service range
and confirm the assigned subrange. It was very confusing to read the
reference to vendor defined range.
- Bound CPU occupancy time: Because PFDI uses synchronous SMCCC Fast
Calls without a timeout, cancellation mechanism, or runtime duration
query, define a maximum execution duration, permitted call contexts,
or a yielding/asynchronous mechanism so OS drivers (like Linux) can
be aware of CPU time doing this test.
- Resolve test-part indexing and zero-count conflicts: Fix the off-by-one
discrepancy (0..test_count vs. test_count - 1), correct the
PFDI_PE_TEST_RESULT faulting index format (= 0 vs. general index),
and define behavior when test_count is zero (PFDI_RET_TEST_COUNT_ZERO
is currently unused).

4. Error Injection Semantics, Compliance & Editorial Fixes

- Align reset rules and restrict injected values: Add an explicit exception
allowing resets or firmware updates to clear pending injected errors
($3.5 vs. $4.9), and restrict PFDI_FORCE_ERROR (x2) from accepting
zero or positive values alongside defining deployment/authorization
policies.
- Resolve optionality contradictions: Clarify whether individual PEs
can implement a subset of PFDI functions ($3.4) or must implement
all mandatory functions ($5.1).
- Missing"Security and Safety Considerations" chapter referenced in $1.5

> 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

Specification needs more work IMO, so please get them addressed first.

--
Regards,
Sudeep