Re: [Patch v5 7/7] crypto: ccp - Implement SNP Download Firmware EX
From: Herbert Xu
Date: Wed Nov 11 2026 - 05:57:59 EST
On Wed, Oct 21, 2026 at 05:05:03PM +0000, Pratik R. Sampat wrote:
> Implement SNP live firmware update using the DOWNLOAD_FIRMWARE_EX
> command.
>
> DOWNLOAD_FIRMWARE_EX requires the legacy SEV platform to be UNINIT. If
> it is WORKING then legacy guests are running and the update is refused
> as busy. If it is INIT, shut it down, release the buffers the firmware
> owns across that shutdown, run the update, and bring the platform back
> up afterwards. SNP is never taken down, so SNP guests are unaffected.
>
> To test run the following with your sbin file in FW:
>
> echo 1 > /sys/class/firmware/sev/loading
> cat <firmware.sbin> > /sys/class/firmware/sev/data
> echo 0 > /sys/class/firmware/sev/loading
>
> The COMMIT bit is left clear, so the image is only loaded provisionally
> and the admin decides when to make it permanent with ioctl(/dev/sev,
> SNP_COMMIT). To roll back, do not commit and upload the previous image
> the same way.
>
> Co-developed-by: Tycho Andersen (AMD) <tycho@xxxxxxxxxx>
> Signed-off-by: Tycho Andersen (AMD) <tycho@xxxxxxxxxx>
> Signed-off-by: Pratik R. Sampat <prsampat@xxxxxxx>
> ---
> v4..v5:
> * Report original firmware error on rollback failure - Tycho, Shantanu
> ---
> drivers/crypto/ccp/sev-dev.c | 297 ++++++++++++++++++++++++++++++++++-
> drivers/crypto/ccp/sev-dev.h | 2 +
> include/linux/psp-sev.h | 19 +++
> 3 files changed, 317 insertions(+), 1 deletion(-)
Sashiko has a comment on this patch:
https://sashiko.dev/#/patchset/cover.1792599491.git.prsampat%40amd.com
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt