diff mbox

[v3,1/5] powerpc/mm: set the radix linear page mapping size

Message ID 1481831443-22761-2-git-send-email-arbab@linux.vnet.ibm.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Reza Arbab Dec. 15, 2016, 7:50 p.m. UTC
This was defaulting to 4K, regardless of PAGE_SIZE.

Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
---
 arch/powerpc/mm/pgtable-radix.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Aneesh Kumar K.V Dec. 19, 2016, 8:58 a.m. UTC | #1
Reza Arbab <arbab@linux.vnet.ibm.com> writes:

> This was defaulting to 4K, regardless of PAGE_SIZE.
>
> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
> ---
>  arch/powerpc/mm/pgtable-radix.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
> index 623a0dc..54bd70e 100644
> --- a/arch/powerpc/mm/pgtable-radix.c
> +++ b/arch/powerpc/mm/pgtable-radix.c
> @@ -351,8 +351,10 @@ void __init radix__early_init_mmu(void)
>  #ifdef CONFIG_PPC_64K_PAGES
>  	/* PAGE_SIZE mappings */
>  	mmu_virtual_psize = MMU_PAGE_64K;
> +	mmu_linear_psize = MMU_PAGE_64K;

That is not clearly correct, we map the linear address with either 64K,
2M or 1G depending on the memory available. Take a look at
static void __init radix_init_pgtable(void)


>  #else
>  	mmu_virtual_psize = MMU_PAGE_4K;
> +	mmu_linear_psize = MMU_PAGE_4K;
>  #endif
>
>  #ifdef CONFIG_SPARSEMEM_VMEMMAP
> -- 
> 1.8.3.1
Benjamin Herrenschmidt Dec. 19, 2016, 8:53 p.m. UTC | #2
On Mon, 2016-12-19 at 14:28 +0530, Aneesh Kumar K.V wrote:
> Reza Arbab <arbab@linux.vnet.ibm.com> writes:
> 
> > This was defaulting to 4K, regardless of PAGE_SIZE.
> > 
> > Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
> > ---
> >  arch/powerpc/mm/pgtable-radix.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/powerpc/mm/pgtable-radix.c
> > b/arch/powerpc/mm/pgtable-radix.c
> > index 623a0dc..54bd70e 100644
> > --- a/arch/powerpc/mm/pgtable-radix.c
> > +++ b/arch/powerpc/mm/pgtable-radix.c
> > @@ -351,8 +351,10 @@ void __init radix__early_init_mmu(void)
> >  #ifdef CONFIG_PPC_64K_PAGES
> >  	/* PAGE_SIZE mappings */
> >  	mmu_virtual_psize = MMU_PAGE_64K;
> > +	mmu_linear_psize = MMU_PAGE_64K;
> 
> That is not clearly correct, we map the linear address with either
> 64K,
> 2M or 1G depending on the memory available. Take a look at
> static void __init radix_init_pgtable(void)
> 

So should we fix that initialization regardless or take it out ?
> 
> >  #else
> >  	mmu_virtual_psize = MMU_PAGE_4K;
> > +	mmu_linear_psize = MMU_PAGE_4K;
> >  #endif
> > 
> >  #ifdef CONFIG_SPARSEMEM_VMEMMAP
> > -- 
> > 1.8.3.1
Aneesh Kumar K.V Dec. 20, 2016, 2:02 a.m. UTC | #3
Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:

> On Mon, 2016-12-19 at 14:28 +0530, Aneesh Kumar K.V wrote:
>> Reza Arbab <arbab@linux.vnet.ibm.com> writes:
>> 
>> > This was defaulting to 4K, regardless of PAGE_SIZE.
>> > 
>> > Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
>> > ---
>> >  arch/powerpc/mm/pgtable-radix.c | 2 ++
>> >  1 file changed, 2 insertions(+)
>> > 
>> > diff --git a/arch/powerpc/mm/pgtable-radix.c
>> > b/arch/powerpc/mm/pgtable-radix.c
>> > index 623a0dc..54bd70e 100644
>> > --- a/arch/powerpc/mm/pgtable-radix.c
>> > +++ b/arch/powerpc/mm/pgtable-radix.c
>> > @@ -351,8 +351,10 @@ void __init radix__early_init_mmu(void)
>> >  #ifdef CONFIG_PPC_64K_PAGES
>> >  	/* PAGE_SIZE mappings */
>> >  	mmu_virtual_psize = MMU_PAGE_64K;
>> > +	mmu_linear_psize = MMU_PAGE_64K;
>> 
>> That is not clearly correct, we map the linear address with either
>> 64K,
>> 2M or 1G depending on the memory available. Take a look at
>> static void __init radix_init_pgtable(void)
>> 
>
> So should we fix that initialization regardless or take it out ?

We should not be usuing mmu_linear_psize on radix. Hence we can skip
that initialization.

-aneesh
diff mbox

Patch

diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 623a0dc..54bd70e 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -351,8 +351,10 @@  void __init radix__early_init_mmu(void)
 #ifdef CONFIG_PPC_64K_PAGES
 	/* PAGE_SIZE mappings */
 	mmu_virtual_psize = MMU_PAGE_64K;
+	mmu_linear_psize = MMU_PAGE_64K;
 #else
 	mmu_virtual_psize = MMU_PAGE_4K;
+	mmu_linear_psize = MMU_PAGE_4K;
 #endif
 
 #ifdef CONFIG_SPARSEMEM_VMEMMAP