Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@kernel.org>
To: Ahmed Azeem <ahmed.azeem@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	linux-api@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Divin Raj <divin.raj@arm.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>
Subject: Re: [PATCH RFC 0/4] firmware: arm: Add Platform Fault Detection Interface support
Date: Sun, 22 Nov 2026 19:16:50 +0000	[thread overview]
Message-ID: <20261122-memorable-electric-sawfish-ac9f11@sudeepholla> (raw)
In-Reply-To: <20261119-topics-ahmaze01-upstream-pfdi-rfc-v1-0-4772d18b9115@arm.com>

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


      parent reply	other threads:[~2026-11-22 19:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-21  4:14   ` Ashok Raj
2026-11-22 19:21     ` Sudeep Holla
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-21  3:52   ` Ashok Raj
2026-11-19 15:36 ` [PATCH RFC 4/4] firmware: arm: Harden PFDI worker and hotplug handling Ahmed Azeem
2026-11-21  0:44 ` [PATCH RFC 0/4] firmware: arm: Add Platform Fault Detection Interface support Jithu Joseph
2026-11-22 19:24   ` Sudeep Holla
2026-11-22 19:16 ` Sudeep Holla [this message]

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=20261122-memorable-electric-sawfish-ac9f11@sudeepholla \
    --to=sudeep.holla@kernel.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=ahmed.azeem@arm.com \
    --cc=corbet@lwn.net \
    --cc=divin.raj@arm.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    /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