All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions
@ 2017-05-20  4:29 Nicholas Piggin
  2017-05-21 22:14 ` Benjamin Herrenschmidt
  2017-05-25 13:22 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Piggin @ 2017-05-20  4:29 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Nicholas Piggin, tuliom, Michael Ellerman, benh, Peter Bergner,
	Michael Neuling, Steve Munroe, Bill Schmidt

Providing "scv" support to userspace requires kernel support, so it
must be advertised as independently to the base ISA 3 instruction set.

The darn instruction relies on firmware enablement, so it has been
decided to split this out from the core ISA 3 feature as well.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
These uapi changes have been agreed by powerpc toolchain and firmware
teams. I believe this completes our anticipated requirements for user
feature advertisement for ISA v3.0B.

 arch/powerpc/include/uapi/asm/cputable.h | 2 ++
 arch/powerpc/kernel/cputable.c           | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/uapi/asm/cputable.h b/arch/powerpc/include/uapi/asm/cputable.h
index 3e7ce86d5c13..4d877144f377 100644
--- a/arch/powerpc/include/uapi/asm/cputable.h
+++ b/arch/powerpc/include/uapi/asm/cputable.h
@@ -46,6 +46,8 @@
 #define PPC_FEATURE2_HTM_NOSC		0x01000000
 #define PPC_FEATURE2_ARCH_3_00		0x00800000 /* ISA 3.00 */
 #define PPC_FEATURE2_HAS_IEEE128	0x00400000 /* VSX IEEE Binary Float 128-bit */
+#define PPC_FEATURE2_DARN		0x00200000 /* darn random number insn */
+#define PPC_FEATURE2_SCV		0x00100000 /* scv syscall */
 
 /*
  * IMPORTANT!
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 9b3e88b1a9c8..6f849832a669 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -124,7 +124,8 @@ extern void __restore_cpu_e6500(void);
 #define COMMON_USER_POWER9	COMMON_USER_POWER8
 #define COMMON_USER2_POWER9	(COMMON_USER2_POWER8 | \
 				 PPC_FEATURE2_ARCH_3_00 | \
-				 PPC_FEATURE2_HAS_IEEE128)
+				 PPC_FEATURE2_HAS_IEEE128 | \
+				 PPC_FEATURE2_DARN )
 
 #ifdef CONFIG_PPC_BOOK3E_64
 #define COMMON_USER_BOOKE	(COMMON_USER_PPC64 | PPC_FEATURE_BOOKE)
-- 
2.11.0

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

* Re: [PATCH] powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions
  2017-05-20  4:29 [PATCH] powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions Nicholas Piggin
@ 2017-05-21 22:14 ` Benjamin Herrenschmidt
  2017-05-25 13:22 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2017-05-21 22:14 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev
  Cc: benh, tuliom, Steve Munroe, Bill Schmidt, Peter Bergner, Michael Neuling

On Sat, 2017-05-20 at 14:29 +1000, Nicholas Piggin wrote:
> Providing "scv" support to userspace requires kernel support, so it
> must be advertised as independently to the base ISA 3 instruction set.
> 
> The darn instruction relies on firmware enablement, so it has been
> decided to split this out from the core ISA 3 feature as well.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
> These uapi changes have been agreed by powerpc toolchain and firmware
> teams. I believe this completes our anticipated requirements for user
> feature advertisement for ISA v3.0B.
> 
>  arch/powerpc/include/uapi/asm/cputable.h | 2 ++
>  arch/powerpc/kernel/cputable.c           | 3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/uapi/asm/cputable.h b/arch/powerpc/include/uapi/asm/cputable.h
> index 3e7ce86d5c13..4d877144f377 100644
> --- a/arch/powerpc/include/uapi/asm/cputable.h
> +++ b/arch/powerpc/include/uapi/asm/cputable.h
> @@ -46,6 +46,8 @@
>  #define PPC_FEATURE2_HTM_NOSC		0x01000000
>  #define PPC_FEATURE2_ARCH_3_00		0x00800000 /* ISA 3.00 */
>  #define PPC_FEATURE2_HAS_IEEE128	0x00400000 /* VSX IEEE Binary Float 128-bit */
> +#define PPC_FEATURE2_DARN		0x00200000 /* darn random number insn */
> +#define PPC_FEATURE2_SCV		0x00100000 /* scv syscall */
>  
>  /*
>   * IMPORTANT!
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index 9b3e88b1a9c8..6f849832a669 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -124,7 +124,8 @@ extern void __restore_cpu_e6500(void);
>  #define COMMON_USER_POWER9	COMMON_USER_POWER8
>  #define COMMON_USER2_POWER9	(COMMON_USER2_POWER8 | \
>  				 PPC_FEATURE2_ARCH_3_00 | \
> -				 PPC_FEATURE2_HAS_IEEE128)
> +				 PPC_FEATURE2_HAS_IEEE128 | \
> +				 PPC_FEATURE2_DARN )
>  
>  #ifdef CONFIG_PPC_BOOK3E_64
>  #define COMMON_USER_BOOKE	(COMMON_USER_PPC64 | PPC_FEATURE_BOOKE)

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

* Re: powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions
  2017-05-20  4:29 [PATCH] powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions Nicholas Piggin
  2017-05-21 22:14 ` Benjamin Herrenschmidt
@ 2017-05-25 13:22 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-05-25 13:22 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev
  Cc: benh, tuliom, Steve Munroe, Nicholas Piggin, Bill Schmidt,
	Peter Bergner, Michael Neuling

On Sat, 2017-05-20 at 04:29:49 UTC, Nicholas Piggin wrote:
> Providing "scv" support to userspace requires kernel support, so it
> must be advertised as independently to the base ISA 3 instruction set.
> 
> The darn instruction relies on firmware enablement, so it has been
> decided to split this out from the core ISA 3 feature as well.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/a4700a26107241cc7b9ac8528b2c67

cheers

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

end of thread, other threads:[~2017-05-25 13:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-20  4:29 [PATCH] powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions Nicholas Piggin
2017-05-21 22:14 ` Benjamin Herrenschmidt
2017-05-25 13:22 ` Michael Ellerman

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.