]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Fix SEV SEND_START session length & SEND_UPDATE_DATA query length after...
authorAshish Kalra <ashish.kalra@amd.com>
Mon, 7 Jun 2021 06:15:32 +0000 (06:15 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Jun 2021 16:21:55 +0000 (12:21 -0400)
commit04a066f03768259b4675ef044709dda75b4920a3
treed0fcb376dff36d67e5b4373812d65c9b97e7811a
parent2ab628c740ab6a1d7ad8e865ec07e954e21de077
KVM: SVM: Fix SEV SEND_START session length & SEND_UPDATE_DATA query length after commit 5d45c26c5576

Commit 5d45c26c5576 ("KVM: SVM: Allocate SEV command structures on local stack")
uses the local stack to allocate the structures used to communicate with the PSP,
which were earlier being kzalloced. This breaks SEV live migration for
computing the SEND_START session length and SEND_UPDATE_DATA query length as
session_len and trans_len and hdr_len fields are not zeroed respectively for
the above commands before issuing the SEV Firmware API call, hence the
firmware returns incorrect session length and update data header or trans length.

Also the SEV Firmware API returns SEV_RET_INVALID_LEN firmware error
for these length query API calls, and the return value and the
firmware error needs to be passed to the userspace as it is, so
need to remove the return check in the KVM code.

Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Message-Id: <20210607061532.27459-1-Ashish.Kalra@amd.com>
Fixes: 5d45c26c5576 ("KVM: SVM: Allocate SEV command structures on local stack")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c