Received: by 2002:a05:6520:1682:b0:147:d1a0:b502 with SMTP id ck2csp5597752lkb; Mon, 11 Oct 2021 09:40:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmUzTdn7h/dqWkCMfXZqfQxYWKVM0K5Qfz3+sL9FEhXR0mz4D4TkZAiEKCFOf3k+3bPzWr X-Received: by 2002:a05:6402:270b:: with SMTP id y11mr9254187edd.116.1633970420948; Mon, 11 Oct 2021 09:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633970420; cv=none; d=google.com; s=arc-20160816; b=Rj39W+aNVAVk64uAbtEZxMOBxh48N9gfIp0kiamso0OwmKoovkzAUZImR9M/xyAuKt +JtMQKWxwLmFNqP1LSg9wJv8Fk6P8hPTOB4ouTWUVrfjkAbpjAumqVT4DJCXeoJPHDXP MjDaTwGa6A8/d2fsOZDs/YcwjVnLggeOhNNoNiJSH6iC8anGIbPY43JTF+9Yuc8uVLYu GLDFGpFVFVIErumQS8JBLw+cotO+tEB6o8IxBTyktQ8GTsfucDGzBpme7rSIctkH8uvx x6fxFson0KJMhficjtkqNxHsQUuJ2u8XXLfmeUjELnfecOzbXPNfQqnAO88UZ9CSOxMX BZOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S/rO3t5kGrdWm1xhXFL4TLxjsZk3v/TPzAq6dFPoZlM=; b=xN3OupA96+3we2Un+nH655f+BqPeIEvib60xd6f7pavO2A9uthoUVbjx9HV/EpTD5V 6oyIEJl70mfYRTfnQMMFLfmlBEytOEPG7wQK4St6RY1z3Te+2jm+XS8aiREz3JSgCAUb plrJbq6DHKT5Y3JdEUusj4K71z2+v8Cbb0dPZBfykjnHcVbwbtP1lplwrjjxeDy6yDwD ISPDwm+dRWTMuxl2B5o/3HzOQH3rP59c+b3Yym0Sm6D3rBEio4PE30We5qBl9pz7HH3b gLq6t1etNa4pk45V0HwDuPGs2QjFmGV3sSeFUgREJqx7NUsnM7GOYFW7tLWR0qpdM5qj maJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@me.com header.s=1a1hai header.b=CKlxGcHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=me.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s28si11752753edw.13.2021.10.11.09.39.57; Mon, 11 Oct 2021 09:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@me.com header.s=1a1hai header.b=CKlxGcHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=me.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238968AbhJKOfz (ORCPT + 99 others); Mon, 11 Oct 2021 10:35:55 -0400 Received: from pv50p00im-ztdg10021201.me.com ([17.58.6.45]:51945 "EHLO pv50p00im-ztdg10021201.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238894AbhJKOfy (ORCPT ); Mon, 11 Oct 2021 10:35:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1633962833; bh=S/rO3t5kGrdWm1xhXFL4TLxjsZk3v/TPzAq6dFPoZlM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=CKlxGcHgRPUv3QJCU04YubemLAoYo8cGqUO2mftxV14cixjb/P25peyNfRLktV9xl EUNXrOHa7oLDH4kL5f465Nrm7bXqrJHWFe9KjCv804CNHeKuovhEM2wuTqxLgrrWFH SnTkFdZiIYWF93IhiY4ouSJviLesODab2k6YXXk6Nkl6puTV/+pBvxfzXD6j71ITs3 nXSANPrLDGu5Hr7tzYqaB9i5F2z4X6LBhTnxSH7fRMa5hmN8jHz39i7L62vf95g65u gxNZ/dIM8dH72qNs0bggbS4pD8bVSvJW0D2x734nPpNcJXYlpOquGJAs6enNpjNM6W 7y+4pnQmQgdag== Received: from xiongwei.. (unknown [120.245.2.114]) by pv50p00im-ztdg10021201.me.com (Postfix) with ESMTPSA id 71442A405F4; Mon, 11 Oct 2021 14:33:45 +0000 (UTC) From: sxwjean@me.com To: linux-mm@kvack.org, x86@kernel.org Cc: Xiongwei Song , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Kees Cook , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Andrew Morton , Arnd Bergmann , Al Viro , Gabriel Krisman Bertazi , Lai Jiangshan , Huang Rui , Yazen Ghannam , Kim Phillips , Oleg Nesterov , Balbir Singh , "David S. Miller" , sxwjean@me.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] mm/util: Assign a meaningful value to mmap_legacy_base Date: Mon, 11 Oct 2021 22:31:45 +0800 Message-Id: <20211011143150.318239-2-sxwjean@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211011143150.318239-1-sxwjean@me.com> References: <20211011143150.318239-1-sxwjean@me.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425,18.0.790 definitions=2021-10-11_05:2021-10-07,2021-10-11 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=660 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2110110085 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiongwei Song Let's assign a value to mmap_legacy_base in case the mmap() of some archs needs mmap_legacy_base, like x86. Signed-off-by: Xiongwei Song --- mm/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/util.c b/mm/util.c index e58151a61255..40b1a8837c0b 100644 --- a/mm/util.c +++ b/mm/util.c @@ -414,7 +414,8 @@ void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) random_factor = arch_mmap_rnd(); if (mmap_is_legacy(rlim_stack)) { - mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; + mm->mmap_legacy_base = TASK_UNMAPPED_BASE + random_factor; + mm->mmap_base = mm->mmap_legacy_base; mm->get_unmapped_area = arch_get_unmapped_area; } else { mm->mmap_base = mmap_base(random_factor, rlim_stack); -- 2.30.2