crypto: ccp - Add a quirk to firmware update
authorJarkko Sakkinen <jarkko@profian.com>
Tue, 9 Aug 2022 22:49:15 +0000 (01:49 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 19 Aug 2022 10:39:36 +0000 (18:39 +0800)
commitb3b9fdf1a9be4266b01a2063b1f37cdc20806e3b
treedd62b9d5ea3e186cc3ef739102b2089b5f0574ff
parent56fae4304c8eea2dfb9037ded1aa774acb110d69
crypto: ccp - Add a quirk to firmware update

A quirk for fixing the committed TCB version, when upgrading from a
firmware version earlier than 1.50. This is a known issue, and the
documented workaround is to load the firmware twice.

Currently, this issue requires the  following workaround:

sudo modprobe -r kvm_amd
sudo modprobe -r ccp
sudo modprobe ccp
sudo modprobe kvm_amd

Implement this workaround inside kernel by checking whether the API
version is less than 1.50, and if so, download the firmware twice.
This addresses the TCB version issue.

Link: https://lore.kernel.org/all/de02389f-249d-f565-1136-4af3655fab2a@profian.com/
Reported-by: Harald Hoyer <harald@profian.com>
Signed-off-by: Jarkko Sakkinen <jarkko@profian.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/sev-dev.c