]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ccp: Make snp_reclaim_pages and __sev_do_cmd_locked public
authorAlexey Kardashevskiy <aik@amd.com>
Tue, 2 Dec 2025 02:44:46 +0000 (13:44 +1100)
committerDan Williams <dan.j.williams@intel.com>
Tue, 2 Dec 2025 20:05:51 +0000 (12:05 -0800)
commit8a5dd102e48752f8c4144f051eccc602774f1a93
tree368f00857846c79fb02206138572124aea7676c9
parentf7ae6d4ec6520a901787cbab273983e96d8516da
ccp: Make snp_reclaim_pages and __sev_do_cmd_locked public

The snp_reclaim_pages() helper reclaims pages in the FW state. SEV-TIO
and the TMPM driver (a hardware engine which smashes IOMMU PDEs among
other things) will use to reclaim memory when cleaning up.

Share and export snp_reclaim_pages().

Most of the SEV-TIO code uses sev_do_cmd() which locks the sev_cmd_mutex
and already exported. But the SNP init code (which also sets up SEV-TIO)
executes under the sev_cmd_mutex lock so the SEV-TIO code has to use
the __sev_do_cmd_locked() helper. This one though does not need to be
exported/shared globally as SEV-TIO is a part of the CCP driver still.

Share __sev_do_cmd_locked() via the CCP internal header.

Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
Link: https://patch.msgid.link/20251202024449.542361-2-aik@amd.com
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/crypto/ccp/sev-dev.c
drivers/crypto/ccp/sev-dev.h
include/linux/psp-sev.h