Skip to contentSkip to conversation

powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions

PATCH Applied Nicholas Piggin 3 participants 3 messages May 20, 2017 – May 25, 2017 PowerPC

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc: add PPC_FEATURE userspace bits for SCV and DARN instructions

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.

---
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(-)
arch/powerpc/include/uapi/asm/cputable.h +2 -0
index 3e7ce86d5c13..4d877144f377 100644
@@ -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!
arch/powerpc/kernel/cputable.c +2 -1
index 9b3e88b1a9c8..6f849832a669 100644
@@ -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)
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Nicholas Piggin

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.

Quoted 36 lines

---
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(-)
arch/powerpc/include/uapi/asm/cputable.h +2 -0
index 3e7ce86d5c13..4d877144f377 100644
@@ -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!
arch/powerpc/kernel/cputable.c +2 -1
index 9b3e88b1a9c8..6f849832a669 100644
@@ -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 lore raw
In reply to Nicholas Piggin
Quoted 8 lines · Nicholas Piggin

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.

Applied to powerpc fixes, thanks.

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

cheers