On Tue, Nov 17, 2015 at 03:59:12PM +0100, Ard Biesheuvel wrote:
> The definition TTBR_WRITE_THROUGH_NO_ALLOC makes little sense, since
> a) its meaning is unclear in the context of TTBRx, since write through
>    always implies Read-Allocate and no Write-Allocate
> b) its definition equals the definition of TTBR_WRITE_BACK_ALLOC
> 
> So instead, rename it to TTBR_WRITE_THROUGH and update the definition
> to reflect the name.

This is an improvement on existing code, so:
Reviewed-by: Leif Lindholm <leif.lindh...@linaro.org>

...but I would have been just as happy for a patch that deleted the
TTBR_WRITE_THROUGH handling, or just mapped it to uncached.
It doesn't have a valid use-case.

/
    Leif
 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org>
> ---
>  ArmPkg/Include/Chipset/ArmV7Mmu.h      | 2 +-
>  ArmPkg/Library/ArmLib/ArmV7/ArmV7Mmu.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ArmPkg/Include/Chipset/ArmV7Mmu.h 
> b/ArmPkg/Include/Chipset/ArmV7Mmu.h
> index aaa0977205fa..4cd35bd0e36e 100644
> --- a/ArmPkg/Include/Chipset/ArmV7Mmu.h
> +++ b/ArmPkg/Include/Chipset/ArmV7Mmu.h
> @@ -29,7 +29,7 @@
>  #define TTBR_RGN_INNER_WRITE_THROUGH         BIT0
>  #define TTBR_RGN_INNER_WRITE_BACK_NO_ALLOC   (BIT0|BIT6)
>  
> -#define TTBR_WRITE_THROUGH_NO_ALLOC     ( TTBR_RGN_OUTER_WRITE_BACK_ALLOC | 
> TTBR_RGN_INNER_WRITE_BACK_ALLOC )
> +#define TTBR_WRITE_THROUGH              ( TTBR_RGN_OUTER_WRITE_THROUGH | 
> TTBR_RGN_INNER_WRITE_THROUGH )
>  #define TTBR_WRITE_BACK_NO_ALLOC        ( TTBR_RGN_OUTER_WRITE_BACK_NO_ALLOC 
> | TTBR_RGN_INNER_WRITE_BACK_NO_ALLOC )
>  #define TTBR_NON_CACHEABLE              ( TTBR_RGN_OUTER_NON_CACHEABLE | 
> TTBR_RGN_INNER_NON_CACHEABLE )
>  #define TTBR_WRITE_BACK_ALLOC           ( TTBR_RGN_OUTER_WRITE_BACK_ALLOC | 
> TTBR_RGN_INNER_WRITE_BACK_ALLOC )
> diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Mmu.c 
> b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Mmu.c
> index 1287dfb1a9bb..2bfbd9172a74 100644
> --- a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Mmu.c
> +++ b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Mmu.c
> @@ -259,7 +259,7 @@ ArmConfigureMmu (
>      TTBRAttributes = TTBR_WRITE_BACK_ALLOC;
>    } else if ((TranslationTableAttribute == 
> ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH) ||
>        (TranslationTableAttribute == 
> ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH)) {
> -    TTBRAttributes = TTBR_WRITE_THROUGH_NO_ALLOC;
> +    TTBRAttributes = TTBR_WRITE_THROUGH;
>    } else {
>      ASSERT (0); // No support has been found for the attributes of the 
> memory region that the translation table belongs to.
>      return RETURN_UNSUPPORTED;
> -- 
> 1.9.1
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to