Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp321280img; Wed, 20 Mar 2019 01:07:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEgzciEUqNaN8QpnSjOUvkux01ljYRCfZTTjiTEcbNSVVhOyqgTsd9NLQxA6gx88jGXB7y X-Received: by 2002:a63:d30b:: with SMTP id b11mr6182927pgg.116.1553069256557; Wed, 20 Mar 2019 01:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553069256; cv=none; d=google.com; s=arc-20160816; b=LOYKBixHC72f1UBpXezbBHI4QZdtTi5tkZlRT4/CmEtvC8MxZ5WnYQ+9SMG0fXLVoV ijiXGkYntg5G0pPlU9nd5wZ8zlNC6clGdr2gIht3r4gHFOcrtslGUX2yH9wDZg3ESOmb hYE3uQAKaiqW/2elTl2rf3tA16bYOh8fwL4Bls36kw4bm1NbyYL+07fg4U5RyK/L3Y58 knlZhJ/Cv5GGjwC9Cj7LUQd+8dNmVQNTr8HdpIw9QPLC/vTggP+K/CB08TrlxotKef/c GDApBZotxp6b45+Wh1lBJMKH0/F6rFIyijF4vGG5klO0AZLQDaEc6cXowUlIIatmeU56 5XiQ== 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=rvgtEFljU/MDwjWci5lIWb+EiOuBRO+LM7KFcdfIF98=; b=mNm4cHuN+E7zMff8v5p4A9px6jopcQkxsq1B2v8WNMpbIjxQ92BgWuuTkxvOUitwAo jvHQzYpvlkrjm0M2GJMr8l7pTXS0Cqw77CGwR6uRiX6qdt9dBzLgzybW213vjLqnbeL7 w0uaCKvjW+XHGwksZ7utQScZWTIefVm6dzZOC5rgxBauCrVnIDvJCb2NkHFi8w05JgTF 5WbvPgPnMewej24cKDGQj/pZcg+q/ZVW1lgPJ6CzEOH5RppBXgyKVOJb0SVmgU3tkIDO qBu+WFeW4waMpydCcjlbbo/4aPj99k7tuAI+QDbS3LzOdqi8TsC0spg5x8Z6p7k3ZaoQ UDsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=M6fXg3yL; 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 t18si1284091plr.78.2019.03.20.01.07.21; Wed, 20 Mar 2019 01:07:36 -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=M6fXg3yL; 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 S1727748AbfCTIGn (ORCPT + 99 others); Wed, 20 Mar 2019 04:06:43 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:23667 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727438AbfCTIGl (ORCPT ); Wed, 20 Mar 2019 04:06:41 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PMvM1KxVz9v0sK; Wed, 20 Mar 2019 09:06:39 +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=M6fXg3yL; 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 y8ATYzIcvcpt; Wed, 20 Mar 2019 09:06:39 +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 44PMvM0Bj6z9v0sF; Wed, 20 Mar 2019 09:06:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553069199; bh=rvgtEFljU/MDwjWci5lIWb+EiOuBRO+LM7KFcdfIF98=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=M6fXg3yLL4rwLvfn1Bh/KyJpr9IHaKVOzDegsVqmKKLBIMPBYGXjr2/rymmnx9soF HrqPA1Y2Vz1MAYetckvNpRBPxn7/ohIbgBSpWMZCnUN+cZu6sfKjZ+QbL2kQ9/kSRO iao/IBxSJGhT5frTqbHWKqgXQmMz7RoQWLsB1V1I= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EF4338B8FD; Wed, 20 Mar 2019 09:06:39 +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 XCLY2YU4nE7n; Wed, 20 Mar 2019 09:06:39 +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 CA8A98B8F8; Wed, 20 Mar 2019 09:06:39 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id BEF3163AF9; Wed, 20 Mar 2019 08:06:39 +0000 (UTC) Message-Id: <0e87f999b5bd9d5a98e5d15a9d0c320f0c1fec5a.1553069097.git.christophe.leroy@c-s.fr> In-Reply-To: <67ed3a31a16b9ece870ec55139e83c86d4d9ce60.1553069097.git.christophe.leroy@c-s.fr> References: <67ed3a31a16b9ece870ec55139e83c86d4d9ce60.1553069097.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH 3/3] powerpc/mm: print hash info in a helper To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Mar 2019 08:06:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reduce #ifdef mess by defining a helper to print hash info at startup. In the meantime, remove the display of hash table address to reduce leak of non necessary information. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/setup-common.c | 19 +------------------ arch/powerpc/mm/hash_utils_64.c | 8 ++++++++ arch/powerpc/mm/mmu_decl.h | 5 ++++- arch/powerpc/mm/ppc_mmu_32.c | 9 ++++++++- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 2e5dfb6e0823..f24a74f7912d 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -799,12 +799,6 @@ void arch_setup_pdev_archdata(struct platform_device *pdev) static __init void print_system_info(void) { pr_info("-----------------------------------------------------\n"); -#ifdef CONFIG_PPC_BOOK3S_64 - pr_info("ppc64_pft_size = 0x%llx\n", ppc64_pft_size); -#endif -#ifdef CONFIG_PPC_BOOK3S_32 - pr_info("Hash_size = 0x%lx\n", Hash_size); -#endif pr_info("phys_mem_size = 0x%llx\n", (unsigned long long)memblock_phys_mem_size()); @@ -826,18 +820,7 @@ static __init void print_system_info(void) pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features); #endif -#ifdef CONFIG_PPC_BOOK3S_64 - if (htab_address) - pr_info("htab_address = 0x%p\n", htab_address); - if (htab_hash_mask) - pr_info("htab_hash_mask = 0x%lx\n", htab_hash_mask); -#endif -#ifdef CONFIG_PPC_BOOK3S_32 - if (Hash) - pr_info("Hash = 0x%p\n", Hash); - if (Hash_mask) - pr_info("Hash_mask = 0x%lx\n", Hash_mask); -#endif + print_system_hash_info(); if (PHYSICAL_START > 0) pr_info("physical_start = 0x%llx\n", diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 0a4f939a8161..017380b890bb 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c @@ -1909,3 +1909,11 @@ static int __init hash64_debugfs(void) } machine_device_initcall(pseries, hash64_debugfs); #endif /* CONFIG_DEBUG_FS */ + +void __init print_system_hash_info(void) +{ + pr_info("ppc64_pft_size = 0x%llx\n", ppc64_pft_size); + + if (htab_hash_mask) + pr_info("htab_hash_mask = 0x%lx\n", htab_hash_mask); +} diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index f7f1374ba3ee..dc617ade83ab 100644 --- a/arch/powerpc/mm/mmu_decl.h +++ b/arch/powerpc/mm/mmu_decl.h @@ -83,6 +83,8 @@ static inline void _tlbivax_bcast(unsigned long address, unsigned int pid, } #endif +static inline void print_system_hash_info(void) {} + #else /* CONFIG_PPC_MMU_NOHASH */ extern void hash_preload(struct mm_struct *mm, unsigned long ea, @@ -92,6 +94,8 @@ extern void hash_preload(struct mm_struct *mm, unsigned long ea, extern void _tlbie(unsigned long address); extern void _tlbia(void); +void print_system_hash_info(void); + #endif /* CONFIG_PPC_MMU_NOHASH */ #ifdef CONFIG_PPC32 @@ -105,7 +109,6 @@ extern unsigned int rtas_data, rtas_size; struct hash_pte; extern struct hash_pte *Hash; -extern unsigned long Hash_size, Hash_mask; #endif /* CONFIG_PPC32 */ diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c index 088f14d57cce..864096489b6d 100644 --- a/arch/powerpc/mm/ppc_mmu_32.c +++ b/arch/powerpc/mm/ppc_mmu_32.c @@ -37,7 +37,7 @@ #include "mmu_decl.h" struct hash_pte *Hash; -unsigned long Hash_size, Hash_mask; +static unsigned long Hash_size, Hash_mask; unsigned long _SDR1; struct ppc_bat BATS[8][2]; /* 8 pairs of IBAT, DBAT */ @@ -392,3 +392,10 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, else /* Anything else has 256M mapped */ memblock_set_current_limit(min_t(u64, first_memblock_size, 0x10000000)); } + +void __init print_system_hash_info(void) +{ + pr_info("Hash_size = 0x%lx\n", Hash_size); + if (Hash_mask) + pr_info("Hash_mask = 0x%lx\n", Hash_mask); +} -- 2.13.3