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]
Date:   Wed, 12 Apr 2023 13:50:32 +0000 (UTC)
From:   Paul Walmsley <paul@...yaka.com>
To:     Evan Green <evan@...osinc.com>
cc:     Palmer Dabbelt <palmer@...osinc.com>, heiko@...ech.de,
        linux-doc@...r.kernel.org,
        Andrew Bresticker <abrestic@...osinc.com>,
        Atish Patra <atishp@...osinc.com>,
        Conor Dooley <conor.dooley@...rochip.com>,
        Celeste Liu <coelacanthus@...look.com>,
        Jisheng Zhang <jszhang@...nel.org>,
        linux-riscv@...ts.infradead.org, Jonathan Corbet <corbet@....net>,
        Andrew Jones <ajones@...tanamicro.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Ley Foon Tan <leyfoon.tan@...rfivetech.com>,
        vineetg@...osinc.com, Philipp Tomsich <philipp.tomsich@...ll.eu>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Heiko Stuebner <heiko.stuebner@...ll.eu>, slewis@...osinc.com,
        Samuel Holland <samuel@...lland.org>,
        linux-kernel@...r.kernel.org, Conor Dooley <conor@...nel.org>,
        Palmer Dabbelt <palmer@...belt.com>,
        Guo Ren <guoren@...nel.org>
Subject: Re: [PATCH v6 4/6] RISC-V: hwprobe: Support probing of misaligned
 access performance

On Fri, 7 Apr 2023, Evan Green wrote:

> This allows userspace to select various routines to use based on the
> performance of misaligned access on the target hardware.
> 
> Rather than adding DT bindings, this change taps into the alternatives
> mechanism used to probe CPU errata. Add a new function pointer alongside
> the vendor-specific errata_patch_func() that probes for desirable errata
> (otherwise known as "features"). Unlike the errata_patch_func(), this
> function is called on each CPU as it comes up, so it can save
> feature information per-CPU.
> 
> The T-head C906 has fast unaligned access, both as defined by GCC [1],
> and in performing a basic benchmark, which determined that byte copies
> are >50% slower than a misaligned word copy of the same data size (source
> for this test at [2]):
> 
> bytecopy size f000 count 50000 offset 0 took 31664899 us
> wordcopy size f000 count 50000 offset 0 took 5180919 us
> wordcopy size f000 count 50000 offset 1 took 13416949 us
> 
> [1] https://github.com/gcc-mirror/gcc/blob/master/gcc/config/riscv/riscv.cc#L353
> [2] https://pastebin.com/EPXvDHSW
> 
> Co-developed-by: Palmer Dabbelt <palmer@...osinc.com>
> Signed-off-by: Palmer Dabbelt <palmer@...osinc.com>
> Signed-off-by: Evan Green <evan@...osinc.com>
> Reviewed-by: Heiko Stuebner <heiko.stuebner@...ll.eu>
> Tested-by: Heiko Stuebner <heiko.stuebner@...ll.eu>

Reviewed-by: Paul Walmsley <paul.walmsley@...ive.com>


- Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ