Commit e0d2a2a9 authored by Sean Christopherson's avatar Sean Christopherson Committed by sanglipeng
Browse files

crypto: ccp: Use the stack for small SEV command buffers

stable inclusion
from stable-v5.10.173
commit c997b509fd0168a3ced0b903c717f5b1a18a396b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8BFR3

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c997b509fd0168a3ced0b903c717f5b1a18a396b



--------------------------------

[ Upstream commit e4a9af79 ]

For commands with small input/output buffers, use the local stack to
"allocate" the structures used to communicate with the PSP.   Now that
__sev_do_cmd_locked() gracefully handles vmalloc'd buffers, there's no
reason to avoid using the stack, e.g. CONFIG_VMAP_STACK=y will just work.

Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20210406224952.4177376-6-seanjc@google.com>
Reviewed-by: default avatarBrijesh Singh <brijesh.singh@amd.com>
Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: 91dfd982 ("crypto: ccp - Avoid page allocation failure warning for SEV_GET_ID2")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 9de74255
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment