lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210412150817.33f49be8@xhacker.debian>
Date:   Mon, 12 Apr 2021 15:08:17 +0800
From:   Jisheng Zhang <Jisheng.Zhang@...aptics.com>
To:     Jiuyang Liu <liu@...yang.me>
Cc:     Alex Ghiti <alex@...ti.fr>, Palmer Dabbelt <palmer@...belt.com>,
        Andrew Waterman <waterman@...s.berkeley.edu>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] implement flush_cache_vmap for RISC-V

Hi Jiuyang,

On Mon, 12 Apr 2021 00:05:30 +0000 Jiuyang Liu <liu@...yang.me> wrote:


> 
> This patch implements flush_cache_vmap for RISC-V, since it modifies PTE.
> Without this patch, SFENCE.VMA won't be added to related codes, which
> might introduce a bug in the out-of-order micro-architecture
> implementations.
> 
> Signed-off-by: Jiuyang Liu <liu@...yang.me>
> Reviewed-by: Alexandre Ghiti <alex@...ti.fr>
> Reviewed-by: Palmer Dabbelt <palmer@...belt.com>

IIRC, Palmer hasn't given this Reviewed-by tag.

> ---

Could you plz add version and changes? IIRC, this is the v3.

>  arch/riscv/include/asm/cacheflush.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h
> index 23ff70350992..3fd528badc35 100644
> --- a/arch/riscv/include/asm/cacheflush.h
> +++ b/arch/riscv/include/asm/cacheflush.h
> @@ -30,6 +30,12 @@ static inline void flush_dcache_page(struct page *page)
>  #define flush_icache_user_page(vma, pg, addr, len) \
>         flush_icache_mm(vma->vm_mm, 0)
> 
> +/*
> + * flush_cache_vmap is invoked after map_kernel_range() has installed the page
> + * table entries, which modifies PTE, SFENCE.VMA should be inserted.

Just my humble opinion, flush_cache_vmap() may not be necessary. vmalloc_fault
can take care of this, and finally sfence.vma is inserted in related path.

Regards

> + */
> +#define flush_cache_vmap(start, end) flush_tlb_all()
> +
>  #ifndef CONFIG_SMP
> 
>  #define flush_icache_all() local_flush_icache_all()
> --
> 2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ