]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: SEV: Disallow COPY_ENC_CONTEXT_FROM if target has created vCPUs
authorSean Christopherson <seanjc@google.com>
Tue, 9 Nov 2021 21:50:56 +0000 (21:50 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:53 +0000 (09:48 +0100)
commitf84c3ad9a94a00113551350feaa89318d5ac80ab
tree6b6757d71168ffb0f8ae05b5a9fc4a50fa9583d6
parent0c38d095b9f1a954cb61e4748f3d66fe16b83dcb
KVM: SEV: Disallow COPY_ENC_CONTEXT_FROM if target has created vCPUs

BugLink: https://bugs.launchpad.net/bugs/1952579
commit 79b11142763791bdead8b6460052cbdde8e08e2f upstream.

Reject COPY_ENC_CONTEXT_FROM if the destination VM has created vCPUs.
KVM relies on SEV activation to occur before vCPUs are created, e.g. to
set VMCB flags and intercepts correctly.

Fixes: 54526d1fd593 ("KVM: x86: Support KVM VMs sharing SEV context")
Cc: stable@vger.kernel.org
Cc: Peter Gonda <pgonda@google.com>
Cc: Marc Orr <marcorr@google.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Nathan Tempelman <natet@google.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211109215101.2211373-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/kvm/svm/sev.c