diff options
author | Ashish Kalra <ashish.kalra@amd.com> | 2025-09-16 21:29:33 +0000 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2025-09-17 12:11:39 +0200 |
commit | e09701dcdd9ca06be249091eeb786d57e67b613e (patch) | |
tree | 73606dca173df7f348b1e10cf4df059497ac7ab6 /drivers/cdx/controller/mcdi_functions.c | |
parent | e4c00c4ce2aafe61dc7436e763a78d6d112d9e2f (diff) |
crypto: ccp - Add new HV-Fixed page allocation/free API
When SEV-SNP is active, the TEE extended command header page and all output
buffers for TEE extended commands (such as used by Seamless Firmware servicing
support) must be in hypervisor-fixed state, assigned to the hypervisor and
marked immutable in the RMP entrie(s).
Add a new generic SEV API interface to allocate/free hypervisor fixed pages
which abstracts hypervisor fixed page allocation/free for PSP sub devices. The
API internally uses SNP_INIT_EX to transition pages to HV-Fixed page state.
If SNP is not enabled then the allocator is simply a wrapper over
alloc_pages() and __free_pages().
When the sub device free the pages, they are put on a free list and future
allocation requests will try to re-use the freed pages from this list. But
this list is not preserved across PSP driver load/unload hence this free/reuse
support is only supported while PSP driver is loaded. As HV_FIXED page state
is only changed at reboot, these pages are leaked as they cannot be returned
back to the page allocator and then potentially allocated to guests, which
will cause SEV-SNP guests to fail to start or terminate when accessing the
HV_FIXED page.
Suggested-by: Thomas Lendacky <Thomas.Lendacky@amd.com>
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://lore.kernel.org/cover.1758057691.git.ashish.kalra@amd.com
Diffstat (limited to 'drivers/cdx/controller/mcdi_functions.c')
0 files changed, 0 insertions, 0 deletions