Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp504994yba; Wed, 3 Apr 2019 13:07:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8uYzPdTJ3l6mbOcF7zkELNvWu1X8XdhpEtlkc5HkYpsQS9yjhHdaLat6/RdIUMcl8vSaR X-Received: by 2002:a63:bd42:: with SMTP id d2mr1591244pgp.319.1554322048545; Wed, 03 Apr 2019 13:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554322048; cv=none; d=google.com; s=arc-20160816; b=fOCwIK5+krZiNpMB3Cn8mUozyOKBiTTSZCYseAPihV54WKB95/kQAcYQ8cPycgw8oa 2FfSA02YPMNPYqkx6GEVO0olfP8NmdSikSFL6Rv4n0o9h3vBf4wZOxYghgvYodKUswHH vuus/JCB/h+lpIMHqeDJkutYunf+7f5z2YOvh6eVAQOKBK2DeHRnNI4GkeOLidoAZup+ ekVv8pvBIPA+FTBx7JK2R7KTwjR0nRuwSL8UXrpnuA2vYUn9QW9+QeqeuZidn5hB2fUD pB2RrwQ+9E0ekM3lOucm6IpcH+vSfLAQ77m51JW1fGupVca7458qiVb6fD9Y3lT9Usf+ 4cIA== 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=caDzAPxyJgpXt/HP++4Ec3vEnpJi256n8UK7QelwuVM=; b=yMeF4ZOAMchfoRILP3ufEU/2qpHMRT3Bo72zVCgdFsyuBxurd+QqeiSQQxiuSBhi2f y76QY3bpM49dORgRtiZ8xA0juJcj1IGVa4m/cynBiQAnzoqzbVp4ssyxX6KV0Hh6Ag80 bxaJYq70NqlxMDerLtaAEQCV07/eaX8Fr4gx4xu/yzPRr1UOQXeayEybHJt5GbtU0vbf h6QTb6+0G4x6VN5WTU0ZiyErelpK3X6MqBZXFB7M6gwvT5tEJPnrgIzPiKhUrUax58iB V7NUX97QkGJIjC9ERd8OwTcPWerRyG+Avkpm8aGe7edm+N1P9YU81MpnHFIMlpOmy+Dg q6tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="b/y3sl+l"; 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 c12si14865856pgk.202.2019.04.03.13.07.12; Wed, 03 Apr 2019 13:07:28 -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="b/y3sl+l"; 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 S1727006AbfDCUG2 (ORCPT + 99 others); Wed, 3 Apr 2019 16:06:28 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:63274 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726931AbfDCUG0 (ORCPT ); Wed, 3 Apr 2019 16:06:26 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44ZHCN6494z9v3py; Wed, 3 Apr 2019 22:06:24 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=b/y3sl+l; 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 eaFfVy2lEeyO; Wed, 3 Apr 2019 22:06:24 +0200 (CEST) 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 44ZHCN4x6tz9v3pp; Wed, 3 Apr 2019 22:06:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1554321984; bh=caDzAPxyJgpXt/HP++4Ec3vEnpJi256n8UK7QelwuVM=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=b/y3sl+lmD+5Tlm0QQG+RUGkcRVsR9XGMJz3/UMyMx/b3WLEanuiET9c4PGnWa/uu 6RHxWSMWTRWz/IxlSoLJYTKDO75AJTzNWTIl8egJFCULemoVDYRalmeAzUAaACS7fs /4tCMdoDUAwEszhO4vArAOp7LTBS+LlHVZITzm1o= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CB5DF8B905; Wed, 3 Apr 2019 22:06:24 +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 vS2L4BhxgFm7; Wed, 3 Apr 2019 22:06:24 +0200 (CEST) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A33618B902; Wed, 3 Apr 2019 22:06:24 +0200 (CEST) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 85443655EC; Wed, 3 Apr 2019 20:06:24 +0000 (UTC) Message-Id: <3f85b0df9361404a7ba02931cd1708533147ee19.1554321743.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 12/15] powerpc/mm: Only keep one version of pmd_populate() functions on nohash/32 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, 3 Apr 2019 20:06:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use IS_ENABLED(CONFIG_BOOKE) to make single versions of pmd_populate() and pmd_populate_kernel() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgalloc.h | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h index 4615801aa953..7ee8e27070f4 100644 --- a/arch/powerpc/include/asm/nohash/32/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h @@ -25,37 +25,25 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) #define __pmd_free_tlb(tlb,x,a) do { } while (0) /* #define pgd_populate(mm, pmd, pte) BUG() */ -#ifndef CONFIG_BOOKE - static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *pte) { - *pmdp = __pmd(__pa(pte) | _PMD_PRESENT); + if (IS_ENABLED(CONFIG_BOOKE)) + *pmdp = __pmd((unsigned long)pte | _PMD_PRESENT); + else + *pmdp = __pmd(__pa(pte) | _PMD_PRESENT); } static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t pte_page) { - *pmdp = __pmd(__pa(pte_page) | _PMD_USER | _PMD_PRESENT); + if (IS_ENABLED(CONFIG_BOOKE)) + *pmdp = __pmd((unsigned long)pte_page | _PMD_PRESENT); + else + *pmdp = __pmd(__pa(pte_page) | _PMD_USER | _PMD_PRESENT); } #define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd)) -#else - -static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, - pte_t *pte) -{ - *pmdp = __pmd((unsigned long)pte | _PMD_PRESENT); -} - -static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp, - pgtable_t pte_page) -{ - *pmdp = __pmd((unsigned long)pte_page | _PMD_PRESENT); -} - -#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd)) -#endif static inline void pgtable_free(void *table, unsigned index_size) { -- 2.13.3