Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp404877img; Wed, 20 Mar 2019 03:11:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqymepffiTyEq+iVKouFXF4Zy5TUo6I6k720RvJ4qYb2d+vX+5mC+Etc+2XbZXD0t8NItCof X-Received: by 2002:a63:4343:: with SMTP id q64mr6426678pga.105.1553076678300; Wed, 20 Mar 2019 03:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076678; cv=none; d=google.com; s=arc-20160816; b=MMAF+ndv7mSNTv069NzVq9mf/kx3EXc5xWCxIOk4At7KZnyHQaqHo6W5pjlZ6k0qBe jW8ywPzkin46nO44ZhhZsKS1G+1gVwqZwjjGQAv0XIvmqvdLo6T7nZ6ADhfnNutUBNQa xuvDJ3X2A1fxb4yfIJuVUK2kmtqnRHckE1XQX6fs9VfG/WCGdYFfNb7CzlgBkZwZOzxP ba3goc6Cxe5bbNLCaHFfW2w50Qm9VJlmdsIzedQsaECeJyj5XbvRqAKxNCSCwgwW6GLV zuxf4ih/kUKqoOnHkCWy99DpvGIk7sWhh5XHJD22dK5XqQF7ZV3NYSCVLAkWUQC9qTLX PR/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :dkim-signature; bh=TdkFaqEZaF4rEmRCkdUJ4i7IZPhv3teZiDofQzCOris=; b=ZMXvSjm/PQNKwIfAxyYyGWg8yR26tMP5vZz+oxl3smu32OQCZV/EYF6pAH+WNTJ9OX FDCVjoHtHzotTABvAJkOL2K/GSdokykjb5oZYYGx3QfMEEpFxRlkiGvnSppMejtpMPEu /dJpYlxxAtdN9heq/+zvS8pLkEQtKYOXN7rLoBDqJq8g+d2wCFUoVgQeF/cFWHi3ax84 6idmO+OTbXaByxCdaqTWGceaczJAfU6iIfF9wbjElJ4xVB39Yf58odcoSA0uubnkiDC1 QU7pWqBOlK8gBwro9fR1ivKBAsdHoHNZNyuxAKyhEyIHSNwglpdc4TK5miW73luRyi9o Q8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=S1aUtcUr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f18si1312965pgv.253.2019.03.20.03.11.02; Wed, 20 Mar 2019 03:11:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=S1aUtcUr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728026AbfCTKIy (ORCPT + 99 others); Wed, 20 Mar 2019 06:08:54 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:8615 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfCTKGi (ORCPT ); Wed, 20 Mar 2019 06:06:38 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PQYk6v4wz9vByy; Wed, 20 Mar 2019 11:06:34 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=S1aUtcUr; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id MCxzExgMd-u1; Wed, 20 Mar 2019 11:06:34 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44PQYk5k54z9vByx; Wed, 20 Mar 2019 11:06:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553076394; bh=TdkFaqEZaF4rEmRCkdUJ4i7IZPhv3teZiDofQzCOris=; h=From:Subject:To:Cc:Date:From; b=S1aUtcUr4Q0o53gWaQbmoATi2pbMjdkdstCgy8We7M0HMue3b83A8sehEJLxmBz0E hL/HmcJb015VZhbksPGK6mZqWHRbnmB83EZQUqHKUedi0LZR6X6rsT6KHTUfVuW4Rc iVRhnUBVXy1XPMETCIdkmizQ2MOluku1gYmqPNds= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D338B8B91A; Wed, 20 Mar 2019 11:06:35 +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 NG4fGzSDtkKW; Wed, 20 Mar 2019 11:06:35 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A7C558B911; Wed, 20 Mar 2019 11:06:35 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7CC3863AEF; Wed, 20 Mar 2019 10:06:35 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v1 00/27] Reduce ifdef mess in hugetlbpage.c and slice.c To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Mar 2019 10:06:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The main purpose of this series is to reduce the amount of #ifdefs in hugetlbpage.c and slice.c At the same time, it does some cleanup by reducing the number of BUG_ON() and dropping unused functions. It also removes 64k pages related code in nohash/64 as 64k pages are can only by selected on book3s/64 Christophe Leroy (27): powerpc/mm: Don't BUG() in hugepd_page() powerpc/mm: don't BUG in add_huge_page_size() powerpc/mm: don't BUG() in slice_mask_for_size() powerpc/book3e: drop mmu_get_tsize() powerpc/mm: drop slice_set_user_psize() powerpc/64: only book3s/64 supports CONFIG_PPC_64K_PAGES powerpc/book3e: hugetlbpage is only for CONFIG_PPC_FSL_BOOK3E powerpc/mm: move __find_linux_pte() out of hugetlbpage.c powerpc/mm: make hugetlbpage.c depend on CONFIG_HUGETLB_PAGE powerpc/mm: make gup_hugepte() static powerpc/mm: split asm/hugetlb.h into dedicated subarch files powerpc/mm: add a helper to populate hugepd powerpc/mm: define get_slice_psize() all the time powerpc/mm: no slice for nohash/64 powerpc/mm: cleanup ifdef mess in add_huge_page_size() powerpc/mm: move hugetlb_disabled into asm/hugetlb.h powerpc/mm: cleanup HPAGE_SHIFT setup powerpc/mm: cleanup remaining ifdef mess in hugetlbpage.c powerpc/mm: drop slice DEBUG powerpc/mm: remove unnecessary #ifdef CONFIG_PPC64 powerpc/mm: hand a context_t over to slice_mask_for_size() instead of mm_struct powerpc/mm: move slice_mask_for_size() into mmu.h powerpc/mm: remove a couple of #ifdef CONFIG_PPC_64K_PAGES in mm/slice.c powerpc: define subarch SLB_ADDR_LIMIT_DEFAULT powerpc/mm: flatten function __find_linux_pte() powerpc/mm: flatten function __find_linux_pte() step 2 powerpc/mm: flatten function __find_linux_pte() step 3 arch/powerpc/Kconfig | 3 +- arch/powerpc/include/asm/book3s/64/hugetlb.h | 73 +++++++ arch/powerpc/include/asm/book3s/64/mmu.h | 22 +- arch/powerpc/include/asm/book3s/64/slice.h | 7 +- arch/powerpc/include/asm/hugetlb.h | 87 +------- arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h | 45 +++++ arch/powerpc/include/asm/nohash/32/mmu-8xx.h | 18 ++ arch/powerpc/include/asm/nohash/32/slice.h | 2 + arch/powerpc/include/asm/nohash/64/pgalloc.h | 3 - arch/powerpc/include/asm/nohash/64/pgtable.h | 4 - arch/powerpc/include/asm/nohash/64/slice.h | 12 -- arch/powerpc/include/asm/nohash/hugetlb-book3e.h | 45 +++++ arch/powerpc/include/asm/nohash/pte-book3e.h | 5 - arch/powerpc/include/asm/page.h | 12 +- arch/powerpc/include/asm/pgtable-be-types.h | 7 +- arch/powerpc/include/asm/pgtable-types.h | 7 +- arch/powerpc/include/asm/pgtable.h | 3 - arch/powerpc/include/asm/slice.h | 8 +- arch/powerpc/include/asm/task_size_64.h | 2 +- arch/powerpc/kernel/fadump.c | 1 + arch/powerpc/kernel/setup-common.c | 8 +- arch/powerpc/mm/Makefile | 4 +- arch/powerpc/mm/hash_utils_64.c | 1 + arch/powerpc/mm/hugetlbpage-book3e.c | 52 ++--- arch/powerpc/mm/hugetlbpage-hash64.c | 16 ++ arch/powerpc/mm/hugetlbpage.c | 245 ++++------------------- arch/powerpc/mm/pgtable.c | 114 +++++++++++ arch/powerpc/mm/slice.c | 132 ++---------- arch/powerpc/mm/tlb_low_64e.S | 31 --- arch/powerpc/mm/tlb_nohash.c | 13 -- arch/powerpc/platforms/Kconfig.cputype | 4 + 31 files changed, 438 insertions(+), 548 deletions(-) create mode 100644 arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h delete mode 100644 arch/powerpc/include/asm/nohash/64/slice.h create mode 100644 arch/powerpc/include/asm/nohash/hugetlb-book3e.h -- 2.13.3