Re: [PATCH 06/10] ARC: [plat-eznps] Fix TLB Errata

From: Alexey Brodkin
Date: Thu May 25 2017 - 07:01:08 EST


Hi Noam,

On Thu, 2017-05-25 at 05:34 +0300, Noam Camus wrote:
> From: Noam Camus <noamca@xxxxxxxxxxxx>
>
> Due to a HW bug in NPS400 we get from time to time false TLB miss.
> Workaround this by validating each miss.
>
> Signed-off-by: Noam Camus <noamca@xxxxxxxxxxxx>
> ---
> Âarch/arc/mm/tlbex.S |ÂÂÂ10 ++++++++++
> Â1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S
> index b30e4e3..1d48723 100644
> --- a/arch/arc/mm/tlbex.S
> +++ b/arch/arc/mm/tlbex.S
> @@ -274,6 +274,13 @@ ex_saved_reg1:
> Â.macro COMMIT_ENTRY_TO_MMU
> Â#if (CONFIG_ARC_MMU_VER < 4)
> Â
> +#ifdef CONFIG_EZNPS_MTM_EXT
> + /* verify if entry for this vaddr+ASID already exists */
> + srÂÂÂÂTLBProbe, [ARC_REG_TLBCOMMAND]
> + lrÂÂÂÂr0, [ARC_REG_TLBINDEX]
> + bbit0 r0, 31, 88f
> +#endif

That's funny. I think we used to have something like that in the past.


> Â /* Get free TLB slot: Set = computed from vaddr, way = random */
> Â srÂÂTLBGetIndex, [ARC_REG_TLBCOMMAND]
> Â
> @@ -287,6 +294,9 @@ ex_saved_reg1:
> Â#else
> Â sr TLBInsertEntry, [ARC_REG_TLBCOMMAND]
> Â#endif
> +#ifdef CONFIG_EZNPS_MTM_EXT
> +88:
> +#endif

Not sure if label itself required wrapping in ifdefs. It just makes code bulkier
and harder to read.

-Alexey