[PATCH] powerpc/mm/radix: Update Radix tree size as per ISA 3.0
Balbir Singh
bsingharora at gmail.com
Thu Jun 16 15:10:59 AEST 2016
On 16/06/16 13:21, Aneesh Kumar K.V wrote:
> ISA 3.0 updated it to be encoded as Radix tree size = 2^(RTS + 31). We
> have it encoded as 2^(RTS + 28). Add a helper with the correct encoding
> and use it instead of opencoding.
>
> Fixes commit 2bfd65e45e87 ("powerpc/mm/radix: Add radix callbacks for
> early init routine ")
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
> ---
> arch/powerpc/include/asm/book3s/64/radix.h | 15 +++++++++++++++
> arch/powerpc/mm/mmu_context_book3s64.c | 2 +-
> arch/powerpc/mm/pgtable-radix.c | 9 +++------
> 3 files changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
> index 0d980de55c40..cdf791af8ab2 100644
> --- a/arch/powerpc/include/asm/book3s/64/radix.h
> +++ b/arch/powerpc/include/asm/book3s/64/radix.h
> @@ -260,5 +260,20 @@ extern void radix__vmemmap_remove_mapping(unsigned long start,
>
> extern int radix__map_kernel_page(unsigned long ea, unsigned long pa,
> pgprot_t flags, unsigned int psz);
> +
> +static inline unsigned long radix__get_rts_value(void)
How about radix__get_tree_size()?
> +{
> + unsigned long rts_field;
> + /*
> + * we support 52 bits, hence 52-31 = 21, 0b10101
> + * RTS encoding details
> + * bits 0 - 3 of rts -> bits 6 - 8 unsigned long
> + * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long
> + */
> + rts_field = (0x5UL << 5); /* 6 - 8 bits */
> + rts_field |= (0x2UL << 61);
> +
> + return rts_field;
> +}
Looks good otherwise
Reviewed-by: Balbir Singh <bsingharora at gmail.com>
More information about the Linuxppc-dev
mailing list