]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccp - Flush the SEV-ES TMR memory before giving it to firmware
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 23 Jan 2023 22:53:08 +0000 (16:53 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:58 +0000 (09:32 +0100)
commitea6499b76427c1806596693bf1869d62fab64545
treed0e47b6abf9b8de87e9f82beaaf2ce6856de6322
parent1f476e33c5a61f0625ccd4177ae0fedb0545dc75
crypto: ccp - Flush the SEV-ES TMR memory before giving it to firmware

[ Upstream commit 31547fc9ec7ec13302c8e3b8c9d5b5baf255cc09 ]

Perform a cache flush on the SEV-ES TMR memory after allocation to prevent
any possibility of the firmware encountering an error should dirty cache
lines be present. Use clflush_cache_range() to flush the SEV-ES TMR memory.

Fixes: e5e6c6e1e899 ("crypto: ccp - Add support for SEV-ES to the PSP driver")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/ccp/sev-dev.c