* [PATCH] powerpc/mm: Fix mapped range information print during boot
@ 2017-04-28 14:24 Anshuman Khandual
2017-05-03 9:32 ` Michael Ellerman
0 siblings, 1 reply; 4+ messages in thread
From: Anshuman Khandual @ 2017-04-28 14:24 UTC (permalink / raw)
To: linuxppc-dev; +Cc: aneesh.kumar, mpe
This is a trivial fix patch regarding mapped ranges in radix MMU
environment during boot. No functional change.
Before the patch:
$dmesg | grep Mapped
[ 0.000000] Mapped range 0x0 - 0x2000000000 with 0x40000000
[ 0.000000] Mapped range 0x200000000000 - 0x202000000000 with 0x40000000
After the patch:
$dmesg | grep Mapped
[ 0.000000] Mapped range 0x0000000000000000 - 0x0000002000000000 with 1024 MB
[ 0.000000] Mapped range 0x0000200000000000 - 0x0000202000000000 with 1024 MB
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
arch/powerpc/mm/pgtable-radix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index c28165d..802ead4 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -115,7 +115,8 @@ static inline void __meminit print_mapping(unsigned long start,
if (end <= start)
return;
- pr_info("Mapped range 0x%lx - 0x%lx with 0x%lx\n", start, end, size);
+ pr_info("Mapped range 0x%016lx - 0x%016lx with %lu MB\n",
+ start, end, (unsigned long) (size >> 20));
}
static int __meminit create_physical_mapping(unsigned long start,
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/mm: Fix mapped range information print during boot
2017-04-28 14:24 [PATCH] powerpc/mm: Fix mapped range information print during boot Anshuman Khandual
@ 2017-05-03 9:32 ` Michael Ellerman
2017-05-03 11:06 ` Anshuman Khandual
2017-08-31 11:35 ` Michael Ellerman
0 siblings, 2 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-05-03 9:32 UTC (permalink / raw)
To: Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar
Anshuman Khandual <khandual@linux.vnet.ibm.com> writes:
> This is a trivial fix patch regarding mapped ranges in radix MMU
> environment during boot. No functional change.
>
> Before the patch:
>
> $dmesg | grep Mapped
> [ 0.000000] Mapped range 0x0 - 0x2000000000 with 0x40000000
> [ 0.000000] Mapped range 0x200000000000 - 0x202000000000 with 0x40000000
>
> After the patch:
>
> $dmesg | grep Mapped
> [ 0.000000] Mapped range 0x0000000000000000 - 0x0000002000000000 with 1024 MB
> [ 0.000000] Mapped range 0x0000200000000000 - 0x0000202000000000 with 1024 MB
It's a bit better, how about this instead?
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index c28165d8970b..519cfef569d1 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -8,9 +8,14 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+
+#define pr_fmt(fmt) "radix-mmu: " fmt
+
+#include <linux/kernel.h>
#include <linux/sched/mm.h>
#include <linux/memblock.h>
#include <linux/of_fdt.h>
+#include <linux/string_helpers.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
@@ -112,10 +117,14 @@ static inline void __meminit print_mapping(unsigned long start,
unsigned long end,
unsigned long size)
{
+ char buf[10];
+
if (end <= start)
return;
- pr_info("Mapped range 0x%lx - 0x%lx with 0x%lx\n", start, end, size);
+ string_get_size(size, 1, STRING_UNITS_2, buf, sizeof(buf));
+
+ pr_info("Mapped 0x%016lx-0x%016lx with %s pages\n", start, end, buf);
}
static int __meminit create_physical_mapping(unsigned long start,
cheers
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/mm: Fix mapped range information print during boot
2017-05-03 9:32 ` Michael Ellerman
@ 2017-05-03 11:06 ` Anshuman Khandual
2017-08-31 11:35 ` Michael Ellerman
1 sibling, 0 replies; 4+ messages in thread
From: Anshuman Khandual @ 2017-05-03 11:06 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: aneesh.kumar
On 05/03/2017 03:02 PM, Michael Ellerman wrote:
> Anshuman Khandual <khandual@linux.vnet.ibm.com> writes:
>
>> This is a trivial fix patch regarding mapped ranges in radix MMU
>> environment during boot. No functional change.
>>
>> Before the patch:
>>
>> $dmesg | grep Mapped
>> [ 0.000000] Mapped range 0x0 - 0x2000000000 with 0x40000000
>> [ 0.000000] Mapped range 0x200000000000 - 0x202000000000 with 0x40000000
>>
>> After the patch:
>>
>> $dmesg | grep Mapped
>> [ 0.000000] Mapped range 0x0000000000000000 - 0x0000002000000000 with 1024 MB
>> [ 0.000000] Mapped range 0x0000200000000000 - 0x0000202000000000 with 1024 MB
>
> It's a bit better, how about this instead?
Yeah this is better, I had tried to fix it in place.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: powerpc/mm: Fix mapped range information print during boot
2017-05-03 9:32 ` Michael Ellerman
2017-05-03 11:06 ` Anshuman Khandual
@ 2017-08-31 11:35 ` Michael Ellerman
1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-08-31 11:35 UTC (permalink / raw)
To: Michael Ellerman, Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar
On Wed, 2017-05-03 at 09:32:35 UTC, Michael Ellerman wrote:
> diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
> index c28165d8970b..519cfef569d1 100644
> --- a/arch/powerpc/mm/pgtable-radix.c
> +++ b/arch/powerpc/mm/pgtable-radix.c
> @@ -8,9 +8,14 @@
> * as published by the Free Software Foundation; either version
> * 2 of the License, or (at your option) any later version.
> */
> +
> +#define pr_fmt(fmt) "radix-mmu: " fmt
> +
> +#include <linux/kernel.h>
> #include <linux/sched/mm.h>
> #include <linux/memblock.h>
> #include <linux/of_fdt.h>
> +#include <linux/string_helpers.h>
>
> #include <asm/pgtable.h>
> #include <asm/pgalloc.h>
> @@ -112,10 +117,14 @@ static inline void __meminit print_mapping(unsigned long start,
> unsigned long end,
> unsigned long size)
> {
> + char buf[10];
> +
> if (end <= start)
> return;
>
> - pr_info("Mapped range 0x%lx - 0x%lx with 0x%lx\n", start, end, size);
> + string_get_size(size, 1, STRING_UNITS_2, buf, sizeof(buf));
> +
> + pr_info("Mapped 0x%016lx-0x%016lx with %s pages\n", start, end, buf);
> }
>
> static int __meminit create_physical_mapping(unsigned long start,
Applied to powerpc next.
https://git.kernel.org/powerpc/c/6deb6b474bda4d2d3fbee066f20561
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-31 11:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-28 14:24 [PATCH] powerpc/mm: Fix mapped range information print during boot Anshuman Khandual
2017-05-03 9:32 ` Michael Ellerman
2017-05-03 11:06 ` Anshuman Khandual
2017-08-31 11:35 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).