aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/kvm/kvm-s390.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index efa439f6ffb3..abcd24fdde3f 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -792,11 +792,12 @@ static int kvm_s390_vm_start_migration(struct kvm *kvm)
792 792
793 if (kvm->arch.use_cmma) { 793 if (kvm->arch.use_cmma) {
794 /* 794 /*
795 * Get the last slot. They should be sorted by base_gfn, so the 795 * Get the first slot. They are reverse sorted by base_gfn, so
796 * last slot is also the one at the end of the address space. 796 * the first slot is also the one at the end of the address
797 * We have verified above that at least one slot is present. 797 * space. We have verified above that at least one slot is
798 * present.
798 */ 799 */
799 ms = slots->memslots + slots->used_slots - 1; 800 ms = slots->memslots;
800 /* round up so we only use full longs */ 801 /* round up so we only use full longs */
801 ram_pages = roundup(ms->base_gfn + ms->npages, BITS_PER_LONG); 802 ram_pages = roundup(ms->base_gfn + ms->npages, BITS_PER_LONG);
802 /* allocate enough bytes to store all the bits */ 803 /* allocate enough bytes to store all the bits */