[U-Boot] [PATCH 1/6] armv8/cache: Fix page table creation

FengHua fenghua at phytium.com.cn
Tue Mar 24 15:52:49 CET 2015




> -----Original Messages-----
> From: "Thierry Reding" <thierry.reding at gmail.com>
> Sent Time: 2015-03-20 19:47:48 (Friday)
> To: u-boot at lists.denx.de
> Cc: "Marc Zyngier" <marc.zyngier at arm.com>
> Subject: [U-Boot] [PATCH 1/6] armv8/cache: Fix page table creation
> 
> From: Thierry Reding <treding at nvidia.com>
> 
> While generating the page tables, a running integer index is shifted by
> SECTION_SHIFT (29) and causes overflow for any integer bigger than 7.
> The page tables therefore alias to the same 8 sections and cause U-Boot
> to hang once the MMU is enabled.
> 
> Fix this by making the index a 64-bit unsigned integer and so avoid the
> overflow.
> 
Acked-by: david.feng <fenghua at phytium.com.cn>

> Cc: Albert Aribaud <albert.u.boot at aribaud.net>
> Cc: Marc Zyngier <marc.zyngier at arm.com>
> Signed-off-by: Thierry Reding <treding at nvidia.com>
> ---
>  arch/arm/cpu/armv8/cache_v8.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
> index c5ec5297cd39..254a629a3b8c 100644
> --- a/arch/arm/cpu/armv8/cache_v8.c
> +++ b/arch/arm/cpu/armv8/cache_v8.c
> @@ -25,9 +25,9 @@ void set_pgtable_section(u64 *page_table, u64 index, u64 section,
>  /* to activate the MMU we need to set up virtual memory */
>  static void mmu_setup(void)
>  {
> -	int i, j, el;
>  	bd_t *bd = gd->bd;
> -	u64 *page_table = (u64 *)gd->arch.tlb_addr;
> +	u64 *page_table = (u64 *)gd->arch.tlb_addr, i, j;
> +	int el;
>  
>  	/* Setup an identity-mapping for all spaces */
>  	for (i = 0; i < (PGTABLE_SIZE >> 3); i++) {
> -- 
> 2.3.2
> 
A previous patch did the same work, but got no reply.

Yours.








More information about the U-Boot mailing list