From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Carstens Subject: Re: [PATCH 1/1] s390/mm/kvm: fix mis-merge in gmap handling Date: Mon, 4 Apr 2016 09:47:39 +0200 Message-ID: <20160404074739.GA4058@osiris> References: <1459755692-126047-1-git-send-email-borntraeger@de.ibm.com> <1459755692-126047-2-git-send-email-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1459755692-126047-2-git-send-email-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Christian Borntraeger Cc: Paolo Bonzini , KVM , Alexander Graf , Cornelia Huck , linux-s390 , Jens Freimann , Dominik Dingel , Martin Schwidefsky List-ID: On Mon, Apr 04, 2016 at 09:41:32AM +0200, Christian Borntraeger wrote: > commit 1e133ab296f3 ("s390/mm: split arch/s390/mm/pgtable.c") dropped > some changes from commit a3a92c31bf0b ("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 > Cc: Martin Schwidefsky > Cc: Heiko Carstens > Signed-off-by: Christian Borntraeger > --- > arch/s390/mm/gmap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c > index 69247b4..cace818 100644 > --- a/arch/s390/mm/gmap.c > +++ b/arch/s390/mm/gmap.c > @@ -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. > */ > @@ -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; Acked-by: Heiko Carstens