lkml.org 
[lkml]   [2017]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one()
On Wed, Aug 09, 2017 at 02:07:49PM -0600, Tycho Andersen wrote:
> From: Juerg Haefliger <juerg.haefliger@hpe.com>
>
> Add a hook for flushing a single TLB entry on arm64.
>
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> Tested-by: Tycho Andersen <tycho@docker.com>
> ---
> arch/arm64/include/asm/tlbflush.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h
> index af1c76981911..8e0c49105d3e 100644
> --- a/arch/arm64/include/asm/tlbflush.h
> +++ b/arch/arm64/include/asm/tlbflush.h
> @@ -184,6 +184,14 @@ static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end
> isb();
> }
>
> +static inline void __flush_tlb_one(unsigned long addr)
> +{
> + dsb(ishst);
> + __tlbi(vaae1is, addr >> 12);
> + dsb(ish);
> + isb();
> +}

Is this going to be called by generic code?

It would be nice if we could drop 'kernel' into the name, to make it clear this
is intended to affect the kernel mappings, which have different maintenance
requirements to user mappings.

We should be able to implement this more simply as:

flush_tlb_kernel_page(unsigned long addr)
{
flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
}

Thanks,
Mark.

\
 
 \ /
  Last update: 2017-08-12 13:27    [W:0.276 / U:6.704 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site