All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: add base extensions to enum riscv_isa_ext_id
@ 2022-12-22 22:41 Vineet Gupta
  2022-12-22 22:53 ` Conor Dooley
  0 siblings, 1 reply; 7+ messages in thread
From: Vineet Gupta @ 2022-12-22 22:41 UTC (permalink / raw)
  To: linux-riscv; +Cc: linux, Vineet Gupta

This allows for using the enum in general to refer to any extension.

Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
---
 arch/riscv/include/asm/hwcap.h | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
index b22525290073..b861e711e3ac 100644
--- a/arch/riscv/include/asm/hwcap.h
+++ b/arch/riscv/include/asm/hwcap.h
@@ -26,16 +26,6 @@ enum {
 
 extern unsigned long elf_hwcap;
 
-#define RISCV_ISA_EXT_a		('a' - 'a')
-#define RISCV_ISA_EXT_c		('c' - 'a')
-#define RISCV_ISA_EXT_d		('d' - 'a')
-#define RISCV_ISA_EXT_f		('f' - 'a')
-#define RISCV_ISA_EXT_h		('h' - 'a')
-#define RISCV_ISA_EXT_i		('i' - 'a')
-#define RISCV_ISA_EXT_m		('m' - 'a')
-#define RISCV_ISA_EXT_s		('s' - 'a')
-#define RISCV_ISA_EXT_u		('u' - 'a')
-
 /*
  * Increse this to higher value as kernel support more ISA extensions.
  */
@@ -53,6 +43,15 @@ extern unsigned long elf_hwcap;
  * available logical extension id.
  */
 enum riscv_isa_ext_id {
+	RISCV_ISA_EXT_a = ('a' - 'a'),
+	RISCV_ISA_EXT_c = ('c' - 'a'),
+	RISCV_ISA_EXT_d = ('d' - 'a'),
+	RISCV_ISA_EXT_f = ('f' - 'a'),
+	RISCV_ISA_EXT_h = ('h' - 'a'),
+	RISCV_ISA_EXT_i = ('i' - 'a'),
+	RISCV_ISA_EXT_m = ('m' - 'a'),
+	RISCV_ISA_EXT_s = ('s' - 'a'),
+	RISCV_ISA_EXT_u = ('u' - 'a'),
 	RISCV_ISA_EXT_SSCOFPMF = RISCV_ISA_EXT_BASE,
 	RISCV_ISA_EXT_SVPBMT,
 	RISCV_ISA_EXT_ZICBOM,
-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] riscv: add base extensions to enum riscv_isa_ext_id
  2022-12-22 22:41 [PATCH] riscv: add base extensions to enum riscv_isa_ext_id Vineet Gupta
@ 2022-12-22 22:53 ` Conor Dooley
  2022-12-22 23:01   ` Conor Dooley
  2022-12-22 23:13   ` Vineet Gupta
  0 siblings, 2 replies; 7+ messages in thread
From: Conor Dooley @ 2022-12-22 22:53 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: linux-riscv, linux


[-- Attachment #1.1: Type: text/plain, Size: 2337 bytes --]

Hi Vineet,

On Thu, Dec 22, 2022 at 02:41:04PM -0800, Vineet Gupta wrote:
> This allows for using the enum in general to refer to any extension.

What is the point of this patch? It's hard to understand the rationale
without having any user, especially...

> 
> Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
> ---
>  arch/riscv/include/asm/hwcap.h | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
> index b22525290073..b861e711e3ac 100644
> --- a/arch/riscv/include/asm/hwcap.h
> +++ b/arch/riscv/include/asm/hwcap.h
> @@ -26,16 +26,6 @@ enum {
>  
>  extern unsigned long elf_hwcap;
>  
> -#define RISCV_ISA_EXT_a		('a' - 'a')
> -#define RISCV_ISA_EXT_c		('c' - 'a')
> -#define RISCV_ISA_EXT_d		('d' - 'a')
> -#define RISCV_ISA_EXT_f		('f' - 'a')
> -#define RISCV_ISA_EXT_h		('h' - 'a')
> -#define RISCV_ISA_EXT_i		('i' - 'a')
> -#define RISCV_ISA_EXT_m		('m' - 'a')
> -#define RISCV_ISA_EXT_s		('s' - 'a')
> -#define RISCV_ISA_EXT_u		('u' - 'a')
> -
>  /*
>   * Increse this to higher value as kernel support more ISA extensions.
>   */
> @@ -53,6 +43,15 @@ extern unsigned long elf_hwcap;
>   * available logical extension id.
>   */
>  enum riscv_isa_ext_id {
> +	RISCV_ISA_EXT_a = ('a' - 'a'),
> +	RISCV_ISA_EXT_c = ('c' - 'a'),
> +	RISCV_ISA_EXT_d = ('d' - 'a'),
> +	RISCV_ISA_EXT_f = ('f' - 'a'),
> +	RISCV_ISA_EXT_h = ('h' - 'a'),
> +	RISCV_ISA_EXT_i = ('i' - 'a'),
> +	RISCV_ISA_EXT_m = ('m' - 'a'),
> +	RISCV_ISA_EXT_s = ('s' - 'a'),
> +	RISCV_ISA_EXT_u = ('u' - 'a'),

... as it is diametrically opposed to another patchset which deletes
this enum, with a rationale.
https://lore.kernel.org/linux-riscv/20221204174632.3677-5-jszhang@kernel.org/

+CC Jisheng.

Also, please run get_maintainer.pl, there's a bunch of people touching
this area at the moment & CCing them would be great.

Thanks,
Conor.

btw, is the rivos list intentionally on CC?

>  	RISCV_ISA_EXT_SSCOFPMF = RISCV_ISA_EXT_BASE,
>  	RISCV_ISA_EXT_SVPBMT,
>  	RISCV_ISA_EXT_ZICBOM,
> -- 
> 2.34.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] riscv: add base extensions to enum riscv_isa_ext_id
  2022-12-22 22:53 ` Conor Dooley
@ 2022-12-22 23:01   ` Conor Dooley
  2022-12-22 23:13   ` Vineet Gupta
  1 sibling, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2022-12-22 23:01 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: linux-riscv, linux, Jisheng Zhang


[-- Attachment #1.1: Type: text/plain, Size: 2596 bytes --]

I got distracted, actually +CC Jisheng..

On Thu, Dec 22, 2022 at 10:53:59PM +0000, Conor Dooley wrote:
> Hi Vineet,
> 
> On Thu, Dec 22, 2022 at 02:41:04PM -0800, Vineet Gupta wrote:
> > This allows for using the enum in general to refer to any extension.
> 
> What is the point of this patch? It's hard to understand the rationale
> without having any user, especially...
> 
> > 
> > Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
> > ---
> >  arch/riscv/include/asm/hwcap.h | 19 +++++++++----------
> >  1 file changed, 9 insertions(+), 10 deletions(-)
> > 
> > diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
> > index b22525290073..b861e711e3ac 100644
> > --- a/arch/riscv/include/asm/hwcap.h
> > +++ b/arch/riscv/include/asm/hwcap.h
> > @@ -26,16 +26,6 @@ enum {
> >  
> >  extern unsigned long elf_hwcap;
> >  
> > -#define RISCV_ISA_EXT_a		('a' - 'a')
> > -#define RISCV_ISA_EXT_c		('c' - 'a')
> > -#define RISCV_ISA_EXT_d		('d' - 'a')
> > -#define RISCV_ISA_EXT_f		('f' - 'a')
> > -#define RISCV_ISA_EXT_h		('h' - 'a')
> > -#define RISCV_ISA_EXT_i		('i' - 'a')
> > -#define RISCV_ISA_EXT_m		('m' - 'a')
> > -#define RISCV_ISA_EXT_s		('s' - 'a')
> > -#define RISCV_ISA_EXT_u		('u' - 'a')
> > -
> >  /*
> >   * Increse this to higher value as kernel support more ISA extensions.
> >   */
> > @@ -53,6 +43,15 @@ extern unsigned long elf_hwcap;
> >   * available logical extension id.
> >   */
> >  enum riscv_isa_ext_id {
> > +	RISCV_ISA_EXT_a = ('a' - 'a'),
> > +	RISCV_ISA_EXT_c = ('c' - 'a'),
> > +	RISCV_ISA_EXT_d = ('d' - 'a'),
> > +	RISCV_ISA_EXT_f = ('f' - 'a'),
> > +	RISCV_ISA_EXT_h = ('h' - 'a'),
> > +	RISCV_ISA_EXT_i = ('i' - 'a'),
> > +	RISCV_ISA_EXT_m = ('m' - 'a'),
> > +	RISCV_ISA_EXT_s = ('s' - 'a'),
> > +	RISCV_ISA_EXT_u = ('u' - 'a'),
> 
> ... as it is diametrically opposed to another patchset which deletes
> this enum, with a rationale.
> https://lore.kernel.org/linux-riscv/20221204174632.3677-5-jszhang@kernel.org/
> 
> +CC Jisheng.
> 
> Also, please run get_maintainer.pl, there's a bunch of people touching
> this area at the moment & CCing them would be great.
> 
> Thanks,
> Conor.
> 
> btw, is the rivos list intentionally on CC?
> 
> >  	RISCV_ISA_EXT_SSCOFPMF = RISCV_ISA_EXT_BASE,
> >  	RISCV_ISA_EXT_SVPBMT,
> >  	RISCV_ISA_EXT_ZICBOM,
> > -- 
> > 2.34.1
> > 
> > 
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv



[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] riscv: add base extensions to enum riscv_isa_ext_id
  2022-12-22 22:53 ` Conor Dooley
  2022-12-22 23:01   ` Conor Dooley
@ 2022-12-22 23:13   ` Vineet Gupta
  2022-12-22 23:35     ` Conor Dooley
  1 sibling, 1 reply; 7+ messages in thread
From: Vineet Gupta @ 2022-12-22 23:13 UTC (permalink / raw)
  To: Conor Dooley; +Cc: linux-riscv, linux, Jisheng Zhang



On 12/22/22 14:53, Conor Dooley wrote:
> Hi Vineet,
>
> On Thu, Dec 22, 2022 at 02:41:04PM -0800, Vineet Gupta wrote:
>> This allows for using the enum in general to refer to any extension.
> What is the point of this patch? It's hard to understand the rationale
> without having any user, especially...

Right I'm trying to build a cpu feature enable API which required 
handling of all extensions.
Ideally yes this needs to go there. But it seemed more like a cleanup 
type patch to warrant a standalone submission.
But I guess I can wait for dust to settle.


>
>> +	RISCV_ISA_EXT_s = ('s' - 'a'),
>> +	RISCV_ISA_EXT_u = ('u' - 'a'),
> ... as it is diametrically opposed to another patchset which deletes
> this enum, with a rationale.
> https://lore.kernel.org/linux-riscv/20221204174632.3677-5-jszhang@kernel.org/
>
> +CC Jisheng.
>
> Also, please run get_maintainer.pl, there's a bunch of people touching
> this area at the moment & CCing them would be great.

Ok sure.

> Thanks,
> Conor.
>
> btw, is the rivos list intentionally on CC?

Yep.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] riscv: add base extensions to enum riscv_isa_ext_id
  2022-12-22 23:13   ` Vineet Gupta
@ 2022-12-22 23:35     ` Conor Dooley
  2022-12-23  0:03       ` Vineet Gupta
  0 siblings, 1 reply; 7+ messages in thread
From: Conor Dooley @ 2022-12-22 23:35 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: linux-riscv, linux, Jisheng Zhang


[-- Attachment #1.1: Type: text/plain, Size: 826 bytes --]

On Thu, Dec 22, 2022 at 03:13:56PM -0800, Vineet Gupta wrote:
> 
> 
> On 12/22/22 14:53, Conor Dooley wrote:
> > Hi Vineet,
> > 
> > On Thu, Dec 22, 2022 at 02:41:04PM -0800, Vineet Gupta wrote:
> > > This allows for using the enum in general to refer to any extension.
> > What is the point of this patch? It's hard to understand the rationale
> > without having any user, especially...
> 
> Right I'm trying to build a cpu feature enable API which required handling
> of all extensions.

Does it matter to you if it's defines or an enum, as long as every
extension is exposed to you via the same mechanism?

> Ideally yes this needs to go there. But it seemed more like a cleanup type
> patch to warrant a standalone submission.

Meh, dw. Not expecting people to know about every patch under the sun.


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] riscv: add base extensions to enum riscv_isa_ext_id
  2022-12-22 23:35     ` Conor Dooley
@ 2022-12-23  0:03       ` Vineet Gupta
  2022-12-23  0:30         ` Conor Dooley
  0 siblings, 1 reply; 7+ messages in thread
From: Vineet Gupta @ 2022-12-23  0:03 UTC (permalink / raw)
  To: Conor Dooley; +Cc: linux-riscv, linux, Jisheng Zhang



On 12/22/22 15:35, Conor Dooley wrote:
> On Thu, Dec 22, 2022 at 03:13:56PM -0800, Vineet Gupta wrote:
>>
>> On 12/22/22 14:53, Conor Dooley wrote:
>>> Hi Vineet,
>>>
>>> On Thu, Dec 22, 2022 at 02:41:04PM -0800, Vineet Gupta wrote:
>>>> This allows for using the enum in general to refer to any extension.
>>> What is the point of this patch? It's hard to understand the rationale
>>> without having any user, especially...
>> Right I'm trying to build a cpu feature enable API which required handling
>> of all extensions.
> Does it matter to you if it's defines or an enum, as long as every
> extension is exposed to you via the same mechanism?

No, I just went with what v6.1 release code base had.

>
>> Ideally yes this needs to go there. But it seemed more like a cleanup type
>> patch to warrant a standalone submission.
> Meh, dw. Not expecting people to know about every patch under the sun.

No this patch doesn't require people to know what series it facilitates 
since IMO it is a trivial cleanup - fixing 2 disparate ways of defining 
extensions.
And as I said it is not urgent, specially with other changes in flight.

Thx,
-Vineet

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] riscv: add base extensions to enum riscv_isa_ext_id
  2022-12-23  0:03       ` Vineet Gupta
@ 2022-12-23  0:30         ` Conor Dooley
  0 siblings, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2022-12-23  0:30 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: linux-riscv, linux, Jisheng Zhang



On 23 December 2022 00:03:18 GMT, Vineet Gupta <vineetg@rivosinc.com> wrote:
>
>
>On 12/22/22 15:35, Conor Dooley wrote:
>> On Thu, Dec 22, 2022 at 03:13:56PM -0800, Vineet Gupta wrote:
>>> 
>>> On 12/22/22 14:53, Conor Dooley wrote:
>>>> Hi Vineet,
>>>> 
>>>> On Thu, Dec 22, 2022 at 02:41:04PM -0800, Vineet Gupta wrote:
>>>>> This allows for using the enum in general to refer to any extension.
>>>> What is the point of this patch? It's hard to understand the rationale
>>>> without having any user, especially...
>>> Right I'm trying to build a cpu feature enable API which required handling
>>> of all extensions.
>> Does it matter to you if it's defines or an enum, as long as every
>> extension is exposed to you via the same mechanism?
>
>No, I just went with what v6.1 release code base had.
>
>> 
>>> Ideally yes this needs to go there. But it seemed more like a cleanup type
>>> patch to warrant a standalone submission.
>> Meh, dw. Not expecting people to know about every patch under the sun.
>
>No this patch doesn't require people to know what series it facilitates since IMO it is a trivial cleanup - fixing 2 disparate ways of defining extensions.

I meant it's not a problem that you weren't aware of what the other series is doing.

>And as I said it is not urgent, specially with other changes in flight.
>
>Thx,
>-Vineet

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-23  0:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-22 22:41 [PATCH] riscv: add base extensions to enum riscv_isa_ext_id Vineet Gupta
2022-12-22 22:53 ` Conor Dooley
2022-12-22 23:01   ` Conor Dooley
2022-12-22 23:13   ` Vineet Gupta
2022-12-22 23:35     ` Conor Dooley
2022-12-23  0:03       ` Vineet Gupta
2022-12-23  0:30         ` Conor Dooley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.