crypto: ccp - Fix SEV_VERSION_GREATER_OR_EQUAL
authorDavid Rientjes <rientjes@google.com>
Fri, 12 Jul 2019 20:41:58 +0000 (13:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Aug 2019 17:08:13 +0000 (19:08 +0200)
commitb8a98fff64deffe441901b8d7e2b8f6127c68e9e
tree1d5ea9f82b82fb3ec379b7732a90143621b1f29b
parent1b3ecd64aaae6bd6fa97059a29f07a2b2e20b2c9
crypto: ccp - Fix SEV_VERSION_GREATER_OR_EQUAL

[ Upstream commit 83bf42510d7f7e1daa692c096e8e9919334d7b57 ]

SEV_VERSION_GREATER_OR_EQUAL() will fail if upgrading from 2.2 to 3.1, for
example, because the minor version is not equal to or greater than the
major.

Fix this and move to a static inline function for appropriate type
checking.

Fixes: edd303ff0e9e ("crypto: ccp - Add DOWNLOAD_FIRMWARE SEV command")
Reported-by: Cfir Cohen <cfir@google.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/ccp/psp-dev.c