[7.0_bos] NVIDIA: VR: SAUCE: firmware: smccc: Add Live Firmware Activation (LFA) v2 support#388
[7.0_bos] NVIDIA: VR: SAUCE: firmware: smccc: Add Live Firmware Activation (LFA) v2 support#388nirmoy wants to merge 12 commits intoNVIDIA:26.04_linux-nvidia-bosfrom
Conversation
PR Validation ReportPatchscan ✅ No Missing FixesAll cherry-picked commits checked — no missing upstream fixes found. PR Lint ✅ All checks passedDetailsChecking 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. |
|
The last 2 patches they have not sent upstream? |
|
Verified the picks from v2 are clean. Couple of questions...
|
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>
eb2fc8d to
01cd0f8
Compare
Updated it, kept the commit. Don't have any strong reason to revert and reapply other than that it was easier to do that/
I have updated it to adjust to v2. Veda told me she will work on getting it to upstream.
My bad. This was for Chris. Removed it. |
One was purely debug I have removed it. |
clsotog
left a comment
There was a problem hiding this comment.
Acked-by: Carol L Soto <csoto@nvidia.com>
nvmochs
left a comment
There was a problem hiding this comment.
No further issues from me.
Acked-by: Matthew R. Ochs <mochs@nvidia.com>
|
Setting it to draft. Need to get an decission on auto_activate which is false by default and QA needs to do |
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:
dt-bindings: arm: Add Live Firmware Activation bindingfirmware: smccc: Add support for Live Firmware Activation (LFA)firmware: smccc: lfa: Move image rescanningfirmware: smccc: lfa: Add timeout and trigger watchdogfirmware: smccc: lfa: Register ACPI notificationfirmware: smccc: lfa: Add auto_activate sysfs filefirmware: smccc: lfa: Register DT interruptfirmware: smccc: lfa: introduce SMC access lock[Config] Enable ARM LFA supportfirmware: smccc: lfa: handle LFA_BUSY in PRIME and ACTIVATETest
Boot tested on
nvidia@10.103.232.135(arm64, kernel 7.0.0):LFA driver loaded successfully, 4 firmware components exposed via sysfs.
Chris Li validated it.