Received: by 10.223.164.221 with SMTP id h29csp563140wrb; Thu, 26 Oct 2017 03:16:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rr8erQjwbsx4BGs3tiPYwZiAlJfwXK7R+1TDq1S3IBAsqAw+0g16mx7Umyk1n+ueTTUh4H X-Received: by 10.84.254.79 with SMTP id a15mr4138142pln.413.1509013012661; Thu, 26 Oct 2017 03:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509013012; cv=none; d=google.com; s=arc-20160816; b=M3iDoBH7d0sagBA/tcbHDtQfyws5YpmKXmam+kEV32gpaFhXJ3QL2W5ebq+RzHIJ4Q Hg4lhWKy0t7Ttu2kwVLypnGzOaahv8bBSXc+zYSuUFMS7BnN6Toi9SzVQzaDH0zLSdhv HTc2aKVYUTmRCz4lY0Z4bIQ3OzF6O5UcXijvKHJ0zuB7Bj9n6fauC+VefsbvLaMj2F6b nQ2/kCGXWCLs2QWyZax4ka7iV6JJXZVsWNUWk0ochMIPwPukIb7O6E+RBhGZWhqj9yJP huzvQxyyczlEyloDdeqdn/5babtOYStltbxsmupS+1sx40XSwzykWNWKnIsKhLp5PGde pHUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=oCRDMc/6KayVDAS37fFzxm98zXoXLgy9QtdKademMZY=; b=EESLWk1GpnKnixHL1zwhihroPGUyfDt7xwHIJZghZ0HSJN7n+RGgicaermoW0rWA6B ki8YRU0kVJrzZrp0tVtwrZ3qiAI6RKgnT6sQik3glFTYDBS4W1+Ng8Mz9v+Vx3qdb9s0 SIToB8Bq8WeloWjz23CTvYE5kd4G3cHjPNiXC2A3c5dg6iRlHMDrkfdGcZmlTQk5S8iS ivnoimqpfnZCniaOj+rCjZk9xixH/JgPBO6WnFh8y7yEnAZtA4vv+vPMbLvfVTyItab8 MshoQA51Gvi+/J8MY2CA4N0w48woRX/kANr9B26r61RwXiLIigrRvgCLnIsiEa9jBcEe c0iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si3183572pgo.87.2017.10.26.03.16.37; Thu, 26 Oct 2017 03:16:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751520AbdJZKQP (ORCPT + 99 others); Thu, 26 Oct 2017 06:16:15 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56888 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbdJZKQL (ORCPT ); Thu, 26 Oct 2017 06:16:11 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9QAG1sP033786 for ; Thu, 26 Oct 2017 06:16:11 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dudc61fjc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 26 Oct 2017 06:16:11 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Oct 2017 11:16:09 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 26 Oct 2017 11:16:05 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9QAG5A011534496; Thu, 26 Oct 2017 10:16:05 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA361A404D; Thu, 26 Oct 2017 11:11:18 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6E52A4040; Thu, 26 Oct 2017 11:11:18 +0100 (BST) Received: from mschwideX1 (unknown [9.152.212.220]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 26 Oct 2017 11:11:18 +0100 (BST) Date: Thu, 26 Oct 2017 12:16:02 +0200 From: Martin Schwidefsky To: Li Wang Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, heiko.carstens@de.ibm.com, mingo@kernel.org, hughd@google.com, paul.gortmaker@windriver.com, mhocko@suse.com, Shu Wang Subject: Re: [PATCH] s390/mm: return -ENOMEM in arch_get_unmapped_area[_topdown] In-Reply-To: References: <20171026073610.9139-1-liwang@redhat.com> <20171026112603.7c095ee6@mschwideX1> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17102610-0040-0000-0000-000003E716F2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17102610-0041-0000-0000-000025E98A58 Message-Id: <20171026121602.295e7a6e@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-26_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710260142 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Oct 2017 17:47:39 +0800 Li Wang wrote: > On Thu, Oct 26, 2017 at 5:26 PM, Martin Schwidefsky > wrote: > > On Thu, 26 Oct 2017 15:36:10 +0800 > > Li Wang wrote: > > > > The code in mmap.c checks for the per-task limit, 31-bit vs 64-bit. > > pgalloc.c checks for the maximum allowed address and does not care > > about the task. > > > >> Fixes: 8ab867cb0806 (s390/mm: fix BUG_ON in crst_table_upgrade) > >> Signed-off-by: Li Wang > > > > I don't think this patch fixes anything. > > At least there is a logic error i think, after apply the patch > "s390/mm: fix BUG_ON in crst_table_upgrade", > it makes no sense to compare "if (end >= TASK_SIZE_MAX) return > -ENOMEM" in crst_table_upgrade() function. > > isn't it? Be careful with TASK_SIZE vs. TASK_SIZE_MAX. They return different values for 31-bit compat tasks. If the addr parameter is correctly aligned then the if condition in crst_table_upgrade is superfluous as TASK_SIZE_MAX is now -PAGE_SIZE with the introduction of 5 level page tables. It is important for older kernels with only 4 level page tables with a TASK_SIZE_MAX of 2**53. On the other hand if addr is ever a value between -PAGE_SIZE and -1 we would end up with an endless loop. That makes the if condition a safe-guard and I would like to keep it. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. From 1582313030630675417@xxx Thu Oct 26 09:48:17 +0000 2017 X-GM-THRID: 1582304768297398323 X-Gmail-Labels: Inbox,Category Forums