Skip to content

[7.0_bos] NVIDIA: VR: SAUCE: firmware: smccc: Add Live Firmware Activation (LFA) v2 support#388

Draft
nirmoy wants to merge 12 commits intoNVIDIA:26.04_linux-nvidia-bosfrom
nirmoy:lfa_v2_for_7.0_bos
Draft

[7.0_bos] NVIDIA: VR: SAUCE: firmware: smccc: Add Live Firmware Activation (LFA) v2 support#388
nirmoy wants to merge 12 commits intoNVIDIA:26.04_linux-nvidia-bosfrom
nirmoy:lfa_v2_for_7.0_bos

Conversation

@nirmoy
Copy link
Copy Markdown
Collaborator

@nirmoy nirmoy commented Apr 24, 2026

BugLink: https://jirasw.nvidia.com/browse/DGX-16093
LP: https://bugs.launchpad.net/ubuntu/+source/linux-nvidia-bos/+bug/2150652

Summary

Forward-port of the full Arm Live Firmware Activation (LFA) v2 series to 26.04_linux-nvidia-bos.

This brings in the complete upstream v2 series (8 patches) by Andre Przywara and Salman Nabi, based on v7.0-rc1:

https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/

Patches:

  1. Revert old v1 LFA patches (4 commits)
  2. dt-bindings: arm: Add Live Firmware Activation binding
  3. firmware: smccc: Add support for Live Firmware Activation (LFA)
  4. firmware: smccc: lfa: Move image rescanning
  5. firmware: smccc: lfa: Add timeout and trigger watchdog
  6. firmware: smccc: lfa: Register ACPI notification
  7. firmware: smccc: lfa: Add auto_activate sysfs file
  8. firmware: smccc: lfa: Register DT interrupt
  9. firmware: smccc: lfa: introduce SMC access lock
  10. [Config] Enable ARM LFA support
  11. firmware: smccc: lfa: handle LFA_BUSY in PRIME and ACTIVATE

Test

Boot tested on nvidia@10.103.232.135 (arm64, kernel 7.0.0):

$ uname -r
7.0.0
$ ls /sys/firmware/lfa/
0509b633-5734-422f-a681-6096e932d93a
3ab71f81-32b9-496d-841b-e3d0e9fd1a48
65922703-2f74-e644-8dff-579ac1ff0610
6c0762a6-12f2-4b56-92cb-ba8f633606d9
$ sudo journalctl -k | grep -i 'firmware activation'
kernel: Arm LFA: Live Firmware Activation: detected v1.0 [NVIDIA VR SAUCE lfa_v2]
kernel: Arm LFA: registered LFA ACPI notification

LFA driver loaded successfully, 4 firmware components exposed via sysfs.
Chris Li validated it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

PR Validation Report

Patchscan ✅ No Missing Fixes

All cherry-picked commits checked — no missing upstream fixes found.

PR Lint ✅ All checks passed

Details
Checking 12 commits...

Cherry-pick digest:
┌──────────────┬───────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject           │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 01cd0f8e97bf │ [SAUCE] firmware: smccc: lfa: handle lfa_busy │ N/A        │ N/A     │ vvidwans, nirmoyd         │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1ca69bf55020 │ firmware: smccc: lfa: introduce smc access lo │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 584d5308e16b │ firmware: smccc: lfa: register dt interrupt   │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c31a18579709 │ firmware: smccc: lfa: add auto_activate sysfs │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 252ab06874f9 │ firmware: smccc: lfa: register acpi notificat │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0e06ba25fad2 │ firmware: smccc: lfa: add timeout and trigger │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c2dcbefe0a78 │ firmware: smccc: lfa: move image rescanning   │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 4c1ae5f56ba5 │ firmware: smccc: add support for live firmwar │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 4ff148a79d16 │ dt-bindings: arm: add live firmware activatio │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b02fd80fb04f │ [Revert] firmware: smccc: add support for liv │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ db87af122018 │ [Revert] firmware: smccc: add timeout, touch  │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼───────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ a35a50125d09 │ [Revert] firmware: smccc: register as platfor │ N/A        │ N/A     │ nirmoyd                   │
└──────────────┴───────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint: all checks passed.

@nirmoy nirmoy marked this pull request as ready for review April 29, 2026 14:07
@clsotog
Copy link
Copy Markdown
Collaborator

clsotog commented Apr 29, 2026

The last 2 patches they have not sent upstream?

@nvmochs
Copy link
Copy Markdown
Collaborator

nvmochs commented Apr 29, 2026

@nirmoy

Verified the picks from v2 are clean.

Couple of questions...

  • Any particular reason why the annotations commit was reverted and then reapplied? Couldn't that have been left as-is?
  • 43d8018 NVIDIA: VR: SAUCE: firmware: smccc: lfa: handle LFA_BUSY in PRIME and ACTIVATE
    • Is this a more recent version of the "NVIDIA: VR: SAUCE: firmware: smccc: lfa: handle LFA_BUSY and improve SMC retry pacing" patch we hold in the 6.17-HWE? Were the other changes from that 6.17-HWE version no longer needed with v2 of the series?
    • Do you or Veda plan to post this patch to LKML?
  • eb2fc8d NVIDIA: VR: SAUCE: firmware: smccc: lfa: tag init log with SAUCE identifier
    • This is definitely not an upstream candidate patch. I'm not sure there is much value in this since we can identify the version of the patch from the kernel version.

nirmoy and others added 12 commits April 29, 2026 09:05
This reverts commit f1ad1da.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
This reverts commit e7616bc.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
…ware Activation (LFA)"

This reverts commit dc37170.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
…ding

The Arm Live Firmware Activation spec [1] describes updating firmware
images during runtime, without requiring a reboot. Update images might
be deployed out-of-band, for instance via a BMC, in this case the OS
needs to be notified about the availability of a new image.

This binding describes an interrupt that could be triggered by the
platform, to notify about any changes.

[1] https://developer.arm.com/documentation/den0147/latest/

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
…ivation (LFA)

The Arm Live Firmware Activation (LFA) is a specification [1] to describe
activating firmware components without a reboot. Those components
(like TF-A's BL31, EDK-II, TF-RMM, secure paylods) would be updated the
usual way: via fwupd, FF-A or other secure storage methods, or via some
IMPDEF Out-Of-Bound method. The user can then activate this new firmware,
at system runtime, without requiring a reboot.
The specification covers the SMCCC interface to list and query available
components and eventually trigger the activation.

Add a new directory under /sys/firmware to present firmware components
capable of live activation. Each of them is a directory under lfa/,
and is identified via its GUID. The activation will be triggered by echoing
"1" into the "activate" file:
==========================================
/sys/firmware/lfa # ls -l . 6c*
.:
total 0
drwxr-xr-x    2 0 0         0 Jan 19 11:33 47d4086d-4cfe-9846-9b95-2950cbbd5a00
drwxr-xr-x    2 0 0         0 Jan 19 11:33 6c0762a6-12f2-4b56-92cb-ba8f633606d9
drwxr-xr-x    2 0 0         0 Jan 19 11:33 d6d0eea7-fcea-d54b-9782-9934f234b6e4

6c0762a6-12f2-4b56-92cb-ba8f633606d9:
total 0
--w-------    1 0        0             4096 Jan 19 11:33 activate
-r--r--r--    1 0        0             4096 Jan 19 11:33 activation_capable
-r--r--r--    1 0        0             4096 Jan 19 11:33 activation_pending
--w-------    1 0        0             4096 Jan 19 11:33 cancel
-r--r--r--    1 0        0             4096 Jan 19 11:33 cpu_rendezvous
-r--r--r--    1 0        0             4096 Jan 19 11:33 current_version
-rw-r--r--    1 0        0             4096 Jan 19 11:33 force_cpu_rendezvous
-r--r--r--    1 0        0             4096 Jan 19 11:33 may_reset_cpu
-r--r--r--    1 0        0             4096 Jan 19 11:33 name
-r--r--r--    1 0        0             4096 Jan 19 11:33 pending_version
/sys/firmware/lfa/6c0762a6-12f2-4b56-92cb-ba8f633606d9 # grep . *
grep: activate: Permission denied
activation_capable:1
activation_pending:1
grep: cancel: Permission denied
cpu_rendezvous:1
current_version:0.0
force_cpu_rendezvous:1
may_reset_cpu:0
name:TF-RMM
pending_version:0.0
/sys/firmware/lfa/6c0762a6-12f2-4b56-92cb-ba8f633606d9 # echo 1 > activate
[ 2825.797871] Arm LFA: firmware activation succeeded.
/sys/firmware/lfa/6c0762a6-12f2-4b56-92cb-ba8f633606d9 #
==========================================

[1] https://developer.arm.com/documentation/den0147/latest/

Signed-off-by: Salman Nabi <salman.nabi@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
After an image activation, the list of firmware images might change, so
we have to re-iterate them through the SMC interface.
Move the corresponding code from the activate_fw_image() function into
update_fw_images_tree(), where it could be reused more easily, for
instance when triggered by an interrupt.

Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
[Andre: split off from another patch, rebased]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
…hdog

Enhance PRIME/ACTIVATION functions to touch watchdog and implement
timeout mechanism. This update ensures that any potential hangs are
detected promptly and that the LFA process is allocated sufficient
execution time before the watchdog timer expires. These changes improve
overall system reliability by reducing the risk of undetected process
stalls and unexpected watchdog resets.

Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
The Arm LFA spec describes an ACPI notification mechanism, where the
platform (firmware) can notify an LFA client about newly available
firmware imag updates ("pending images" in LFA terms).

Add a faux device after discovering the existence of an LFA agent via
the SMCCC discovery mechnism, and use that device to check for the ACPI
notification description. Register this when one is provided.

The notification just conveys the fact that at least one firmware image
has now a pending update, it doesn't say which, also there could be more
than one pending. Loop through all images to find every which needs to
be activated, and trigger the activation. We need to do this is a loop,
since an activation might change the number and the status of available
images.

Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
[Andre: convert from platform driver to faux device]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
The Arm LFA spec places control over the actual activation process in
the hands of the non-secure host OS. An platform initiated interrupt or
notification signals the availability of an updateable firmware image,
but does not necessarily need to trigger it automatically.

Add a sysfs control file that guards such automatic activation. If an
administrator wants to allow automatic platform initiated updates, they
can activate that by echoing a "1" into the auto_activate file in the
respective sysfs directory. Any incoming notification would then result
in the activation triggered.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
The Arm Live Firmware Activation spec describes an asynchronous
notification mechanism, where the platform can notify the host OS about
newly pending image updates.
In the absence of the ACPI notification mechanism also a simple
devicetree node can describe an interrupt.

Add code to find the respective DT node and register the specified
interrupt, to trigger the activation if needed.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
After a successful live activation, the list of firmware images might
change, which also affects the sequence IDs. We store the sequence
ID in a data structure and connect it to its GUID, which is the
identifier used to access certain image properties from userland.
When an activation is happening, the sequence ID associations might
change at any point, so we must be sure to not use any previously
learned sequence ID during this time.

Protect the association between a sequence ID and a firmware image
(its GUID, really) by a reader/writer lock. In this case it's a R/W
semaphore, so it can sleep and we can hold it for longer, also
concurrent SMC calls are not blocked on each other, it's just an
activation that blocks calls.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
(backported from https://lore.kernel.org/all/20260317103336.1273582-1-andre.przywara@arm.com/)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
… ACTIVATE

DEN0147 §2.6: LFA_ACTIVATE can return LFA_BUSY when the firmware
postpones the activation. Although the rwsem in this driver prevents
concurrent ACTIVATE calls from kernel space, an external agent or
internal firmware state may still produce LFA_BUSY. Add an explicit
retry loop (same budget and delay as CALL_AGAIN) so the code does not
silently treat a retriable condition as a terminal failure. Catching
LFA_BUSY explicitly also surfaces potential firmware or driver bugs.

DEN0147 §2.5: LFA_PRIME returning LFA_BUSY means another CPU is
running LFA_PRIME concurrently. This driver never issues parallel PRIME,
so this is unexpected; log pr_warn and return so the caller can surface
the anomaly rather than swallowing it in the generic error path.

Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
@nirmoy nirmoy force-pushed the lfa_v2_for_7.0_bos branch from eb2fc8d to 01cd0f8 Compare April 29, 2026 16:06
@nirmoy
Copy link
Copy Markdown
Collaborator Author

nirmoy commented Apr 29, 2026

@nirmoy

Verified the picks from v2 are clean.

Couple of questions...

  • Any particular reason why the annotations commit was reverted and then reapplied? Couldn't that have been left as-is?

Updated it, kept the commit. Don't have any strong reason to revert and reapply other than that it was easier to do that/

  • 43d8018 NVIDIA: VR: SAUCE: firmware: smccc: lfa: handle LFA_BUSY in PRIME and ACTIVATE

    • Is this a more recent version of the "NVIDIA: VR: SAUCE: firmware: smccc: lfa: handle LFA_BUSY and improve SMC retry pacing" patch we hold in the 6.17-HWE? Were the other changes from that 6.17-HWE version no longer needed with v2 of the series?
    • Do you or Veda plan to post this patch to LKML?

I have updated it to adjust to v2. Veda told me she will work on getting it to upstream.

  • eb2fc8d NVIDIA: VR: SAUCE: firmware: smccc: lfa: tag init log with SAUCE identifier

    • This is definitely not an upstream candidate patch. I'm not sure there is much value in this since we can identify the version of the patch from the kernel version.

My bad. This was for Chris. Removed it.

@nirmoy
Copy link
Copy Markdown
Collaborator Author

nirmoy commented Apr 29, 2026

The last 2 patches they have not sent upstream?

One was purely debug I have removed it.
For the LFA_BUSY Veda will work on upstreaming

@clsotog clsotog self-requested a review April 29, 2026 16:59
Copy link
Copy Markdown
Collaborator

@clsotog clsotog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acked-by: Carol L Soto <csoto@nvidia.com>

@nvmochs nvmochs self-requested a review April 29, 2026 17:05
Copy link
Copy Markdown
Collaborator

@nvmochs nvmochs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No further issues from me.

Acked-by: Matthew R. Ochs <mochs@nvidia.com>

@nirmoy nirmoy marked this pull request as draft April 29, 2026 17:18
@nirmoy
Copy link
Copy Markdown
Collaborator Author

nirmoy commented Apr 29, 2026

Setting it to draft. Need to get an decission on auto_activate which is false by default and QA needs to do

for f in /sys/firmware/lfa/*/auto_activate; do echo 1 | sudo tee $f; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants