Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp403708img; Wed, 20 Mar 2019 03:09:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6oAoYq3MZgpvnm7eGSSCQkYtb8T75f6OOUgFud6j5vzKqZ1LzW6/d2l4e6hCMfRbY4E+/ X-Received: by 2002:a17:902:2a89:: with SMTP id j9mr7220599plb.272.1553076595047; Wed, 20 Mar 2019 03:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076595; cv=none; d=google.com; s=arc-20160816; b=qlVLqI2+41kylugAZL57blCiVKcrT7GyBsc2t1jj7BfTpD1nPk6RRvfTXaDZbbG55b KwpwHSpig8ZIbc5xBRvRXZacxiGb7o9dH8DJYi8b+//MVx3+apz8uBtG3fiZF41vHD1x rgx+i/UntETC90OlioLWsgVA7miTXNHrOno5F5Uh90zuWE+rt51fjRuuU/HKocs0b9X5 FG4IHRFDcSkdhD9CRf4W2YQwZQvAp2sZdsIuBT6ZvqCiJj+eQkR4kbABvBLMdXZQ45kp uHrlMWdGDcYJcAq/j6bg3bF+89b7Vy0Mqtd5wjimGbhnpunJpnxe4tjP64TE8XUA19V0 jCKg== 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:references :in-reply-to:message-id:dkim-signature; bh=j/pbUh2lV6lGY76AVFXOvIL2hKV9TjaV0N8Gw3Pr04w=; b=xHiluMMTvPoimC0prqW9OBKmYmrR5eGsyWr1QV21lQ2omJfdiApdrBDZzEEAqA0ft3 no5AvirtcdJiuZDorMFlYct6f+Ux7p8WYxKDYOpsvebVSNfkaOhK1TWBnYmUmpiU7Syn KGfiHt+ZSrcG0nWwImIinwp0WYwo8t9JFd0MhVp6rNh9cpVTQhQkyTqCaRQlFyImVp1v nH3/btpRVb14uAJMiixhb3Ap8z2uhLFSOYMFYd/fbqVyIeLwQAXT06HfWVTT5RLZGANt DJpuoES6+I5xs+lGckRhvhqZR8tsC1kRjuHTyucUF9XGWJFRqcrUa/rFytO5fd2A/s1E niiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=TQXZxeT2; 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 n5si1537058plp.260.2019.03.20.03.09.39; Wed, 20 Mar 2019 03:09:55 -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=TQXZxeT2; 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 S1727697AbfCTKGs (ORCPT + 99 others); Wed, 20 Mar 2019 06:06:48 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:34560 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbfCTKGq (ORCPT ); Wed, 20 Mar 2019 06:06:46 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PQYt25T2z9vC06; Wed, 20 Mar 2019 11:06:42 +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=TQXZxeT2; 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 WVE-TlxJpOpn; Wed, 20 Mar 2019 11:06:42 +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 44PQYt0wpbz9vByx; Wed, 20 Mar 2019 11:06:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553076402; bh=j/pbUh2lV6lGY76AVFXOvIL2hKV9TjaV0N8Gw3Pr04w=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=TQXZxeT2AMBg0RuIwxGIBu/Mz7ipdNXYjx89M9BIkmNvi7nBnhuUtRa6CeFIzbGFc P+i+qT1Q8Eeg3UIOyZWDFUXdd55QxDqlMJymSPKw9m0CA+u6BXZMmjnp0fQXGuUz/f YXQ5VMkCvEg3S5z/OgPP+xQZWICNf8sw8rtmb+1w= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 31AFA8B919; Wed, 20 Mar 2019 11:06:43 +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 tXCopxwffxpb; Wed, 20 Mar 2019 11:06:43 +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 0E0BC8B911; Wed, 20 Mar 2019 11:06:43 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id E57DE63AEF; Wed, 20 Mar 2019 10:06:42 +0000 (UTC) Message-Id: <03f48e9485ad3d536d08405d0a65c221b8c93f1a.1553076180.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 07/27] powerpc/book3e: hugetlbpage is only for CONFIG_PPC_FSL_BOOK3E 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:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As per Kconfig.cputype, only CONFIG_PPC_FSL_BOOK3E gets to select SYS_SUPPORTS_HUGETLBFS so simplify accordingly. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile | 2 +- arch/powerpc/mm/hugetlbpage-book3e.c | 47 +++++++++++++++--------------------- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile index 3c1bd9fa23cd..2c23d1ece034 100644 --- a/arch/powerpc/mm/Makefile +++ b/arch/powerpc/mm/Makefile @@ -37,7 +37,7 @@ obj-y += hugetlbpage.o ifdef CONFIG_HUGETLB_PAGE obj-$(CONFIG_PPC_BOOK3S_64) += hugetlbpage-hash64.o obj-$(CONFIG_PPC_RADIX_MMU) += hugetlbpage-radix.o -obj-$(CONFIG_PPC_BOOK3E_MMU) += hugetlbpage-book3e.o +obj-$(CONFIG_PPC_FSL_BOOK3E) += hugetlbpage-book3e.o endif obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += hugepage-hash64.o obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c index c911fe9bfa0e..61915f4d3c7f 100644 --- a/arch/powerpc/mm/hugetlbpage-book3e.c +++ b/arch/powerpc/mm/hugetlbpage-book3e.c @@ -11,8 +11,9 @@ #include -#ifdef CONFIG_PPC_FSL_BOOK3E #ifdef CONFIG_PPC64 +#include + static inline int tlb1_next(void) { struct paca_struct *paca = get_paca(); @@ -29,28 +30,6 @@ static inline int tlb1_next(void) tcd->esel_next = next; return this; } -#else -static inline int tlb1_next(void) -{ - int index, ncams; - - ncams = mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY; - - index = this_cpu_read(next_tlbcam_idx); - - /* Just round-robin the entries and wrap when we hit the end */ - if (unlikely(index == ncams - 1)) - __this_cpu_write(next_tlbcam_idx, tlbcam_index); - else - __this_cpu_inc(next_tlbcam_idx); - - return index; -} -#endif /* !PPC64 */ -#endif /* FSL */ - -#if defined(CONFIG_PPC_FSL_BOOK3E) && defined(CONFIG_PPC64) -#include static inline void book3e_tlb_lock(void) { @@ -93,6 +72,23 @@ static inline void book3e_tlb_unlock(void) paca->tcd_ptr->lock = 0; } #else +static inline int tlb1_next(void) +{ + int index, ncams; + + ncams = mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY; + + index = this_cpu_read(next_tlbcam_idx); + + /* Just round-robin the entries and wrap when we hit the end */ + if (unlikely(index == ncams - 1)) + __this_cpu_write(next_tlbcam_idx, tlbcam_index); + else + __this_cpu_inc(next_tlbcam_idx); + + return index; +} + static inline void book3e_tlb_lock(void) { } @@ -134,10 +130,7 @@ void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea, unsigned long psize, tsize, shift; unsigned long flags; struct mm_struct *mm; - -#ifdef CONFIG_PPC_FSL_BOOK3E int index; -#endif if (unlikely(is_kernel_addr(ea))) return; @@ -161,11 +154,9 @@ void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea, return; } -#ifdef CONFIG_PPC_FSL_BOOK3E /* We have to use the CAM(TLB1) on FSL parts for hugepages */ index = tlb1_next(); mtspr(SPRN_MAS0, MAS0_ESEL(index) | MAS0_TLBSEL(1)); -#endif mas1 = MAS1_VALID | MAS1_TID(mm->context.id) | MAS1_TSIZE(tsize); mas2 = ea & ~((1UL << shift) - 1); -- 2.13.3