From: Ashish Kalra <Ashish.Kalra@amd.com>
To: <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
<seanjc@google.com>, <pbonzini@redhat.com>,
<thomas.lendacky@amd.com>, <herbert@gondor.apana.org.au>
Cc: <nikunj@amd.com>, <davem@davemloft.net>, <aik@amd.com>,
<ardb@kernel.org>, <michael.roth@amd.com>,
<Neeraj.Upadhyay@amd.com>, <linux-kernel@vger.kernel.org>,
<kvm@vger.kernel.org>, <linux-crypto@vger.kernel.org>
Subject: [RESEND PATCH v2 0/3] crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver
Date: Mon, 18 Aug 2025 20:18:12 +0000 [thread overview]
Message-ID: <cover.1755548015.git.ashish.kalra@amd.com> (raw)
From: Ashish Kalra <ashish.kalra@amd.com>
AMD Seamless Firmware Servicing (SFS) is a secure method to allow
non-persistent updates to running firmware and settings without
requiring BIOS reflash and/or system reset.
SFS does not address anything that runs on the x86 processors and
it can be used to update ASP firmware, modules, register settings
and update firmware for other microprocessors like TMPM, etc.
SFS driver support adds ioctl support to communicate the SFS
commands to the ASP/PSP by using the TEE mailbox interface.
The Seamless Firmware Servicing (SFS) driver is added as a
PSP sub-device.
Includes pre-patch to add new generic SEV API interface to allocate/free
hypervisor fixed pages which abstracts hypervisor fixed page allocation
and free for PSP sub devices. The API internally uses SNP_INIT_EX to
transition pages to HV-Fixed page state.
For detailed information, please look at the SFS specifications:
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/58604.pdf
v2:
- Change API interface from adding/removing HV_Fixed pages to
allocate/free HV_Fixed pages.
- Move to guard() for all mutexes/spinlocks.
- Handle case of SFS capability bit being set on multiple PSPs, add
protection based on sev_dev_init() and sev_misc_init().
- Add new sfs_command structure and use it for programming both the
GetFirmareVersions and UpdatePackage command.
- Use sfs_user_get_fw_versions and sfs_user_update_package structures
for copy_to_/copy_from_user for the iotcls.
- Fix payload_path buffer size to prevent buffer overrun/stack
corruption issues and also sanitize user provided payload_name to
ensure it is null-terminated and use snprintf() to setup payload_path.
- Add new quiet parameter to snp_leak_pages() API and additionally change
all existing users of this API to pass quiet=false parameter
maintaining current behavior.
- Remove mutex_init() and mutex_destroy() calls for statically declared
mutex.
- Fix comments and commit logs.
Ashish Kalra (3):
x86/sev: Add new quiet parameter to snp_leak_pages() API
crypto: ccp - Add new HV-Fixed page allocation/free API.
crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver
arch/x86/include/asm/sev.h | 4 +-
arch/x86/kvm/svm/sev.c | 4 +-
arch/x86/virt/svm/sev.c | 5 +-
drivers/crypto/ccp/Makefile | 3 +-
drivers/crypto/ccp/psp-dev.c | 20 ++
drivers/crypto/ccp/psp-dev.h | 8 +-
drivers/crypto/ccp/sev-dev.c | 184 ++++++++++++++++-
drivers/crypto/ccp/sev-dev.h | 3 +
drivers/crypto/ccp/sfs.c | 302 ++++++++++++++++++++++++++++
drivers/crypto/ccp/sfs.h | 47 +++++
include/linux/psp-platform-access.h | 2 +
include/uapi/linux/psp-sfs.h | 87 ++++++++
12 files changed, 660 insertions(+), 9 deletions(-)
create mode 100644 drivers/crypto/ccp/sfs.c
create mode 100644 drivers/crypto/ccp/sfs.h
create mode 100644 include/uapi/linux/psp-sfs.h
--
2.34.1
next reply other threads:[~2025-08-18 20:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 20:18 Ashish Kalra [this message]
2025-08-18 20:18 ` [RESEND PATCH v2 1/3] x86/sev: Add new quiet parameter to snp_leak_pages() API Ashish Kalra
2025-08-18 21:14 ` Sean Christopherson
2025-08-19 20:34 ` Kalra, Ashish
2025-08-18 20:18 ` [RESEND PATCH v2 2/3] crypto: ccp - Add new HV-Fixed page allocation/free API Ashish Kalra
2025-08-18 20:18 ` [RESEND PATCH v2 3/3] crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver Ashish Kalra
2025-08-19 12:22 ` kernel test robot
2025-08-18 20:26 ` [RESEND PATCH v2 0/3] " Borislav Petkov
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=cover.1755548015.git.ashish.kalra@amd.com \
--to=ashish.kalra@amd.com \
--cc=Neeraj.Upadhyay@amd.com \
--cc=aik@amd.com \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=nikunj@amd.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).