]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccp - shutdown SEV firmware on kexec
authorBrijesh Singh <brijesh.singh@amd.com>
Wed, 28 Jul 2021 15:15:21 +0000 (10:15 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Aug 2021 11:45:25 +0000 (19:45 +0800)
commit9ad48cb6c76c9c223a9c70be4dc2586ff2ae5a37
tree6c1f164fc319257b78e9836e269d628c48ef81ef
parent0744f53da230bbe41eace60201a1191903920fa6
crypto: ccp - shutdown SEV firmware on kexec

The commit e5e6c6e1e8993 ("crypto: ccp - Add support for SEV-ES to the
PSP driver") added support to allocate Trusted Memory Region (TMR)
used during the SEV-ES firmware initialization. The TMR gets locked
during the firmware initialization and unlocked during the shutdown.
While the TMR is locked, access to it is disallowed.

Currently, the CCP driver does not shutdown the firmware during the
kexec reboot, leaving the TMR memory locked.

Register a callback to shutdown the SEV firmware on the kexec boot.

Fixes: e5e6c6e1e8993 ("crypto: ccp - Add support for SEV-ES to the PSP driver")
Reported-by: Lucas Nussbaum <lucas.nussbaum@inria.fr>
Tested-by: Lucas Nussbaum <lucas.nussbaum@inria.fr>
Cc: <stable@kernel.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/sev-dev.c
drivers/crypto/ccp/sp-pci.c