diff mbox series

[-next,3/4] kselftest/arm64: add pmull feature to hwcap test

Message ID 20230814021747.1784812-4-zengheng4@huawei.com (mailing list archive)
State New
Headers show
Series kselftest/arm64: Add crypto-related feature checks to hwcap test | expand

Commit Message

Zeng Heng Aug. 14, 2023, 2:17 a.m. UTC
Add the pmull feature check in the set of hwcap tests.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 tools/testing/selftests/arm64/abi/hwcap.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Mark Brown Aug. 14, 2023, 4:38 p.m. UTC | #1
On Mon, Aug 14, 2023 at 10:17:46AM +0800, Zeng Heng wrote:

>  	asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0");
> @@ -359,6 +365,13 @@ static const struct hwcap_data {
>  		.cpuinfo = "rng",
>  		.sigill_fn = rng_sigill,
>  	},
> +	{
> +		.name = "PMULL",
> +		.at_hwcap = AT_HWCAP,
> +		.hwcap_bit = HWCAP_PMULL,
> +		.cpuinfo = "pmull",
> +		.sigill_fn = pmull_sigill,
> +	},

Please keep the table alphabatically sorted - the function is in the
right place but this seems to have got reordered.
Zeng Heng Aug. 15, 2023, 3:57 a.m. UTC | #2
在 2023/8/15 0:38, Mark Brown 写道:
> On Mon, Aug 14, 2023 at 10:17:46AM +0800, Zeng Heng wrote:
>
>>   	asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0");
>> @@ -359,6 +365,13 @@ static const struct hwcap_data {
>>   		.cpuinfo = "rng",
>>   		.sigill_fn = rng_sigill,
>>   	},
>> +	{
>> +		.name = "PMULL",
>> +		.at_hwcap = AT_HWCAP,
>> +		.hwcap_bit = HWCAP_PMULL,
>> +		.cpuinfo = "pmull",
>> +		.sigill_fn = pmull_sigill,
>> +	},
> Please keep the table alphabatically sorted - the function is in the
> right place but this seems to have got reordered.

Oops, sorry for that. I would update v2 and resend with your reviewed 
tag soon.

Thanks for your review.


Zeng Heng
diff mbox series

Patch

diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
index d9a49b1467ac..c8444f25e52d 100644
--- a/tools/testing/selftests/arm64/abi/hwcap.c
+++ b/tools/testing/selftests/arm64/abi/hwcap.c
@@ -88,6 +88,12 @@  static void mops_sigill(void)
 		     : "cc", "memory");
 }
 
+static void pmull_sigill(void)
+{
+	/* PMULL V0.1Q, V0.1D, V0.1D */
+	asm volatile(".inst 0x0ee0e000" : : : );
+}
+
 static void rng_sigill(void)
 {
 	asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0");
@@ -359,6 +365,13 @@  static const struct hwcap_data {
 		.cpuinfo = "rng",
 		.sigill_fn = rng_sigill,
 	},
+	{
+		.name = "PMULL",
+		.at_hwcap = AT_HWCAP,
+		.hwcap_bit = HWCAP_PMULL,
+		.cpuinfo = "pmull",
+		.sigill_fn = pmull_sigill,
+	},
 	{
 		.name = "RPRFM",
 		.at_hwcap = AT_HWCAP2,