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: <871qiyfhpe.fsf@all.your.base.are.belong.to.us>
Date:   Tue, 30 May 2023 08:37:17 +0200
From:   Björn Töpel <bjorn@...nel.org>
To:     Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        linux-riscv@...ts.infradead.org
Cc:     Björn Töpel <bjorn@...osinc.com>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux@...osinc.com, Alexandre Ghiti <alexghiti@...osinc.com>,
        Joerg Roedel <joro@...tes.org>
Subject: Re: [PATCH] riscv: mm: Pre-allocate PGD entries vmalloc/modules area

Björn Töpel <bjorn@...nel.org> writes:

> From: Björn Töpel <bjorn@...osinc.com>
>
> The RISC-V port requires that kernel PGD entries are to be
> synchronized between MMs. This is done via the vmalloc_fault()
> function, that simply copies the PGD entries from init_mm to the
> faulting one.
>
> Historically, faulting in PGD entries have been a source for both bugs
> [1], and poor performance.
>
> One way to get rid of vmalloc faults is by pre-allocating the PGD
> entries. Pre-allocating the entries potientially wastes 64 * 4K (65 on
> SV39). The pre-allocation function is pulled from Jörg Rödel's x86
> work, with the addition of 3-level page tables (PMD allocations).
>
> The pmd_alloc() function needs the ptlock cache to be initialized
> (when split page locks is enabled), so the pre-allocation is done in a
> RISC-V specific pgtable_cache_init() implementation.
>
> Pre-allocate the kernel PGD entries for the vmalloc/modules area, but
> only for 64b platforms.
>
> Link: https://lore.kernel.org/lkml/20200508144043.13893-1-joro@8bytes.org/ # [1]
> Signed-off-by: Björn Töpel <bjorn@...osinc.com>

...and the build was bitten by nommu [1]. I'll hold off the v2 a bit, to
see if there's any other comments.


Björn

[1] https://patchwork.kernel.org/project/linux-riscv/patch/20230529180023.289904-1-bjorn@kernel.org/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ