KVM: SEV: initialize regions_list of a mirror VM
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 23 Nov 2021 00:50:30 +0000 (19:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:52 +0000 (09:04 +0100)
commitc4db545992ad89d1bf8181e2af1e37fff250433c
tree0ac4d11b617b466b90675f2198c04777b2934af7
parentb5a8918d0865d3c29a315696f0e444b5472c4273
KVM: SEV: initialize regions_list of a mirror VM

[ Upstream commit 2b347a387811cb4aa7bcdb96e9203c5019a6fb41 ]

This was broken before the introduction of KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM,
but technically harmless because the region list was unused for a mirror
VM.  However, it is untidy and it now causes a NULL pointer access when
attempting to move the encryption context of a mirror VM.

Fixes: 54526d1fd593 ("KVM: x86: Support KVM VMs sharing SEV context")
Message-Id: <20211123005036.2954379-7-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/svm/sev.c