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: <20230912-shakiness-denture-69165e10017b@spud>
Date:   Tue, 12 Sep 2023 17:04:59 +0100
From:   Conor Dooley <conor@...nel.org>
To:     Jisheng Zhang <jszhang@...nel.org>
Cc:     Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: don't probe unaligned access speed if already done

On Tue, Sep 12, 2023 at 11:40:40PM +0800, Jisheng Zhang wrote:
> If misaligned_access_speed percpu var isn't so called "HWPROBE
> MISALIGNED UNKNOWN", it means the probe has happened(this is possible
> for example, hotplug off then hotplug on one cpu), and the percpu var
> has been set, don't probe again in this case.
> 
> Signed-off-by: Jisheng Zhang <jszhang@...nel.org>

Presumably this should grow a
Fixes: 584ea6564bca ("RISC-V: Probe for unaligned access speed")
on application.
Patch seems fine to me,
Reviewed-by: Conor Dooley <conor.dooley@...rochip.com>

Thanks,
Conor.

> ---
>  arch/riscv/kernel/cpufeature.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index 1cfbba65d11a..e12cd22755c7 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -568,6 +568,10 @@ void check_unaligned_access(int cpu)
>  	void *src;
>  	long speed = RISCV_HWPROBE_MISALIGNED_SLOW;
>  
> +	/* We are already set since the last check */
> +	if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_UNKNOWN)
> +		return;
> +
>  	page = alloc_pages(GFP_NOWAIT, get_order(MISALIGNED_BUFFER_SIZE));
>  	if (!page) {
>  		pr_warn("Can't alloc pages to measure memcpy performance");
> -- 
> 2.40.1
> 

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ