[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZPoMoVnUjNzr+OXI@ghost>
Date: Thu, 7 Sep 2023 10:47:13 -0700
From: Charlie Jenkins <charlie@...osinc.com>
To: Conor Dooley <conor@...nel.org>
Cc: Palmer Dabbelt <palmer@...belt.com>,
Samuel Holland <samuel.holland@...ive.com>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
Paul Walmsley <paul.walmsley@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>
Subject: Re: [PATCH v2 2/5] riscv: Add checksum library
On Thu, Sep 07, 2023 at 10:52:35AM +0100, Conor Dooley wrote:
> On Tue, Sep 05, 2023 at 09:46:51PM -0700, Charlie Jenkins wrote:
>
> > +#ifdef CONFIG_RISCV_ISA_ZBB
> > + if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) {
> > + /*
> > + * Zbb is likely available when the kernel is compiled with Zbb
> > + * support, so nop when Zbb is available and jump when Zbb is
> > + * not available.
> > + */
> > + asm_volatile_goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0,
> > + RISCV_ISA_EXT_ZBB, 1)
> > + :
> > + :
> > + :
> > + : no_zbb);
> > + } else {
> > + if (!__riscv_isa_extension_available(NULL, RISCV_ISA_EXT_ZBB))
> > + goto no_zbb;
> > + }
>
> Again, do these constructs have an appreciable benefit over doing
> if (!riscv_has_extension_likely(<ZBB>)
> goto no_zbb;
>
> ?
>
> That encaspulates the fallback to a non-alternative mechanism for you,
> in case you had not noticed.
I got caught up in the other patch where I did not want to fall back, so
then in this patch I forgot I could use riscv_has_extension_likely. I will
make the change.
- Charlie
Powered by blists - more mailing lists