diff mbox series

[v2] kselftest/arm64: add RCpc load-acquire to hwcap test

Message ID 20230803133905.971697-1-zengheng4@huawei.com (mailing list archive)
State New, archived
Headers show
Series [v2] kselftest/arm64: add RCpc load-acquire to hwcap test | expand

Commit Message

Zeng Heng Aug. 3, 2023, 1:39 p.m. UTC
Add the RCpc and various features check in the set of hwcap tests.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
v1 -> v2:
 - sort features by name

 tools/testing/selftests/arm64/abi/hwcap.c | 26 +++++++++++++++++++++++
 1 file changed, 26 insertions(+)

--
2.25.1

Comments

Mark Brown Aug. 3, 2023, 1:58 p.m. UTC | #1
On Thu, Aug 03, 2023 at 09:39:05PM +0800, Zeng Heng wrote:
> Add the RCpc and various features check in the set of hwcap tests.
> 
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>

Reviewed-by: Mark Brown <broonie@kernel.org>

Instruction encoding verified with binutils.
Will Deacon Aug. 4, 2023, 6:10 p.m. UTC | #2
On Thu, 3 Aug 2023 21:39:05 +0800, Zeng Heng wrote:
> Add the RCpc and various features check in the set of hwcap tests.
> 
> 

Applied to arm64 (for-next/selftests), thanks!

[1/1] kselftest/arm64: add RCpc load-acquire to hwcap test
      https://git.kernel.org/arm64/c/d1890517ac75

Cheers,
diff mbox series

Patch

diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
index d4ad813fed10..6a0adf916028 100644
--- a/tools/testing/selftests/arm64/abi/hwcap.c
+++ b/tools/testing/selftests/arm64/abi/hwcap.c
@@ -39,6 +39,18 @@  static void cssc_sigill(void)
 	asm volatile(".inst 0xdac01c00" : : : "x0");
 }

+static void ilrcpc_sigill(void)
+{
+	/* LDAPUR W0, [SP, #8] */
+	asm volatile(".inst 0x994083e0" : : : );
+}
+
+static void lrcpc_sigill(void)
+{
+	/* LDAPR W0, [SP, #0] */
+	asm volatile(".inst 0xb8bfc3e0" : : : );
+}
+
 static void mops_sigill(void)
 {
 	char dst[1], src[1];
@@ -223,6 +235,20 @@  static const struct hwcap_data {
 		.cpuinfo = "cssc",
 		.sigill_fn = cssc_sigill,
 	},
+	{
+		.name = "LRCPC",
+		.at_hwcap = AT_HWCAP,
+		.hwcap_bit = HWCAP_LRCPC,
+		.cpuinfo = "lrcpc",
+		.sigill_fn = lrcpc_sigill,
+	},
+	{
+		.name = "LRCPC2",
+		.at_hwcap = AT_HWCAP,
+		.hwcap_bit = HWCAP_ILRCPC,
+		.cpuinfo = "ilrcpc",
+		.sigill_fn = ilrcpc_sigill,
+	},
 	{
 		.name = "MOPS",
 		.at_hwcap = AT_HWCAP2,