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] [day] [month] [year] [list]
Message-ID: <ZWS8VYwpsKoc56fV@xhacker>
Date:   Mon, 27 Nov 2023 23:57:09 +0800
From:   Jisheng Zhang <jszhang@...nel.org>
To:     Conor Dooley <conor.dooley@...rochip.com>
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: Use asm-generic for {read,write}{bwlq} and their
 relaxed variant

On Mon, Nov 27, 2023 at 10:39:16AM +0000, Conor Dooley wrote:
> On Thu, Nov 23, 2023 at 10:20:03PM +0800, Jisheng Zhang wrote:
> > The asm-generic implementation is functionally identical to the riscv
> > version.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@...nel.org>
> 
> This fails to build for nommu:
>   /tmp/tmp.ojumpiEgOt/arch/riscv/include/asm/timex.h:20:16: error: implicit declaration of function 'readq_relaxed' [-Werror=implicit-function-declaration]
>   /tmp/tmp.ojumpiEgOt/include/asm-generic/io.h:342:23: error: conflicting types for 'readq_relaxed'; have 'u64(const volatile void *)' {aka 'long long unsigned int(const volatile void *)'}
> 
>   Cheers,
>   Conor.

Hi,

Thanks for the report. I can reproduce the build error locally.
The problem is readl_relaxed usage in timex.h.

If include <asm/io.h> in timex.h, then we will meet issues which is
fixed by commit 0c3ac289.

If not include <asm/io.h>, then the readl_relaxed readq_relaxed
are not explictly declared as reported here.

I have two solutions:

solA: use __raw_readl and __raw_readq in timex, since I found other
architectures use the raw asm instructions for get_cycles()

solB: remove clint_time_val and export a function in timer-clint.c as below:
get_clint_cycles()
{
	readl_relaxed(clint_time_val);
}

then
#define get_cycles get_clint_cycles

Both solutions can solve the issues. which one is better?

Thanks in advance

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ