From patchwork Mon Nov 29 14:19:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12644709 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 A4167C433FE for ; Mon, 29 Nov 2021 14:22:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 849396B0078; Mon, 29 Nov 2021 09:20:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F9876B007B; Mon, 29 Nov 2021 09:20:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C0EF6B007D; Mon, 29 Nov 2021 09:20:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id 59D616B0078 for ; Mon, 29 Nov 2021 09:20:39 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 182CC8EBF1 for ; Mon, 29 Nov 2021 14:20:29 +0000 (UTC) X-FDA: 78862178178.30.EB000A5 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf11.hostedemail.com (Postfix) with ESMTP id 31DC0F0006CA for ; Mon, 29 Nov 2021 14:20:23 +0000 (UTC) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4J2nYM1mbHz9sT4; Mon, 29 Nov 2021 15:19:51 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15BUlw8q236k; Mon, 29 Nov 2021 15:19:51 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4J2nY41Q1Fz9sTD; Mon, 29 Nov 2021 15:19:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1E64E8B7AA; Mon, 29 Nov 2021 15:19:36 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id p7JTDfw25QcC; Mon, 29 Nov 2021 15:19:36 +0100 (CET) Received: from PO20335.IDSI0.si.c-s.fr (unknown [172.25.230.108]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A35298B7B2; Mon, 29 Nov 2021 15:19:35 +0100 (CET) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 1ATEJQOc959544 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 29 Nov 2021 15:19:26 +0100 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 1ATEJQDx959542; Mon, 29 Nov 2021 15:19:26 +0100 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f 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 Subject: [PATCH v3 00/10] Convert powerpc to default topdown mmap layout Date: Mon, 29 Nov 2021 15:19:14 +0100 Message-Id: X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1638195562; l=3086; s=20211009; h=from:subject:message-id; bh=1erw0VtOXrYy2x4dP5mNsIfz576xCuqm2bQLPruXkhk=; b=3RTY7VpGfoPz4K7IC1rD8QLFf/pgmfgabPWELEGQrvMHxz2lCkgGpIv6svnER43DJvXOXX6sLho+ EsNNhJOnBQn919ggCm87sU94wKDLKr8ADD2q/6+R4BjcTodPjOdc X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 31DC0F0006CA X-Stat-Signature: 5f15pkguw96ehco8sjcttprb4yr3u1ze Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=none X-HE-Tag: 1638195623-697080 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: Rebased on top of Nic's v5 series "powerpc: Make hash MMU code build configurable" This series converts powerpc to default topdown mmap layout. powerpc provides 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. Then a small modification is done to core mm to allow powerpc to still provide its own arch_randomize_brk() Last part converts to default topdown mmap layout. Changes in v3: - Fixed missing 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 (10): powerpc/mm: Make slice specific to book3s/64 powerpc/mm: Move vma_mmu_pagesize() and hugetlb_get_unmapped_area() to slice.c powerpc/mm: Remove CONFIG_PPC_MM_SLICES powerpc/mm: Remove asm/slice.h powerpc/mm: Call radix__arch_get_unmapped_area() from arch_get_unmapped_area() mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT powerpc/mm: Convert to default topdown mmap layout powerpc/mm: Properly randomise mmap with slices sizes.h: Add SZ_1T macro powerpc: Simplify and move arch_randomize_brk() arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/book3s/64/hash.h | 7 +- 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/slice.h | 18 ++ 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/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 | 200 ++++++++++++++- arch/powerpc/mm/hugetlbpage.c | 28 --- arch/powerpc/mm/mmap.c | 228 ------------------ 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 - include/linux/sizes.h | 2 + mm/util.c | 2 +- 25 files changed, 237 insertions(+), 470 deletions(-) delete mode 100644 arch/powerpc/include/asm/slice.h rename arch/powerpc/mm/{ => book3s64}/slice.c (80%) delete mode 100644 arch/powerpc/mm/mmap.c