[RFT 1/2] RISC-V: handle missing "no-map" properties for OpenSBI's PMP protected regions

Conor Dooley conor.dooley at microchip.com
Wed Aug 9 04:04:14 PDT 2023


On Wed, Aug 09, 2023 at 10:24:57AM +0000, JeeHeng Sia wrote:
> 
> 
> > -----Original Message-----
> > From: Conor Dooley <conor at kernel.org>
> > Sent: Tuesday, August 8, 2023 9:13 PM
> > To: JeeHeng Sia <jeeheng.sia at starfivetech.com>
> > Cc: Conor Dooley <conor.dooley at microchip.com>; palmer at dabbelt.com; Paul Walmsley <paul.walmsley at sifive.com>; Atish Patra
> > <atishp at rivosinc.com>; Anup Patel <apatel at ventanamicro.com>; Alexandre Ghiti <alexghiti at rivosinc.com>; Björn Töpel
> > <bjorn at rivosinc.com>; Song Shuai <suagrfillet at gmail.com>; Petr Tesarik <petrtesarik at huaweicloud.com>; linux-
> > riscv at lists.infradead.org; linux-kernel at vger.kernel.org; stable at vger.kernel.org
> > Subject: Re: [RFT 1/2] RISC-V: handle missing "no-map" properties for OpenSBI's PMP protected regions
> > 
> > On Mon, Aug 07, 2023 at 12:44:07AM +0000, JeeHeng Sia wrote:
> > 
> > > > +/* SBI implementation IDs */
> > > > +#define SBI_IMP_OPENSBI	1
> > > I would suggest to create an enum struct for the SBI Imp ID in
> > > the sbi.h file. What do you think?
> > 
> > I'm not really sure what the advantage of doing so is.
> The macro SBI_IMP_OPENSBI seems weird (I would read it as "SBI Implementation OpenSBI").

That is what it is though, so I don't see what's weird about that.

> However, if we implement an enum struct for SBI_IMP_ID

> (There are numerous IDs available),

Ohh I know, but I didn't see the point adding those when I was only
focusing on a single implementation.

> the macro can be abbreviated to OpenSBI. By doing this, the conditional
> checking of the implementation ID would be more readable, as shown below:
> if (sbi_firmware_id != OPENSBI)

I don't see that it can become that simple, it'd still need to be
prefixed with SBI_ to be consistent with any other SBI related enum, and
at that point adding the extra IMP_ makes little odds.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230809/470b1f46/attachment.sig>


More information about the linux-riscv mailing list