[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2v9EiNR40x/cCQm@arm.com>
Date: Wed, 9 Nov 2022 19:18:42 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Anshuman Khandual <anshuman.khandual@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
will@...nel.org, Suzuki K Poulose <suzuki.poulose@....com>,
James Morse <james.morse@....com>,
Jonathan Corbet <corbet@....net>,
Mark Rutland <mark.rutland@....com>, linux-doc@...r.kernel.org
Subject: Re: [PATCH 2/2] arm64: errata: Workaround possible Cortex-A715
[ESR|FAR]_ELx corruption
On Thu, Oct 27, 2022 at 08:09:15AM +0530, Anshuman Khandual wrote:
> +#define __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
> +static inline pte_t ptep_modify_prot_start(struct vm_area_struct *vma,
> + unsigned long addr,
> + pte_t *ptep)
> +{
> + pte_t pte = ptep_get_and_clear(vma->vm_mm, addr, ptep);
>
> + if (IS_ENABLED(CONFIG_ARM64_WORKAROUND_2645198)) {
> + /*
> + * Break-before-make (BBM) is required for all user space mappings
> + * when the permission changes from executable to non-executable
> + * in cases where cpu is affected with errata #2645198.
> + */
> + if (pte_user_exec(pte) && cpus_have_const_cap(ARM64_WORKAROUND_2645198))
> + __flush_tlb_range(vma, addr, addr + PAGE_SIZE, PAGE_SIZE, false, 3);
Why not flush_tlb_page() here?
But more importantly, can we not use ptep_clear_flush() instead (and
huge_ptep_clear_flush())? They return the pte and do the TLBI.
--
Catalin
Powered by blists - more mailing lists