From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yZz336hNGzDqYw for ; Mon, 13 Nov 2017 15:59:59 +1100 (AEDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAD4xbeE126139 for ; Sun, 12 Nov 2017 23:59:57 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e74eb0y60-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 12 Nov 2017 23:59:57 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Nov 2017 04:59:55 -0000 From: "Aneesh Kumar K.V" To: Nicholas Piggin , linuxppc-dev@lists.ozlabs.org Cc: Nicholas Piggin , Michael Ellerman , Florian Weimer , "Kirill A. Shutemov" Subject: Re: [PATCH v2 3/5] powerpc/64s/hash: Allow MAP_FIXED allocations to cross 128TB boundary In-Reply-To: <20171109172740.19681-4-npiggin@gmail.com> References: <20171109172740.19681-1-npiggin@gmail.com> <20171109172740.19681-4-npiggin@gmail.com> Date: Mon, 13 Nov 2017 10:29:49 +0530 MIME-Version: 1.0 Content-Type: text/plain Message-Id: <87bmk6sri2.fsf@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Nicholas Piggin writes: > While mapping hints with a length that cross 128TB are disallowed, > MAP_FIXED allocations that cross 128TB are allowed. These are failing > on hash (on radix they succeed). Add an additional case for fixed > mappings to expand the addr_limit when crossing 128TB. > Reviewed-by: Aneesh Kumar K.V > Cc: "Aneesh Kumar K.V" > Fixes: f4ea6dcb08 ("powerpc/mm: Enable mappings above 128TB") > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/mm/slice.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c > index 3889201b560c..a4f93699194b 100644 > --- a/arch/powerpc/mm/slice.c > +++ b/arch/powerpc/mm/slice.c > @@ -418,7 +418,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, > unsigned long high_limit; > > high_limit = DEFAULT_MAP_WINDOW; > - if (addr >= high_limit) > + if (addr >= high_limit || (fixed && (addr + len > high_limit))) > high_limit = TASK_SIZE; > > if (len > high_limit) > -- > 2.15.0