|
@@ -792,11 +792,12 @@ static int kvm_s390_vm_start_migration(struct kvm *kvm)
|
|
|
|
|
|
if (kvm->arch.use_cmma) {
|
|
if (kvm->arch.use_cmma) {
|
|
/*
|
|
/*
|
|
- * Get the last slot. They should be sorted by base_gfn, so the
|
|
|
|
- * last slot is also the one at the end of the address space.
|
|
|
|
- * We have verified above that at least one slot is present.
|
|
|
|
|
|
+ * Get the first slot. They are reverse sorted by base_gfn, so
|
|
|
|
+ * the first slot is also the one at the end of the address
|
|
|
|
+ * space. We have verified above that at least one slot is
|
|
|
|
+ * present.
|
|
*/
|
|
*/
|
|
- ms = slots->memslots + slots->used_slots - 1;
|
|
|
|
|
|
+ ms = slots->memslots;
|
|
/* round up so we only use full longs */
|
|
/* round up so we only use full longs */
|
|
ram_pages = roundup(ms->base_gfn + ms->npages, BITS_PER_LONG);
|
|
ram_pages = roundup(ms->base_gfn + ms->npages, BITS_PER_LONG);
|
|
/* allocate enough bytes to store all the bits */
|
|
/* allocate enough bytes to store all the bits */
|