diff mbox series

powerpc/64s: Make boot look nice(r)

Message ID 20190516020437.11783-1-npiggin@gmail.com (mailing list archive)
State Accepted
Commit 2b87a2553aa04105724d6c844e223415985246ed
Headers show
Series powerpc/64s: Make boot look nice(r) | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch next (8150a153c013aa2dd1ffae43370b89ac1347a7fb)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 23 lines checked

Commit Message

Nicholas Piggin May 16, 2019, 2:04 a.m. UTC
Radix boot looks like this:

 -----------------------------------------------------
 phys_mem_size     = 0x200000000
 dcache_bsize      = 0x80
 icache_bsize      = 0x80
 cpu_features      = 0x0000c06f8f5fb1a7
   possible        = 0x0000fbffcf5fb1a7
   always          = 0x00000003800081a1
 cpu_user_features = 0xdc0065c2 0xaee00000
 mmu_features      = 0xbc006041
 firmware_features = 0x0000000010000000
 hash-mmu: ppc64_pft_size    = 0x0
 hash-mmu: kernel vmalloc start   = 0xc008000000000000
 hash-mmu: kernel IO start        = 0xc00a000000000000
 hash-mmu: kernel vmemmap start   = 0xc00c000000000000
 -----------------------------------------------------

Fix:

 -----------------------------------------------------
 phys_mem_size     = 0x200000000
 dcache_bsize      = 0x80
 icache_bsize      = 0x80
 cpu_features      = 0x0000c06f8f5fb1a7
   possible        = 0x0000fbffcf5fb1a7
   always          = 0x00000003800081a1
 cpu_user_features = 0xdc0065c2 0xaee00000
 mmu_features      = 0xbc006041
 firmware_features = 0x0000000010000000
 vmalloc start     = 0xc008000000000000
 IO start          = 0xc00a000000000000
 vmemmap start     = 0xc00c000000000000
 -----------------------------------------------------

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/kernel/setup-common.c    | 8 +++++++-
 arch/powerpc/mm/book3s64/hash_utils.c | 3 ---
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Christophe Leroy May 16, 2019, 4:47 a.m. UTC | #1
Le 16/05/2019 à 04:04, Nicholas Piggin a écrit :
> Radix boot looks like this:
> 
>   -----------------------------------------------------
>   phys_mem_size     = 0x200000000
>   dcache_bsize      = 0x80
>   icache_bsize      = 0x80
>   cpu_features      = 0x0000c06f8f5fb1a7
>     possible        = 0x0000fbffcf5fb1a7
>     always          = 0x00000003800081a1
>   cpu_user_features = 0xdc0065c2 0xaee00000
>   mmu_features      = 0xbc006041
>   firmware_features = 0x0000000010000000
>   hash-mmu: ppc64_pft_size    = 0x0
>   hash-mmu: kernel vmalloc start   = 0xc008000000000000
>   hash-mmu: kernel IO start        = 0xc00a000000000000
>   hash-mmu: kernel vmemmap start   = 0xc00c000000000000
>   -----------------------------------------------------
> 
> Fix:
> 
>   -----------------------------------------------------
>   phys_mem_size     = 0x200000000
>   dcache_bsize      = 0x80
>   icache_bsize      = 0x80
>   cpu_features      = 0x0000c06f8f5fb1a7
>     possible        = 0x0000fbffcf5fb1a7
>     always          = 0x00000003800081a1
>   cpu_user_features = 0xdc0065c2 0xaee00000
>   mmu_features      = 0xbc006041
>   firmware_features = 0x0000000010000000
>   vmalloc start     = 0xc008000000000000
>   IO start          = 0xc00a000000000000
>   vmemmap start     = 0xc00c000000000000
>   -----------------------------------------------------
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

I fear your change defeats most of the purpose of commit 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20190515&id=e4dccf9092ab48a6f902003b9558c0e45d0e849a

As far as I understand, the main issue is the "hash-mmu:" prefix ?
That's due to the following define in top of book3s64/hash_utils.c:

#define pr_fmt(fmt) "hash-mmu: " fmt

Could we simply undef it just before print_system_hash_info() ?
Or move print_system_hash_info() in another book3s64 specific file which 
doesn't set pr_fmt ?

Christophe

> ---
>   arch/powerpc/kernel/setup-common.c    | 8 +++++++-
>   arch/powerpc/mm/book3s64/hash_utils.c | 3 ---
>   2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index aad9f5df6ab6..f2da8c809c85 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -810,9 +810,15 @@ static __init void print_system_info(void)
>   	pr_info("mmu_features      = 0x%08x\n", cur_cpu_spec->mmu_features);
>   #ifdef CONFIG_PPC64
>   	pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features);
> +#ifdef CONFIG_PPC_BOOK3S
> +	pr_info("vmalloc start     = 0x%lx\n", KERN_VIRT_START);
> +	pr_info("IO start          = 0x%lx\n", KERN_IO_START);
> +	pr_info("vmemmap start     = 0x%lx\n", (unsigned long)vmemmap);
> +#endif
>   #endif
>   
> -	print_system_hash_info();
> +	if (!early_radix_enabled())
> +		print_system_hash_info();
>   
>   	if (PHYSICAL_START > 0)
>   		pr_info("physical_start    = 0x%llx\n",
> diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c
> index 919a861a8ec0..8b307b796b83 100644
> --- a/arch/powerpc/mm/book3s64/hash_utils.c
> +++ b/arch/powerpc/mm/book3s64/hash_utils.c
> @@ -1954,7 +1954,4 @@ void __init print_system_hash_info(void)
>   
>   	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);
>   }
>
Nicholas Piggin May 16, 2019, 6:08 a.m. UTC | #2
Christophe Leroy's on May 16, 2019 2:47 pm:
> 
> 
> Le 16/05/2019 à 04:04, Nicholas Piggin a écrit :
>> Radix boot looks like this:
>> 
>>   -----------------------------------------------------
>>   phys_mem_size     = 0x200000000
>>   dcache_bsize      = 0x80
>>   icache_bsize      = 0x80
>>   cpu_features      = 0x0000c06f8f5fb1a7
>>     possible        = 0x0000fbffcf5fb1a7
>>     always          = 0x00000003800081a1
>>   cpu_user_features = 0xdc0065c2 0xaee00000
>>   mmu_features      = 0xbc006041
>>   firmware_features = 0x0000000010000000
>>   hash-mmu: ppc64_pft_size    = 0x0
>>   hash-mmu: kernel vmalloc start   = 0xc008000000000000
>>   hash-mmu: kernel IO start        = 0xc00a000000000000
>>   hash-mmu: kernel vmemmap start   = 0xc00c000000000000
>>   -----------------------------------------------------
>> 
>> Fix:
>> 
>>   -----------------------------------------------------
>>   phys_mem_size     = 0x200000000
>>   dcache_bsize      = 0x80
>>   icache_bsize      = 0x80
>>   cpu_features      = 0x0000c06f8f5fb1a7
>>     possible        = 0x0000fbffcf5fb1a7
>>     always          = 0x00000003800081a1
>>   cpu_user_features = 0xdc0065c2 0xaee00000
>>   mmu_features      = 0xbc006041
>>   firmware_features = 0x0000000010000000
>>   vmalloc start     = 0xc008000000000000
>>   IO start          = 0xc00a000000000000
>>   vmemmap start     = 0xc00c000000000000
>>   -----------------------------------------------------
>> 
>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> 
> I fear your change defeats most of the purpose of commit 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20190515&id=e4dccf9092ab48a6f902003b9558c0e45d0e849a

I think it's still a significant improvement without introducing
the regression :)

> As far as I understand, the main issue is the "hash-mmu:" prefix ?
> That's due to the following define in top of book3s64/hash_utils.c:
> 
> #define pr_fmt(fmt) "hash-mmu: " fmt
> 
> Could we simply undef it just before print_system_hash_info() ?

Little bit fragile I think.

> Or move print_system_hash_info() in another book3s64 specific file which 
> doesn't set pr_fmt ?

print_system_info() would be okay for me and allow getting rid of
that PPC64 config. Although it also needs to go in a file without
pr_fmt I guess that's not so hard.

Thanks,
Nick
Thiago Jung Bauermann May 17, 2019, 3:18 a.m. UTC | #3
Hello,

Nicholas Piggin <npiggin@gmail.com> writes:

> Christophe Leroy's on May 16, 2019 2:47 pm:
>> 
>> 
>> Le 16/05/2019 à 04:04, Nicholas Piggin a écrit:
>>> Radix boot looks like this:
>>> 
>>>   -----------------------------------------------------
>>>   phys_mem_size     = 0x200000000
>>>   dcache_bsize      = 0x80
>>>   icache_bsize      = 0x80
>>>   cpu_features      = 0x0000c06f8f5fb1a7
>>>     possible        = 0x0000fbffcf5fb1a7
>>>     always          = 0x00000003800081a1
>>>   cpu_user_features = 0xdc0065c2 0xaee00000
>>>   mmu_features      = 0xbc006041
>>>   firmware_features = 0x0000000010000000
>>>   hash-mmu: ppc64_pft_size    = 0x0
>>>   hash-mmu: kernel vmalloc start   = 0xc008000000000000
>>>   hash-mmu: kernel IO start        = 0xc00a000000000000
>>>   hash-mmu: kernel vmemmap start   = 0xc00c000000000000
>>>   -----------------------------------------------------
>>> 
>>> Fix:
>>> 
>>>   -----------------------------------------------------
>>>   phys_mem_size     = 0x200000000
>>>   dcache_bsize      = 0x80
>>>   icache_bsize      = 0x80
>>>   cpu_features      = 0x0000c06f8f5fb1a7
>>>     possible        = 0x0000fbffcf5fb1a7
>>>     always          = 0x00000003800081a1
>>>   cpu_user_features = 0xdc0065c2 0xaee00000
>>>   mmu_features      = 0xbc006041
>>>   firmware_features = 0x0000000010000000
>>>   vmalloc start     = 0xc008000000000000
>>>   IO start          = 0xc00a000000000000
>>>   vmemmap start     = 0xc00c000000000000
>>>   -----------------------------------------------------
>>> 
>>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> 
>> I fear your change defeats most of the purpose of commit 
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20190515&id=e4dccf9092ab48a6f902003b9558c0e45d0e849a
>
> I think it's still a significant improvement without introducing
> the regression :)
>
>> As far as I understand, the main issue is the "hash-mmu:" prefix ?
>> That's due to the following define in top of book3s64/hash_utils.c:
>> 
>> #define pr_fmt(fmt) "hash-mmu: " fmt
>> 
>> Could we simply undef it just before print_system_hash_info() ?
>
> Little bit fragile I think.
>
>> Or move print_system_hash_info() in another book3s64 specific file which 
>> doesn't set pr_fmt ?
>
> print_system_info() would be okay for me and allow getting rid of
> that PPC64 config. Although it also needs to go in a file without
> pr_fmt I guess that's not so hard.

Or it could use printk(KERN_INFO "...") instead of pr_info(), which I
think makes sense if the pr_fmt prefix is undesired.
Michael Ellerman Aug. 10, 2019, 10:20 a.m. UTC | #4
On Thu, 2019-05-16 at 02:04:37 UTC, Nicholas Piggin wrote:
> Radix boot looks like this:
> 
>  -----------------------------------------------------
>  phys_mem_size     = 0x200000000
>  dcache_bsize      = 0x80
>  icache_bsize      = 0x80
>  cpu_features      = 0x0000c06f8f5fb1a7
>    possible        = 0x0000fbffcf5fb1a7
>    always          = 0x00000003800081a1
>  cpu_user_features = 0xdc0065c2 0xaee00000
>  mmu_features      = 0xbc006041
>  firmware_features = 0x0000000010000000
>  hash-mmu: ppc64_pft_size    = 0x0
>  hash-mmu: kernel vmalloc start   = 0xc008000000000000
>  hash-mmu: kernel IO start        = 0xc00a000000000000
>  hash-mmu: kernel vmemmap start   = 0xc00c000000000000
>  -----------------------------------------------------
> 
> Fix:
> 
>  -----------------------------------------------------
>  phys_mem_size     = 0x200000000
>  dcache_bsize      = 0x80
>  icache_bsize      = 0x80
>  cpu_features      = 0x0000c06f8f5fb1a7
>    possible        = 0x0000fbffcf5fb1a7
>    always          = 0x00000003800081a1
>  cpu_user_features = 0xdc0065c2 0xaee00000
>  mmu_features      = 0xbc006041
>  firmware_features = 0x0000000010000000
>  vmalloc start     = 0xc008000000000000
>  IO start          = 0xc00a000000000000
>  vmemmap start     = 0xc00c000000000000
>  -----------------------------------------------------
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a26c29a00f20015a30e618caf7c0720a351e1d03

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index aad9f5df6ab6..f2da8c809c85 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -810,9 +810,15 @@  static __init void print_system_info(void)
 	pr_info("mmu_features      = 0x%08x\n", cur_cpu_spec->mmu_features);
 #ifdef CONFIG_PPC64
 	pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features);
+#ifdef CONFIG_PPC_BOOK3S
+	pr_info("vmalloc start     = 0x%lx\n", KERN_VIRT_START);
+	pr_info("IO start          = 0x%lx\n", KERN_IO_START);
+	pr_info("vmemmap start     = 0x%lx\n", (unsigned long)vmemmap);
+#endif
 #endif
 
-	print_system_hash_info();
+	if (!early_radix_enabled())
+		print_system_hash_info();
 
 	if (PHYSICAL_START > 0)
 		pr_info("physical_start    = 0x%llx\n",
diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c
index 919a861a8ec0..8b307b796b83 100644
--- a/arch/powerpc/mm/book3s64/hash_utils.c
+++ b/arch/powerpc/mm/book3s64/hash_utils.c
@@ -1954,7 +1954,4 @@  void __init print_system_hash_info(void)
 
 	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);
 }