Message ID | cover.1639736449.git.christophe.leroy@csgroup.eu (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 962C5C433F5 for <linux-mm@archiver.kernel.org>; Fri, 17 Dec 2021 10:27:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CBC236B0071; Fri, 17 Dec 2021 05:27:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C6BEA6B0072; Fri, 17 Dec 2021 05:27:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0C316B0073; Fri, 17 Dec 2021 05:27:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id A2DB66B0071 for <linux-mm@kvack.org>; Fri, 17 Dec 2021 05:27:20 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5183B181AC9C6 for <linux-mm@kvack.org>; Fri, 17 Dec 2021 10:27:10 +0000 (UTC) X-FDA: 78926908620.07.B929AAC Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120044.outbound.protection.outlook.com [40.107.12.44]) by imf23.hostedemail.com (Postfix) with ESMTP id C386C140007 for <linux-mm@kvack.org>; Fri, 17 Dec 2021 10:27:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XvXJlfrpH6P8fLdyX1+QQy1PpC0ye/+CWB/vZi1GF+RrGTW9vFOfhDkCURK/x6E+gIq/y/jsQ0IhLf26/ky9ti5Ecr+uMzueQck/1/EDxawKGi7ujBcCAXaF6i7gzXk78ktKGC9qLHUcUqF0rgs6DHpUfCpKpavd3xtnNUQxnHW5AB4yGmF5WpOUzANUrLQn7ew89Fu+ipkGeo7A1LUfF5rUi4nCPYP4Al1w9ulNGkk/HlNgJ1BpZM1RUlGueljE04ySebj9LybmZgH5TBEMthJJNmTljW3JQAVKjeCc6tKbu+Kp6b4Iue4GzpG59FdTH4qAtDjeiw7vDG7MnvTsQQ== 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=uxkiiv5aWXf24APu1d1uK6OfDrNuBPm/o2ry/Y1/mR4=; b=MRabhMo4NVvkYxwe/D2JQY8uzL+CfVeuvLKtgJhWq8Kxv1M5mjrY05vTlBAEqk/QtePfTY2ird63/j90/5TyKUl0Pr3lM1Og7W6nkSJxSA1kasOrqdThC6kKyA0y9B5ulLs2P/QwTp602JWaWdZLrHuCOaqAdpPtlD9MxgYVWGneriRyUo5hxT1qBwibI1EqWxa7Sw4m/9X2tQgHgNqS8zX5aircNZgkXZ7fmTTMN3hXi5l0Cgat5b5txLArZ10GneJKvaXx3K7vjMqfTSmdu7wSMSq1sJA4He0UKdnMBShDrAFIN5mCe0uHzHKbw6I700ja1TtpgkTAvygtIF2CKA== 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 MR1P264MB1650.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Fri, 17 Dec 2021 10:27:07 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::f0ef:856d:b0de:e85d]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::f0ef:856d:b0de:e85d%5]) with mapi id 15.20.4801.016; Fri, 17 Dec 2021 10:27:07 +0000 From: Christophe Leroy <christophe.leroy@csgroup.eu> To: Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Michael Ellerman <mpe@ellerman.id.au>, "alex@ghiti.fr" <alex@ghiti.fr> CC: Christophe Leroy <christophe.leroy@csgroup.eu>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "akpm@linux-foundation.org" <akpm@linux-foundation.org>, "catalin.marinas@arm.com" <catalin.marinas@arm.com>, "will@kernel.org" <will@kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> Subject: [PATCH v6 00/14] Convert powerpc to default topdown mmap layout Thread-Topic: [PATCH v6 00/14] Convert powerpc to default topdown mmap layout Thread-Index: AQHX8zCkHNu2aU1u5E+ScvtgOHEdKw== Date: Fri, 17 Dec 2021 10:27:07 +0000 Message-ID: <cover.1639736449.git.christophe.leroy@csgroup.eu> 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: 2e708540-9ef1-4204-1ce3-08d9c147c6db x-ms-traffictypediagnostic: MR1P264MB1650:EE_ x-microsoft-antispam-prvs: <MR1P264MB16505D5B1E12B8EC64C45E58ED789@MR1P264MB1650.FRAP264.PROD.OUTLOOK.COM> x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ArTtyVRZ6hV7Z/kD3FD/ZjpYPlp8XQDrFtcOeoxjBZ2HI2Xak79TwQa+Ia0A+p81hanTDfXgfckfGg2MQamjhDHoyP/I+dHgtLJWY1yppPBOyMyPYHHn4ts5hWWwVj0hIZnLWPWxI2I23OwRIrA7+BEixIGzgUKQadtjAltVGOpLsHwolL1XZHErKJSJzo56+CU7MT1vP+H5VIkMSWHX8SnqONAFRnA5YU6Zj4tnlGTavCDikYKIs2+GFQrvf60YhEeXFXAblg0znPrceAuYkO8hwvG/t81ukjIopzsBZjSs5+cm09MP8NL0c2P5O+E6r+r8dWnSIocC1LAG56Vdh666jALSOtpwkQ9TCv3IcfQMHnfMCx/+xfBoC6fqPo9ZKeL2sMIuhxZ/2KnNKEZjy54dPNWgv/dm2M1eSFAZ3WczzBXvRQVsVLuUyf16ucDLeQuddpid6a3exk0/C9Xf+U6Zho9sa5TiHBft/CYNSepOhiNn8LmlqZW+Lp5mfCsCAjYftVy+5esLUx2rfWzEafGN/KyIX7n0dCQg0zN1cWF7BiwNXh1sDinuY/0nyJOdYBu/ef3TL8on+J4h0/ftFKijPNUKRRDFh7FEklopPqlqGJ7Lrp03i03og8Jjt0tbd08HGn0cYAh3ZbIXnaA1Q8PSFWhKVTxSewLDiHlrAYw7k/UDWkw3sLOR/PrTUe9JHKD1is3fmtMIvI0atyA0rg== 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)(8936002)(2906002)(6486002)(6512007)(8676002)(83380400001)(122000001)(36756003)(6506007)(186003)(86362001)(26005)(38070700005)(44832011)(76116006)(66476007)(64756008)(66556008)(5660300002)(38100700002)(66446008)(2616005)(91956017)(66946007)(4326008)(508600001)(316002)(71200400001)(54906003)(7416002)(110136005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms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LcToYSavOorDDDXTQSHngjdY9+p2PPaomahpy9aKDiXS3jLF?= =?utf-8?q?zJKqa09UD1S2ji3+Ab+alVbYQrkhAgqgT4iBl0ZTmSLwn1Cnh/2UaxSynD8U5u3/A?= =?utf-8?q?seKQVG8yLstWBUGNVTCRnPSjTPCYFlmiS8T3JApm8Wu3zrDuOykNNirxxA93UPjF+?= =?utf-8?q?d6UNeclaUr2gDFiZRrhSDota8IAmkamzr0CyPmFDCQcPRh435/fW8u19GjoX+5Dnz?= =?utf-8?q?pQyqOxPwYJX1/RIq436PqoBMD6ewa+Oh9RAh2RYITn8toIB+UbZfwKfnhED7IVBz8?= =?utf-8?q?QAcjeNygoa3YWbLTaaYyTPLdlvp4uK09cjavxDCHfNstFWBElS/JFnc0vmHkxznaf?= =?utf-8?q?gXRhHLnVab6XuFE47uQ438kpi6XcC5ovi7EpRzP1R552/It1/oYhnIpb0RXW97L0Z?= =?utf-8?q?jKb4Us9OX9IeKmb3EsGBu7I4TWcyGVAPjkXqFXoBTRYyF3EbBYRJ310O5NKBgIq1N?= =?utf-8?q?8+g2HqQ8KlwvZe5uZuTYIULG16VNm9JwRFsW8t8dWy6T0zf2vEufyXTsB6CeiDrSY?= =?utf-8?q?Ze5QpY3dsGOyxnYU8ctN+n/BoiYBoyGCi5KoNdngbjj/GmkItX9SMm4gnKxyNVxmu?= =?utf-8?q?v11z+5wQz0fb4Q/yqmtN6dttsBdRBho7jYTKLwfIxrTA8Plxq3Y65t+iSydfrpzJd?= =?utf-8?q?LxNiDFI44//mZu61IhhZQ+fqW+BPF0wphQ7k/Tu4ZkHfPTa0rjZQQ34FkvxZ+oJxN?= =?utf-8?q?Dv1zp1PUwVtsmI+q31ZdZNb9q+x61twmLus/wHQ+/fiR7gZDFIXdLo=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <15DA236F893ADE458E9F39E68DC66DCA@FRAP264.PROD.OUTLOOK.COM> Content-Transfer-Encoding: base64 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: 2e708540-9ef1-4204-1ce3-08d9c147c6db X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2021 10:27:07.1785 (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: qmnLH//oQdLz0rF1GmpaNXZ5fiU3yZvGI5lALivG6qNVbn1K+I8Rtk7mwQq+G6tgU+LXSANb7pHZ/f174cPkvPzgZ6JSI5a0syB8mMq4WhQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB1650 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C386C140007 X-Stat-Signature: cteqx7fqrba84myzrm4jcf6j5yppsi6n Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.12.44 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-HE-Tag: 1639736824-985509 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: <linux-mm.kvack.org> |
Series |
Convert powerpc to default topdown mmap layout
|
expand
|
Rebased on top of powerpc/next branch This series converts powerpc to default topdown mmap layout. powerpc requires its own arch_get_unmapped_area() only when slices are needed, which is only for book3s/64. First part of the series moves slices into book3s/64 specific directories and cleans up other subarchitectures. Last part converts to default topdown mmap layout. A small modification is done to core mm to allow powerpc to still provide its own arch_randomize_brk() Another modification is done to core mm to allow powerpc to use generic versions of get_unmapped_area functions for Radix while still providing its own implementation for Hash, the selection between Radix and Hash being doing at runtime. Last modification to core mm is to give len and flags to arch_get_mmap_end(). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Changes in v6: - New patch (patch 4) to take arch_get_mmap_base() and arch_get_mmap_end() into account in generic hugetlb_get_unmapped_area() - Get back arch_randomize_brk() simplification as it relies on default topdown mmap layout. - Fixed precedence between || and && in powerpc's arch_get_mmap_end() (patch 9) Changes in v5: - Added patch 3 - Added arch_get_mmap_base() and arch_get_mmap_end() to patch 7 to better match original powerpc behaviour - Switched patched 10 and 11 and performed full randomisation in patch 10 just before switching to default implementation, as suggested by Nic. Changes in v4: - Move arch_randomize_brk() simplification out of this series - Add a change to core mm to enable using generic implementation while providing arch specific one at the same time. - Reworked radix get_unmapped_area to use generic implementation - Rebase on top of Nic's series v6 Changes in v3: - Fixed missing <linux/elf-randomize.h> in last patch - Added a patch to move SZ_1T out of drivers/pci/controller/pci-xgene.c Changes in v2: - Moved patch 4 before patch 2 - Make generic arch_randomize_brk() __weak - Added patch 9 Christophe Leroy (14): mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT mm, hugetlbfs: Allow an arch to always use generic versions of get_unmapped_area functions mm: Add len and flags parameters to arch_get_mmap_end() mm, hugetlbfs: Allow for "high" userspace addresses sizes.h: Add SZ_1T macro powerpc/mm: Move vma_mmu_pagesize() powerpc/mm: Make slice specific to book3s/64 powerpc/mm: Remove CONFIG_PPC_MM_SLICES powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area() powerpc/mm: Use generic_hugetlb_get_unmapped_area() powerpc/mm: Move get_unmapped_area functions to slice.c powerpc/mm: Enable full randomisation of memory mappings powerpc/mm: Convert to default topdown mmap layout powerpc: Simplify and move arch_randomize_brk() arch/arm64/include/asm/processor.h | 4 +- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/book3s/64/hugetlb.h | 4 - arch/powerpc/include/asm/book3s/64/mmu-hash.h | 1 + arch/powerpc/include/asm/book3s/64/mmu.h | 6 - arch/powerpc/include/asm/book3s/64/slice.h | 24 ++ arch/powerpc/include/asm/hugetlb.h | 2 +- arch/powerpc/include/asm/paca.h | 7 - arch/powerpc/include/asm/page.h | 1 - arch/powerpc/include/asm/processor.h | 2 - arch/powerpc/include/asm/slice.h | 46 ---- arch/powerpc/include/asm/task_size_64.h | 8 + arch/powerpc/kernel/paca.c | 5 - arch/powerpc/kernel/process.c | 41 --- arch/powerpc/mm/Makefile | 3 +- arch/powerpc/mm/book3s64/Makefile | 2 +- arch/powerpc/mm/book3s64/hash_utils.c | 33 ++- arch/powerpc/mm/book3s64/radix_hugetlbpage.c | 55 ---- arch/powerpc/mm/{ => book3s64}/slice.c | 71 ++++- arch/powerpc/mm/hugetlbpage.c | 34 --- arch/powerpc/mm/mmap.c | 256 ------------------ arch/powerpc/mm/nohash/mmu_context.c | 9 - arch/powerpc/mm/nohash/tlb.c | 4 - arch/powerpc/platforms/Kconfig.cputype | 4 - drivers/pci/controller/pci-xgene.c | 1 - fs/hugetlbfs/inode.c | 26 +- include/linux/hugetlb.h | 5 + include/linux/sched/mm.h | 17 ++ include/linux/sizes.h | 2 + mm/mmap.c | 43 +-- mm/util.c | 2 +- 31 files changed, 185 insertions(+), 535 deletions(-) delete mode 100644 arch/powerpc/include/asm/slice.h rename arch/powerpc/mm/{ => book3s64}/slice.c (91%) delete mode 100644 arch/powerpc/mm/mmap.c