KVM: s390: fix cmma migration for multiple memory slots
authorChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 15 Dec 2017 12:14:31 +0000 (13:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2018 08:31:23 +0000 (09:31 +0100)
commit853bcadeefe18ee0661a302811a17644b1f9e80b
treef403205952c30ecf65db5453791199f9505ecd7b
parent756ac0b046182487a2b813dd1dadb17e0d7b8b67
KVM: s390: fix cmma migration for multiple memory slots

commit 32aa144fc32abfcbf7140f473dfbd94c5b9b4105 upstream.

When multiple memory slots are present the cmma migration code
does not allocate enough memory for the bitmap. The memory slots
are sorted in reverse order, so we must use gfn and size of
slot[0] instead of the last one.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Fixes: 190df4a212a7 (KVM: s390: CMMA tracking, ESSA emulation, migration mode)
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kvm/kvm-s390.c