Commit e4dccf90 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/mm: print hash info in a helper

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: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 8f156c23
...@@ -800,12 +800,6 @@ void arch_setup_pdev_archdata(struct platform_device *pdev) ...@@ -800,12 +800,6 @@ void arch_setup_pdev_archdata(struct platform_device *pdev)
static __init void print_system_info(void) static __init void print_system_info(void)
{ {
pr_info("-----------------------------------------------------\n"); 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", pr_info("phys_mem_size = 0x%llx\n",
(unsigned long long)memblock_phys_mem_size()); (unsigned long long)memblock_phys_mem_size());
...@@ -827,21 +821,7 @@ static __init void print_system_info(void) ...@@ -827,21 +821,7 @@ static __init void print_system_info(void)
pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features); pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features);
#endif #endif
#ifdef CONFIG_PPC_BOOK3S_64 print_system_hash_info();
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);
pr_info("kernel vmalloc start = 0x%lx\n", KERN_VIRT_START);
pr_info("kernel IO start = 0x%lx\n", KERN_IO_START);
pr_info("kernel vmemmap start = 0x%lx\n", (unsigned long)vmemmap);
#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
if (PHYSICAL_START > 0) if (PHYSICAL_START > 0)
pr_info("physical_start = 0x%llx\n", pr_info("physical_start = 0x%llx\n",
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <mm/mmu_decl.h> #include <mm/mmu_decl.h>
struct hash_pte *Hash; struct hash_pte *Hash;
unsigned long Hash_size, Hash_mask; static unsigned long Hash_size, Hash_mask;
unsigned long _SDR1; unsigned long _SDR1;
static unsigned int hash_mb, hash_mb2; static unsigned int hash_mb, hash_mb2;
...@@ -401,6 +401,13 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, ...@@ -401,6 +401,13 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
memblock_set_current_limit(min_t(u64, first_memblock_size, 0x10000000)); 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);
}
#ifdef CONFIG_PPC_KUEP #ifdef CONFIG_PPC_KUEP
void __init setup_kuep(bool disabled) void __init setup_kuep(bool disabled)
{ {
......
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
#include <asm/pte-walk.h> #include <asm/pte-walk.h>
#include <asm/asm-prototypes.h> #include <asm/asm-prototypes.h>
#include <mm/mmu_decl.h>
#ifdef DEBUG #ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt) #define DBG(fmt...) udbg_printf(fmt)
#else #else
...@@ -1945,3 +1947,14 @@ static int __init hash64_debugfs(void) ...@@ -1945,3 +1947,14 @@ static int __init hash64_debugfs(void)
} }
machine_device_initcall(pseries, hash64_debugfs); machine_device_initcall(pseries, hash64_debugfs);
#endif /* CONFIG_DEBUG_FS */ #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);
pr_info("kernel vmalloc start = 0x%lx\n", KERN_VIRT_START);
pr_info("kernel IO start = 0x%lx\n", KERN_IO_START);
pr_info("kernel vmemmap start = 0x%lx\n", (unsigned long)vmemmap);
}
...@@ -83,6 +83,8 @@ static inline void _tlbivax_bcast(unsigned long address, unsigned int pid, ...@@ -83,6 +83,8 @@ static inline void _tlbivax_bcast(unsigned long address, unsigned int pid,
} }
#endif #endif
static inline void print_system_hash_info(void) {}
#else /* CONFIG_PPC_MMU_NOHASH */ #else /* CONFIG_PPC_MMU_NOHASH */
extern void hash_preload(struct mm_struct *mm, unsigned long ea, 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, ...@@ -92,6 +94,8 @@ extern void hash_preload(struct mm_struct *mm, unsigned long ea,
extern void _tlbie(unsigned long address); extern void _tlbie(unsigned long address);
extern void _tlbia(void); extern void _tlbia(void);
void print_system_hash_info(void);
#endif /* CONFIG_PPC_MMU_NOHASH */ #endif /* CONFIG_PPC_MMU_NOHASH */
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
...@@ -105,7 +109,6 @@ extern unsigned int rtas_data, rtas_size; ...@@ -105,7 +109,6 @@ extern unsigned int rtas_data, rtas_size;
struct hash_pte; struct hash_pte;
extern struct hash_pte *Hash; extern struct hash_pte *Hash;
extern unsigned long Hash_size, Hash_mask;
extern u8 early_hash[]; extern u8 early_hash[];
#endif /* CONFIG_PPC32 */ #endif /* CONFIG_PPC32 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment