]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SEV: unify cgroup cleanup code for svm_vm_migrate_from
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 12 Nov 2021 09:02:24 +0000 (04:02 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 12 Nov 2021 09:37:51 +0000 (04:37 -0500)
commitc86c0de62c7c43105864c0e7e0dd5e1dfe04c8dd
tree5f9a4722d31b34358cc74e376d68f89a17c8cab3
parentc281ee7a75d58c258bedc8fbce8376719cca8b83
KVM: SEV: unify cgroup cleanup code for svm_vm_migrate_from

Use the same cleanup code independent of whether the cgroup to be
uncharged and unref'd is the source or the destination cgroup.  Use a
bool to track whether the destination cgroup has been charged, which also
fixes a bug in the error case: the destination cgroup must be uncharged
only if it does not match the source.

Fixes: 1167986334b9 ("KVM: SEV: Add support for SEV intra host migration")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c