From patchwork Wed Dec 15 06:45:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12677571 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22AD8C433F5 for ; Wed, 15 Dec 2021 06:47:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFD6A6B0078; Wed, 15 Dec 2021 01:45:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D62C86B007B; Wed, 15 Dec 2021 01:45:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDCA76B007E; Wed, 15 Dec 2021 01:45:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0077.hostedemail.com [216.40.44.77]) by kanga.kvack.org (Postfix) with ESMTP id AE4826B0078 for ; Wed, 15 Dec 2021 01:45:28 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5E15288CFA for ; Wed, 15 Dec 2021 06:45:18 +0000 (UTC) X-FDA: 78919091916.25.A98BF26 Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90052.outbound.protection.outlook.com [40.107.9.52]) by imf06.hostedemail.com (Postfix) with ESMTP id E1F2F180005 for ; Wed, 15 Dec 2021 06:45:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6XPFFXkn4esYJms9++Ae3K35reubOxu5damKv86UG7G0+hmqns2UBPWkjjDik73I7WH9cIrbcrDd+3LMPMxb0WZLxRlvxqJ1CiY5jl6sbYaUMhfIsFq7pC2HByiJ4vFztykDkBrlPImtmEzrPxYcsOM3RdWU5hwkLE90B0qID1qV4LfeCzvyz1PSu5ozWAmNEfLfns84fvzvLCaHX+P/13V1KRecmJxUXLD6mzX5QNgEmGUkeZiVFT8DSsPXkLOswPO+wZKbLrcxkXqrwGJ+MikSxPQmU0bocayOb+ygPs86vLU/sbFpvH5aWpbchK0n80u8XRsmzjgx6TpKJuNMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Tfg0sMAM8fxxdC6eQ8XeK/4lMWH8vFXyGKrZdrW9Uug=; b=Y+4mfNngXHyo4WSOk8m9ZxUx8RX/+HfYW8mW1mtcOt3js28zfuyKZdQ6uDX4l0lrms51uAFVoopHtb+UDe14lv+DID5qxPG4AiymM2AC/k0VJRYbPpqv2UTV6gEaLiihJJuuVwC1A0B9EculCDsxM2wmCgmpa3DapwoIy2swz66NztEhm256L4g8f1pkR9mQIRNXQS9CuqbUfSEZkXVOec4O6iujFHSwA6Ak2aSsh6+sh6Ia2h0FdVwSydEDqFdsx8YIAnVcIXOuNpT1E+OSHwdL0xzbd+AQ08M3a0tst5eikKI3KQ2h/4zYocPCcCQ/GvRnID6KThDpbwr9jY7ZYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=csgroup.eu; dmarc=pass action=none header.from=csgroup.eu; dkim=pass header.d=csgroup.eu; arc=none Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:31::15) by MR1P264MB2147.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16; Wed, 15 Dec 2021 06:45:12 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::fc67:d895:7965:663f]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::fc67:d895:7965:663f%2]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 06:45:12 +0000 From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "alex@ghiti.fr" CC: Christophe Leroy , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "catalin.marinas@arm.com" , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: [PATCH v5 03/11] mm: Add len and flags parameters to arch_get_mmap_end() Thread-Topic: [PATCH v5 03/11] mm: Add len and flags parameters to arch_get_mmap_end() Thread-Index: AQHX8X9OeEFvyNlKhUOga6+NHQS3mg== Date: Wed, 15 Dec 2021 06:45:11 +0000 Message-ID: <38f7d0c0e67c8bed3b2f4326339a8ee18fb7daca.1639550392.git.christophe.leroy@csgroup.eu> References: In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 98336235-f06f-41fa-6ffa-08d9bf96718c x-ms-traffictypediagnostic: MR1P264MB2147:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jbDjX/8XxNQscKX66rOK7W9/b+8JTjQUP8fJdKK2bgRUu7aj3Gu2WM1O2Z2Nj3EyCCSIw4z2vArFdjYf/ajeAnxEg0IGSRNSraPoxXZxNDC8tnuuwBvrpC4u7wYTrv6K5XuP8relaOQY0Cj7yv3xoSB3iO887Ik8u+adFjj70UDD/MfF7IB3xP7oLBmWZ/lg8jntQYU8/Zrz8tH7AqcPKVs4E7GxVP0BbUDMs4aRN6HoENl1BwHvnwVWvOGV2Y2L9x0hPi2meoU4Obl/4L+cSue13Lf3b1PkzVC0LxQJhOs9kNl2g6x3VzNxYdF1vI/ggiq8lUZwVWavSLL/H3l/o//X2JcQBOSU3O1TuPVWMCVOcIzHCOpP8R7quF+sHC/Fz13sXeTzpe7cPju/4WHzQJb9Ym1HNgJECllbUWB6z7At0p4n1L/8DDtGWbLFWTTshQcb2Xo7dgo56ZfN81YEH/RA8/pA9tifJkjTvTPdZWRx4uREBRQQslR3dwEcZjoIqTG0S5pguqIvSYsTW7ldJQjUFsUOqAtappi70wrdbpo+zDW3Sd7ZPTNL48k10QrMcTp9RRHIYGeLdy4GSJv2vTL4WVeoWSBdTXXXKnME9j5XVkgQkdmEQtrBK4wej0Ijau0+qi/Ct8sTzOMb22CUVjCCKH9DXqP5SwHAhcaPlLCJbxCjJP9JM/G9bm/fbmkgojTNKYbJDAvupdn0o26vZg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(4636009)(366004)(110136005)(36756003)(6486002)(2906002)(86362001)(5660300002)(508600001)(26005)(186003)(38100700002)(8936002)(44832011)(54906003)(316002)(66556008)(66446008)(66476007)(64756008)(6506007)(76116006)(91956017)(8676002)(66946007)(4326008)(2616005)(122000001)(83380400001)(6512007)(71200400001)(38070700005)(7416002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?GNTY9sBA5lGs4puKtE6ddAP?= =?iso-8859-1?q?QXN5pTys1pNbuxysICUQ6pxx6zb6QeI8KqCG7Y6IVGflsR0MABOq/2JBSbiV?= =?iso-8859-1?q?/GfA+8xXP5CGarzROZKAz1cvEXYtUuZZiOAzM21Etd4rmphnMsziyErl+TDI?= =?iso-8859-1?q?2qfThN8N8TJ7bWL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U5/3Stc29K2im?= =?iso-8859-1?q?11oDMXr81cYid9L5pjlA+6SW0thXOwDO1R7Wro0+77mNdX7PbNl4ibEZhoj2?= =?iso-8859-1?q?07I6vpCO/FRL5k0tBjm6SgZpcc6emFP0W/mhU4bsdU2pO80xlU76eVpzlNxu?= =?iso-8859-1?q?fAvCOAzyA3yPAtR/2XfVGQUH9bXaVTeRJZYk31pqAATC5a3YA62EGASIXLVN?= =?iso-8859-1?q?N6g6ZI4sYkX7H+9NFVtDNJBH4D+PLklLTgL9eLLerXz9N2yi9HNV4W4FxBob?= =?iso-8859-1?q?TAHWgkOM0a+hvUpFKp/pbuMq3rU417mvPevNvyB4ZK79OL7U4gFGrClFjXSh?= =?iso-8859-1?q?JwHPSfMAlaXx1NCpMg3waoE26cLyBd1YYCVV/U9T74MgCZtJfgV2Z4gDsvl6?= =?iso-8859-1?q?KtHyW3AU8bH7O+sLJts+VWzMc2yv5+T3/YFcIKBAojEr1lyjpoDfaxZ2fMHr?= =?iso-8859-1?q?XjHibQ931IF1tLJ8774qq4arDPf6ZyBgTHwuUn+k9V0ZYsakYs2wNo6wtvHP?= =?iso-8859-1?q?VHnI0nZ46BW36iclFHIOyaLpVCZYK4WlQXqoSTE37nbANy16QrOcH+trx9G8?= =?iso-8859-1?q?2puGdAFN+lMgLlOtox3uIBD6mu74ZsoOzvQC8f2Q0DIs984b6GWrcgUaDFVb?= =?iso-8859-1?q?2M6VtaFh3+th3qkDzak2L0FkCPr1EsvM/IVqHmy5FF9vh09vT1yDZ5qzVQ1h?= =?iso-8859-1?q?FjIM=3D?= MIME-Version: 1.0 X-OriginatorOrg: csgroup.eu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 98336235-f06f-41fa-6ffa-08d9bf96718c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2021 06:45:11.7846 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9914def7-b676-4fda-8815-5d49fb3b45c8 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cy3fnxGmn7nkI312x1S6rHS+dFqzIX8V+PpHPkV4u2cLe5K1NvpIasM4L9cSbg+ao8aa7gzCPZEbgrd0v0NcP406VF/mMVrJOPQ3WgDCDzA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB2147 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E1F2F180005 X-Stat-Signature: 6eqja3mspmxe93dn9ca1c7qsbufz3u6i Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.9.52 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=none X-HE-Tag: 1639550716-144596 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Powerpc needs flags and len to make decision on arch_get_mmap_end(). So add them as parameters to arch_get_mmap_end(). Signed-off-by: Christophe Leroy Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/processor.h | 4 ++-- mm/mmap.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 6f41b65f9962..88c696350ace 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -91,8 +91,8 @@ #endif /* CONFIG_COMPAT */ #ifndef CONFIG_ARM64_FORCE_52BIT -#define arch_get_mmap_end(addr) ((addr > DEFAULT_MAP_WINDOW) ? TASK_SIZE :\ - DEFAULT_MAP_WINDOW) +#define arch_get_mmap_end(addr, len, flags) ((addr > DEFAULT_MAP_WINDOW) ? TASK_SIZE :\ + DEFAULT_MAP_WINDOW) #define arch_get_mmap_base(addr, base) ((addr > DEFAULT_MAP_WINDOW) ? \ base + TASK_SIZE - DEFAULT_MAP_WINDOW :\ diff --git a/mm/mmap.c b/mm/mmap.c index 7ac6a07ff382..ad48f7af7511 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2113,7 +2113,7 @@ unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info) } #ifndef arch_get_mmap_end -#define arch_get_mmap_end(addr) (TASK_SIZE) +#define arch_get_mmap_end(addr, len, flags) (TASK_SIZE) #endif #ifndef arch_get_mmap_base @@ -2139,7 +2139,7 @@ generic_get_unmapped_area(struct file *filp, unsigned long addr, struct mm_struct *mm = current->mm; struct vm_area_struct *vma, *prev; struct vm_unmapped_area_info info; - const unsigned long mmap_end = arch_get_mmap_end(addr); + const unsigned long mmap_end = arch_get_mmap_end(addr, len, flags); if (len > mmap_end - mmap_min_addr) return -ENOMEM; @@ -2187,7 +2187,7 @@ generic_get_unmapped_area_topdown(struct file *filp, unsigned long addr, struct vm_area_struct *vma, *prev; struct mm_struct *mm = current->mm; struct vm_unmapped_area_info info; - const unsigned long mmap_end = arch_get_mmap_end(addr); + const unsigned long mmap_end = arch_get_mmap_end(addr, len, flags); /* requested length too big for entire address space */ if (len > mmap_end - mmap_min_addr)