Message ID | cover.1642752946.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 EAAA2C433EF for <linux-mm@archiver.kernel.org>; Fri, 21 Jan 2022 08:42:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6427A6B0081; Fri, 21 Jan 2022 03:42:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F29F6B0083; Fri, 21 Jan 2022 03:42:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 492CE6B0085; Fri, 21 Jan 2022 03:42:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id 364096B0081 for <linux-mm@kvack.org>; Fri, 21 Jan 2022 03:42:07 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D904D8FD25 for <linux-mm@kvack.org>; Fri, 21 Jan 2022 08:42:06 +0000 (UTC) X-FDA: 79053651852.19.307D4E3 Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120080.outbound.protection.outlook.com [40.107.12.80]) by imf20.hostedemail.com (Postfix) with ESMTP id 29FC91C000B for <linux-mm@kvack.org>; Fri, 21 Jan 2022 08:42:06 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eIhWc2py+vz92SIKOlUvLLijla1P303zUCWAwXplOBo9va6ELzhHIRS+F41t6r51//DA4gRSEgXsQi2wO4Xk9ZhHvruxcb+L1y7ONFrMcxgAQm749QvDytvcyPt/TiuLm5XQFXbT9yCXIs7MPjkV4A2RxDoXxMzk4dtab5+dCDT6/m52PdNkWEClfsFFaGxdK+fw/HsMM0WxExkUQGnNmYCxnkxNgAF16nw5qyK3Ix35linUz5qaEzmigJX9A2AQRTV9Qf4y8M/a7QTuK7zBLJaibJManhfFmUETonXgGeDdTxFl9OrKZbH/I8KcqbsdV2oWIIi5nNHjSBCAjOEzUg== 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=leWjlZjox3uAVOfaI4AAGDO5Et3s+eb0XfqbtIb1At8=; b=JIiot5zDGKzvFs4+TBI7M0cWOuv+7RMFYDshSfA/CHfswLapvj7u9/VDT3ioFoafcVKTzOFDovBksEA8vMHMDq1y8xqZWfdn/bos7/TZbW7/M29B5wgDl6kmguFhX4WnjsGWJrU5BorOPY3adFAWgPqVT1wiRBmdUdHLcNHU6pxbbPY3B3/fdUJ2Ja4teCMHJG90BVyoq6SFJc8y76OUnQPrC4ATlce4ZQT4QY0SAKSueUvn2TkAaBn32zsvX/rbjjXqz6W/OBcjNJC5cCQSo7NYM6cRssxPB82i6xWbqTKdyxQtIe9F6n5TOIFAv81lmKGOeMDkOexSoBODIl/cNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:31::15) by PR1P264MB2206.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:192::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Fri, 21 Jan 2022 08:42:03 +0000 Received: from MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::9d4f:1090:9b36:3fc5]) by MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM ([fe80::9d4f:1090:9b36:3fc5%5]) with mapi id 15.20.4909.008; Fri, 21 Jan 2022 08:42:03 +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 v7 00/14] Convert powerpc to default topdown mmap layout Thread-Topic: [PATCH v7 00/14] Convert powerpc to default topdown mmap layout Thread-Index: AQHYDqLDmNB/bhjgA0WW4tdN8Jl9pw== Date: Fri, 21 Jan 2022 08:42:03 +0000 Message-ID: <cover.1642752946.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: cdc021f2-b8df-44b6-d9ea-08d9dcb9e5eb x-ms-traffictypediagnostic: PR1P264MB2206:EE_ x-microsoft-antispam-prvs: <PR1P264MB22065620694713166E11B36FED5B9@PR1P264MB2206.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: DhGXULuKsHGsmbAKlI9Sr5y3T6HWoIZerOtE3Efx/GL19ziYcsWVqXwRwMkTOaQ215U8lSENlg8i7Wmvtreb519gyv1aLJxvBfRp6SwEGDeyh7v2H0sD5ItLPybc8uC3h63c5ZsK9kLa+WA1k9AwkKMNTpPsyFW1Wi5R9tjoePtbUVrZk32Xb3A69bYF78kww9dqm7OzAaTc26OfY4X3shrE+VCRmCvKPfGFy3y3/NFHwwz0XH+3V8EQMuo7bxcwpqIBW8I21VySG/n2uZ2FHeRRoZDcUXXbCg8if4kI7RbMY1Chm7F/Je9fSYbQ2oTofFnlheeFkkQ+JpDiWGAJoSqU0JUpirbIU1XhyYFMDnWGrEG9v9d/7piHhM4/ZxqWPaR4oKXlOylPNOCQFUq6oAnoD5c5bK0xKm18hbdxUb22WsmyxHZ1kTGhnrCJkLkjZl6QXC9LZeAdvb1uNNBEROQ1SSclm3c9HYDNPdQ/neQO5B1xgrjWBJSKAGoXlOH59BVj0BoFyQjPC4mKamgkbEX9jrVQFp7nvmGOLCQpYKFNxA/O+GmfuOaMSz/ZOTA/XAGcfaI2fp+7elCwb//9Tma9/is79QWG25XUvG2iozUL8gPdymQ2I3fW9CObp0vzpiDQBjL1PsUvm53lC4dGRzzL/pPg9+gCJKKzSB3LpFFZIDi/ahiIF0x/fGfsqI5EoaPBZOy4PMEAR5Urodlo5g== 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)(71200400001)(316002)(54906003)(38070700005)(2906002)(6512007)(8936002)(6486002)(86362001)(186003)(2616005)(83380400001)(7416002)(110136005)(26005)(66476007)(66556008)(64756008)(91956017)(36756003)(66946007)(44832011)(76116006)(66446008)(38100700002)(508600001)(5660300002)(8676002)(4326008)(122000001)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?uAB5HeKs87TS1VhtPhZv56JE0auN?= =?ut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-8?q?kX4e8Yi6T6zGwmMbrozcIcDMY8CXKtyctnqtJdA8QXOOt3xLUtfNFYyGi1DpPcPFO?= =?utf-8?q?iGYn6rv+xM5QDc7nBihe8VsxMTxVVj71/PIqy5qejo//4bwiZ4HOKQaBcI7jCNzy4?= =?utf-8?q?umsCM3frL/jKcVA3OHstpge8mzNqzpZNa/2AbgkU9//JIZdfXerQZI0FmZwRWHEw/?= =?utf-8?q?HlMUx04HoYDrOdUQUpzQPxkqKDNR3jNMx9ORnXQLQ790bdMTmCsGcIXQBojkUjKDg?= =?utf-8?q?we0hajNUheX5uYD+iNLois9jwLDZr1jk3oBmhbDX2CEeMSVimPDUPI51M23B+fO+N?= =?utf-8?q?j91Fckgyn11hufKEXkYtEjYdQBVKP8rRQesTiYUPxs13fFYia4GrSjB6AACx6SEXg?= =?utf-8?q?iSkR8TMENSWJgzJwtEt6KRc5hVh+7C1AKbi10UmgwY/yAWgkbmbA6I6JV7rV+xEqB?= =?utf-8?q?7WtgT7jLqMg4jqXNQ34zMFoAVQWY/Gt/LYxKDb6wg3fVFipqUClML6uL4EleArpqj?= =?utf-8?q?mO+B0IaQoDe2WGifaKQNShgYG9mU7wpvfTmY90oIZzfe/IdyxELY+zonTCIfVsQga?= =?utf-8?q?xU46DmnL3wt0YYMZM6GdZiD6PXI8yaSngJLlmfZ553LM5JD+s0CSaJmE42QWZfGiX?= =?utf-8?q?jespFpyAdLACpjgF0GEKNFMDa6l5faaIrVOCBBjGbDuuapZu0sExT+D47hF+CvEBq?= =?utf-8?q?AIFukIj0F7H7HkY9RIirODTX0ayEytPZ6f1BDbD3XuFf7NiF1DXsw8=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <1DD1A181BEA4F0419D59E7807036351A@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: cdc021f2-b8df-44b6-d9ea-08d9dcb9e5eb X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2022 08:42:03.3354 (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: 8Tv2DpkJmQYKT+mQUsT7Yi0ObnC6k3lrDbfk5qI5dQw2/ilju/Mslohv+pU0kt6+faL2qEyDWDlXUgFnhYDm/iNih15yQLjFv/M4/VgJn+4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR1P264MB2206 X-Rspamd-Queue-Id: 29FC91C000B X-Stat-Signature: sabxryfng9gdhaco4hro4qcmdjqugjta Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf20.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 40.107.12.80 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu X-Rspamd-Server: rspam06 X-HE-Tag: 1642754526-678135 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 v7: - Taken into account comments from Catalin (patches 3 and 4) 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