Skip to content

Commit

Permalink
s390/mm/kvm: fix mis-merge in gmap handling
Browse files Browse the repository at this point in the history
commit 1e133ab ("s390/mm: split arch/s390/mm/pgtable.c") dropped
some changes from commit a3a92c3 ("KVM: s390: fix mismatch
between user and in-kernel guest limit") - this breaks KVM for some
memory sizes (kvm-s390: failed to commit memory region) like
exactly 2GB.

Cc: Dominik Dingel <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Acked-by: Heiko Carstens <[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
borntraeger authored and bonzini committed Apr 5, 2016
1 parent 14f4760 commit 9c650d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/s390/mm/gmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* gmap_alloc - allocate a guest address space
* @mm: pointer to the parent mm_struct
* @limit: maximum size of the gmap address space
* @limit: maximum address of the gmap address space
*
* Returns a guest address space structure.
*/
Expand Down Expand Up @@ -292,7 +292,7 @@ int gmap_map_segment(struct gmap *gmap, unsigned long from,
if ((from | to | len) & (PMD_SIZE - 1))
return -EINVAL;
if (len == 0 || from + len < from || to + len < to ||
from + len > TASK_MAX_SIZE || to + len > gmap->asce_end)
from + len - 1 > TASK_MAX_SIZE || to + len - 1 > gmap->asce_end)
return -EINVAL;

flush = 0;
Expand Down

0 comments on commit 9c650d0

Please sign in to comment.