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: <CAAfSe-vMGzJOwnTyo-O6WKZmHLY=FMBEVde6h=j52W+cSOwSaw@mail.gmail.com>
Date: Thu, 17 Jul 2025 11:16:59 +0800
From: Chunyan Zhang <zhang.lyra@...il.com>
To: Alexandre Ghiti <alex@...ti.fr>
Cc: Chunyan Zhang <zhangchunyan@...as.ac.cn>, Paul Walmsley <paul.walmsley@...ive.com>, 
	Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>, 
	Charlie Jenkins <charlie@...osinc.com>, Song Liu <song@...nel.org>, Yu Kuai <yukuai3@...wei.com>, 
	linux-riscv@...ts.infradead.org, linux-raid@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 3/5] raid6: riscv: Add a compiler error

Hi Alex,

On Wed, 16 Jul 2025 at 21:43, Alexandre Ghiti <alex@...ti.fr> wrote:
>
> First, the patch title should be something like:

Yeah, I've also recognized the phrase is not right when rereading
after the patch was sent.

>
> "raid6: riscv: Prevent compiler with vector support to build already
> vectorized code"
>
> Or something similar.
>
> On 7/11/25 12:09, Chunyan Zhang wrote:
> > The code like "u8 **dptr = (u8 **)ptrs" just won't work when built with
>
>
> Why wouldn't this code ^ work?

I actually didn't quite get this compiler issue ^_^||

>
> I guess preventing the compiler to vectorize the code is to avoid the
> inline assembly code to break what the compiler could have vectorized no?
>

This states the issue clearly, I will cook a new patchset.

Thanks for the review,
Chunyan

>
> > a compiler that can use vector instructions. So add an error for that.
> >
> > Signed-off-by: Chunyan Zhang <zhangchunyan@...as.ac.cn>
> > ---
> >   lib/raid6/rvv.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/raid6/rvv.c b/lib/raid6/rvv.c
> > index 89da5fc247aa..015f3ee4da25 100644
> > --- a/lib/raid6/rvv.c
> > +++ b/lib/raid6/rvv.c
> > @@ -20,6 +20,10 @@ static int rvv_has_vector(void)
> >       return has_vector();
> >   }
> >
> > +#ifdef __riscv_vector
> > +#error "This code must be built without compiler support for vector"
> > +#endif
> > +
> >   static void raid6_rvv1_gen_syndrome_real(int disks, unsigned long bytes, void **ptrs)
> >   {
> >       u8 **dptr = (u8 **)ptrs;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ