From patchwork Wed May 12 05:00:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12252707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31883C43460 for ; Wed, 12 May 2021 05:03:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA11361554 for ; Wed, 12 May 2021 05:03:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA11361554 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:Message-Id:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=hu445MY0nFDxR65JeStjJeVh0OYKCYkgx3oDeIDCyWk=; b=cYdVCZEb+XRJ7MflTP6zPqVAAJ /wJ5wGEgv4bs2BDO38J3SUBkoaISDRovbG+IwrIdhE98eLeFB1dkAK9/CegrH/GJt1LyDPaOF1YSD dZFUOqrAHVC/qD5X3e7LmnFoGl5TIM72wV2Lu7fmETrFKsTZYRJvcKoaeyvZBAAL0q+ZZYf8e74vf m+FX3XV0pm60Jau0U4pmGsQkG4hw0YX3SHPKS2Q621gTjkB0wFYaS2CZVcd6fiA+ZB6v9+yFYeShh ftvzrkG5acm595086HxSZwgm0dGMjF015TeKz5buvaw2/kZI+wpOnSpA8hmKQQC3DCum/Mmmg57JF d0QWLRcQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lggzg-0020Dn-Qb; Wed, 12 May 2021 05:01:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lggze-0020D1-1H for linux-arm-kernel@desiato.infradead.org; Wed, 12 May 2021 05:01:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Date:Cc:To:Subject:From:Message-Id: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=xhpwkbCGHGnOXX2lXmvnqD8vSOeXComHNX6J4zCac2s=; b=q1WYzfg8lcsqKguCo4GdFU1wUR /Yqj+sKS/G2Qp3sCSB2erkBQ2ePaSdZRv38PCc4pGIllyfOoqjETsm82jCwsNTUN2Sy1H/grHqy+P 2EFDKH7DTjyZh9h46qeJLXQ7Br7L1uzUdAd1QEMbuT4N35283+xmNJAphktsjL/HA/KtoauBddi7/ 8nH8Pg8KvxXGYanZEUjUuSYu2ZouJXH4jCVy8t9GScwq9YO9V5Cckku8YjngiP5GBrDF9Vsog/Tdh 6TlSE6LUJf1JTwOOyIPMEl0UBdhaD//4Xmeb1rI6pTq+8tqeGObZvGt9t3yn1PFfH8j7sU9tSkA/B E10ShygQ==; Received: from pegase2.c-s.fr ([93.17.235.10]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lggza-00A6Lb-7g for linux-arm-kernel@lists.infradead.org; Wed, 12 May 2021 05:01:08 +0000 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4Fg2gH0m2Rz9sdy; Wed, 12 May 2021 07:00:59 +0200 (CEST) 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 XsPm6W350ZRE; Wed, 12 May 2021 07:00:59 +0200 (CEST) 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 4Fg2gG6sQxz9sdw; Wed, 12 May 2021 07:00:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 79F568B7D6; Wed, 12 May 2021 07:00:58 +0200 (CEST) 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 xwiuG9ynOkOh; Wed, 12 May 2021 07:00:58 +0200 (CEST) Received: from po15610vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 015118B769; Wed, 12 May 2021 07:00:57 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id AE30264164; Wed, 12 May 2021 05:00:57 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v2 0/5] Implement huge VMAP and VMALLOC on powerpc 8xx To: Andrew Morton , Nicholas Piggin , Mike Kravetz , Mike Rapoport Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linux-mm@kvack.org Date: Wed, 12 May 2021 05:00:57 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210511_220106_464346_AD22785C X-CRM114-Status: UNSURE ( 8.30 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series implements huge VMAP and VMALLOC on powerpc 8xx. Powerpc 8xx has 4 page sizes: - 4k - 16k - 512k - 8M At the time being, vmalloc and vmap only support huge pages which are leaf at PMD level. Here the PMD level is 4M, it doesn't correspond to any supported page size. For now, implement use of 16k and 512k pages which is done at PTE level. Support of 8M pages will be implemented later, it requires use of hugepd tables. To allow this, the architecture provides two functions: - arch_vmap_pte_range_map_size() which tells vmap_pte_range() what page size to use. A stub returning PAGE_SIZE is provided when the architecture doesn't provide this function. - arch_vmap_pte_supported_shift() which tells __vmalloc_node_range() what page shift to use for a given area size. A stub returning PAGE_SHIFT is provided when the architecture doesn't provide this function. The main change in v2 compared to the RFC is that powerpc 8xx specificities are not plugged anymore directly inside vmalloc code. Christophe Leroy (5): mm/hugetlb: Change parameters of arch_make_huge_pte() mm/pgtable: Add stubs for {pmd/pub}_{set/clear}_huge mm/vmalloc: Enable mapping of huge pages at pte level in vmap mm/vmalloc: Enable mapping of huge pages at pte level in vmalloc powerpc/8xx: Add support for huge pages on VMAP and VMALLOC arch/arm64/include/asm/hugetlb.h | 3 +- arch/arm64/mm/hugetlbpage.c | 5 +-- arch/powerpc/Kconfig | 2 +- .../include/asm/nohash/32/hugetlb-8xx.h | 5 +-- arch/powerpc/include/asm/nohash/32/mmu-8xx.h | 43 +++++++++++++++++++ arch/sparc/include/asm/pgtable_64.h | 3 +- arch/sparc/mm/hugetlbpage.c | 6 +-- include/linux/hugetlb.h | 4 +- include/linux/pgtable.h | 26 ++++++++++- include/linux/vmalloc.h | 15 +++++++ mm/hugetlb.c | 6 ++- mm/migrate.c | 4 +- mm/vmalloc.c | 34 +++++++++++---- 13 files changed, 126 insertions(+), 30 deletions(-)