All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-17 12:08 ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

This series fixes up a few issues introduced into vec-syscfg during
refactoring in the review process, then adds a new test which ensures
that the behaviour when we attempt to set a vector length which is not
supported by the current system matches what is documented in the SVE
ABI documentation.

v2:
 - Fix handling of missing VLs when checking that vector length setting
   works as expected.

Mark Brown (4):
  selftests: arm64: Fix printf() format mismatch in vec-syscfg
  selftests: arm64: Remove bogus error check on writing to files
  selftests: arm64: Fix and enable test for setting current VL in
    vec-syscfg
  selftests: arm64: Verify that all possible vector lengths are handled

 tools/testing/selftests/arm64/fp/vec-syscfg.c | 89 ++++++++++++++++---
 1 file changed, 76 insertions(+), 13 deletions(-)


base-commit: 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
-- 
2.20.1


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

* [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-17 12:08 ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

This series fixes up a few issues introduced into vec-syscfg during
refactoring in the review process, then adds a new test which ensures
that the behaviour when we attempt to set a vector length which is not
supported by the current system matches what is documented in the SVE
ABI documentation.

v2:
 - Fix handling of missing VLs when checking that vector length setting
   works as expected.

Mark Brown (4):
  selftests: arm64: Fix printf() format mismatch in vec-syscfg
  selftests: arm64: Remove bogus error check on writing to files
  selftests: arm64: Fix and enable test for setting current VL in
    vec-syscfg
  selftests: arm64: Verify that all possible vector lengths are handled

 tools/testing/selftests/arm64/fp/vec-syscfg.c | 89 ++++++++++++++++---
 1 file changed, 76 insertions(+), 13 deletions(-)


base-commit: 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
-- 
2.20.1


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

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

* [PATCH v2 1/4] selftests: arm64: Fix printf() format mismatch in vec-syscfg
  2021-09-17 12:08 ` Mark Brown
@ 2021-09-17 12:08   ` Mark Brown
  -1 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

The format for this error message calls for the plain text version of the
error but we weren't supply it.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index c02071dcb563..b2de002ee325 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -109,7 +109,7 @@ static int get_child_rdvl(struct vec_data *data)
 
 		/* exec() a new binary which puts the VL on stdout */
 		ret = execl(data->rdvl_binary, data->rdvl_binary, NULL);
-		fprintf(stderr, "execl(%s) failed: %d\n",
+		fprintf(stderr, "execl(%s) failed: %d (%s)\n",
 			data->rdvl_binary, errno, strerror(errno));
 
 		exit(EXIT_FAILURE);
-- 
2.20.1


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

* [PATCH v2 1/4] selftests: arm64: Fix printf() format mismatch in vec-syscfg
@ 2021-09-17 12:08   ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

The format for this error message calls for the plain text version of the
error but we weren't supply it.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index c02071dcb563..b2de002ee325 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -109,7 +109,7 @@ static int get_child_rdvl(struct vec_data *data)
 
 		/* exec() a new binary which puts the VL on stdout */
 		ret = execl(data->rdvl_binary, data->rdvl_binary, NULL);
-		fprintf(stderr, "execl(%s) failed: %d\n",
+		fprintf(stderr, "execl(%s) failed: %d (%s)\n",
 			data->rdvl_binary, errno, strerror(errno));
 
 		exit(EXIT_FAILURE);
-- 
2.20.1


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

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

* [PATCH v2 2/4] selftests: arm64: Remove bogus error check on writing to files
  2021-09-17 12:08 ` Mark Brown
@ 2021-09-17 12:08   ` Mark Brown
  -1 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

Due to some refactoring with the error handling we ended up mangling things
so we never actually set ret and therefore shouldn't be checking it.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index b2de002ee325..d48d3ee1bc36 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -180,7 +180,6 @@ static int file_read_integer(const char *name, int *val)
 static int file_write_integer(const char *name, int val)
 {
 	FILE *f;
-	int ret;
 
 	f = fopen(name, "w");
 	if (!f) {
@@ -192,11 +191,6 @@ static int file_write_integer(const char *name, int val)
 
 	fprintf(f, "%d", val);
 	fclose(f);
-	if (ret < 0) {
-		ksft_test_result_fail("Error writing %d to %s\n",
-				      val, name);
-		return -1;
-	}
 
 	return 0;
 }
-- 
2.20.1


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

* [PATCH v2 2/4] selftests: arm64: Remove bogus error check on writing to files
@ 2021-09-17 12:08   ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

Due to some refactoring with the error handling we ended up mangling things
so we never actually set ret and therefore shouldn't be checking it.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index b2de002ee325..d48d3ee1bc36 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -180,7 +180,6 @@ static int file_read_integer(const char *name, int *val)
 static int file_write_integer(const char *name, int val)
 {
 	FILE *f;
-	int ret;
 
 	f = fopen(name, "w");
 	if (!f) {
@@ -192,11 +191,6 @@ static int file_write_integer(const char *name, int val)
 
 	fprintf(f, "%d", val);
 	fclose(f);
-	if (ret < 0) {
-		ksft_test_result_fail("Error writing %d to %s\n",
-				      val, name);
-		return -1;
-	}
 
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 3/4] selftests: arm64: Fix and enable test for setting current VL in vec-syscfg
  2021-09-17 12:08 ` Mark Brown
@ 2021-09-17 12:08   ` Mark Brown
  -1 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

We had some test code for verifying that we can write the current VL via
the prctl() interface but the condition for the test was inverted which
wasn't noticed as it was never actually hooked up to the array of tests
we execute. Fix this.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index d48d3ee1bc36..9d6ac843e651 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -329,12 +329,9 @@ static void prctl_set_same(struct vec_data *data)
 		return;
 	}
 
-	if (cur_vl != data->rdvl())
-		ksft_test_result_pass("%s current VL is %d\n",
-				      data->name, ret);
-	else
-		ksft_test_result_fail("%s prctl() VL %d but RDVL is %d\n",
-				      data->name, ret, data->rdvl());
+	ksft_test_result(cur_vl == data->rdvl(),
+			 "%s set VL %d and have VL %d\n",
+			 data->name, cur_vl, data->rdvl());
 }
 
 /* Can we set a new VL for this process? */
@@ -555,6 +552,7 @@ static const test_type tests[] = {
 	proc_write_max,
 
 	prctl_get,
+	prctl_set_same,
 	prctl_set,
 	prctl_set_no_child,
 	prctl_set_for_child,
-- 
2.20.1


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

* [PATCH v2 3/4] selftests: arm64: Fix and enable test for setting current VL in vec-syscfg
@ 2021-09-17 12:08   ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

We had some test code for verifying that we can write the current VL via
the prctl() interface but the condition for the test was inverted which
wasn't noticed as it was never actually hooked up to the array of tests
we execute. Fix this.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index d48d3ee1bc36..9d6ac843e651 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -329,12 +329,9 @@ static void prctl_set_same(struct vec_data *data)
 		return;
 	}
 
-	if (cur_vl != data->rdvl())
-		ksft_test_result_pass("%s current VL is %d\n",
-				      data->name, ret);
-	else
-		ksft_test_result_fail("%s prctl() VL %d but RDVL is %d\n",
-				      data->name, ret, data->rdvl());
+	ksft_test_result(cur_vl == data->rdvl(),
+			 "%s set VL %d and have VL %d\n",
+			 data->name, cur_vl, data->rdvl());
 }
 
 /* Can we set a new VL for this process? */
@@ -555,6 +552,7 @@ static const test_type tests[] = {
 	proc_write_max,
 
 	prctl_get,
+	prctl_set_same,
 	prctl_set,
 	prctl_set_no_child,
 	prctl_set_for_child,
-- 
2.20.1


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

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

* [PATCH v2 4/4] selftests: arm64: Verify that all possible vector lengths are handled
  2021-09-17 12:08 ` Mark Brown
@ 2021-09-17 12:08   ` Mark Brown
  -1 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

As part of the enumeration interface for setting vector lengths it is valid
to set vector lengths not supported in the system, these will be rounded to
a supported vector length and returned from the prctl(). Add a test which
exercises this for every valid vector length and makes sure that the return
value is as expected and that this is reflected in the actual system state.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index 9d6ac843e651..de11cd2f5d79 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -540,6 +540,76 @@ static void prctl_set_onexec(struct vec_data *data)
 	file_write_integer(data->default_vl_file, data->default_vl);
 }
 
+/* For each VQ verify that setting via prctl() does the right thing */
+static void prctl_set_all_vqs(struct vec_data *data)
+{
+	int ret, vq, vl, new_vl;
+	int errors = 0;
+
+	for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
+		vl = sve_vl_from_vq(vq);
+
+		/* Attempt to set the VL */
+		ret = prctl(data->prctl_set, vl);
+		if (ret < 0) {
+			errors++;
+			ksft_print_msg("%s prctl set failed for %d: %d (%s)\n",
+				       data->name, vl,
+				       errno, strerror(errno));
+			continue;
+		}
+
+		new_vl = ret & PR_SVE_VL_LEN_MASK;
+
+		/* Check that we actually have the reported new VL */
+		if (data->rdvl() != new_vl) {
+			ksft_print_msg("Set %s VL %d but RDVL reports %d\n",
+				       data->name, new_vl, data->rdvl());
+			errors++;
+		}
+
+		/* Was that the VL we asked for? */
+		if (new_vl == vl)
+			continue;
+
+		/* Should round up to the minimum VL if below it */
+		if (vl < data->min_vl) {
+			if (new_vl != data->min_vl) {
+				ksft_print_msg("%s VL %d returned %d not minimum %d\n",
+					       data->name, vl, new_vl,
+					       data->min_vl);
+				errors++;
+			}
+
+			continue;
+		}
+
+		/* Should round down to maximum VL if above it */
+		if (vl > data->max_vl) {
+			if (new_vl != data->max_vl) {
+				ksft_print_msg("%s VL %d returned %d not maximum %d\n",
+					       data->name, vl, new_vl,
+					       data->max_vl);
+				errors++;
+			}
+
+			continue;
+		}
+
+		/* Otherwise we should've rounded down */
+		if (!(new_vl < vl)) {
+			ksft_print_msg("%s VL %d returned %d, did not round down\n",
+				       data->name, vl, new_vl);
+			errors++;
+
+			continue;
+		}
+	}
+
+	ksft_test_result(errors == 0, "%s prctl() set all VLs, %d errors\n",
+			 data->name, errors);
+}
+
 typedef void (*test_type)(struct vec_data *);
 
 static const test_type tests[] = {
@@ -557,6 +627,7 @@ static const test_type tests[] = {
 	prctl_set_no_child,
 	prctl_set_for_child,
 	prctl_set_onexec,
+	prctl_set_all_vqs,
 };
 
 int main(void)
-- 
2.20.1


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

* [PATCH v2 4/4] selftests: arm64: Verify that all possible vector lengths are handled
@ 2021-09-17 12:08   ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-17 12:08 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, misono.tomohiro, Mark Brown

As part of the enumeration interface for setting vector lengths it is valid
to set vector lengths not supported in the system, these will be rounded to
a supported vector length and returned from the prctl(). Add a test which
exercises this for every valid vector length and makes sure that the return
value is as expected and that this is reflected in the actual system state.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/vec-syscfg.c | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c b/tools/testing/selftests/arm64/fp/vec-syscfg.c
index 9d6ac843e651..de11cd2f5d79 100644
--- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
+++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
@@ -540,6 +540,76 @@ static void prctl_set_onexec(struct vec_data *data)
 	file_write_integer(data->default_vl_file, data->default_vl);
 }
 
+/* For each VQ verify that setting via prctl() does the right thing */
+static void prctl_set_all_vqs(struct vec_data *data)
+{
+	int ret, vq, vl, new_vl;
+	int errors = 0;
+
+	for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
+		vl = sve_vl_from_vq(vq);
+
+		/* Attempt to set the VL */
+		ret = prctl(data->prctl_set, vl);
+		if (ret < 0) {
+			errors++;
+			ksft_print_msg("%s prctl set failed for %d: %d (%s)\n",
+				       data->name, vl,
+				       errno, strerror(errno));
+			continue;
+		}
+
+		new_vl = ret & PR_SVE_VL_LEN_MASK;
+
+		/* Check that we actually have the reported new VL */
+		if (data->rdvl() != new_vl) {
+			ksft_print_msg("Set %s VL %d but RDVL reports %d\n",
+				       data->name, new_vl, data->rdvl());
+			errors++;
+		}
+
+		/* Was that the VL we asked for? */
+		if (new_vl == vl)
+			continue;
+
+		/* Should round up to the minimum VL if below it */
+		if (vl < data->min_vl) {
+			if (new_vl != data->min_vl) {
+				ksft_print_msg("%s VL %d returned %d not minimum %d\n",
+					       data->name, vl, new_vl,
+					       data->min_vl);
+				errors++;
+			}
+
+			continue;
+		}
+
+		/* Should round down to maximum VL if above it */
+		if (vl > data->max_vl) {
+			if (new_vl != data->max_vl) {
+				ksft_print_msg("%s VL %d returned %d not maximum %d\n",
+					       data->name, vl, new_vl,
+					       data->max_vl);
+				errors++;
+			}
+
+			continue;
+		}
+
+		/* Otherwise we should've rounded down */
+		if (!(new_vl < vl)) {
+			ksft_print_msg("%s VL %d returned %d, did not round down\n",
+				       data->name, vl, new_vl);
+			errors++;
+
+			continue;
+		}
+	}
+
+	ksft_test_result(errors == 0, "%s prctl() set all VLs, %d errors\n",
+			 data->name, errors);
+}
+
 typedef void (*test_type)(struct vec_data *);
 
 static const test_type tests[] = {
@@ -557,6 +627,7 @@ static const test_type tests[] = {
 	prctl_set_no_child,
 	prctl_set_for_child,
 	prctl_set_onexec,
+	prctl_set_all_vqs,
 };
 
 int main(void)
-- 
2.20.1


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

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

* RE: [PATCH v2 4/4] selftests: arm64: Verify that all possible vector lengths are handled
  2021-09-17 12:08   ` Mark Brown
@ 2021-09-17 12:26     ` misono.tomohiro
  -1 siblings, 0 replies; 26+ messages in thread
From: misono.tomohiro @ 2021-09-17 12:26 UTC (permalink / raw)
  To: 'Mark Brown',
	Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest

Reviewed-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>

Thanks,
Misono

> Subject: [PATCH v2 4/4] selftests: arm64: Verify that all possible vector lengths
> are handled
> 
> As part of the enumeration interface for setting vector lengths it is valid
> to set vector lengths not supported in the system, these will be rounded to
> a supported vector length and returned from the prctl(). Add a test which
> exercises this for every valid vector length and makes sure that the return
> value is as expected and that this is reflected in the actual system state.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  tools/testing/selftests/arm64/fp/vec-syscfg.c | 71
> +++++++++++++++++++
>  1 file changed, 71 insertions(+)
> 
> diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c
> b/tools/testing/selftests/arm64/fp/vec-syscfg.c
> index 9d6ac843e651..de11cd2f5d79 100644
> --- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
> +++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
> @@ -540,6 +540,76 @@ static void prctl_set_onexec(struct vec_data *data)
>  	file_write_integer(data->default_vl_file, data->default_vl);
>  }
> 
> +/* For each VQ verify that setting via prctl() does the right thing */
> +static void prctl_set_all_vqs(struct vec_data *data)
> +{
> +	int ret, vq, vl, new_vl;
> +	int errors = 0;
> +
> +	for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
> +		vl = sve_vl_from_vq(vq);
> +
> +		/* Attempt to set the VL */
> +		ret = prctl(data->prctl_set, vl);
> +		if (ret < 0) {
> +			errors++;
> +			ksft_print_msg("%s prctl set failed for %d: %d
> (%s)\n",
> +				       data->name, vl,
> +				       errno, strerror(errno));
> +			continue;
> +		}
> +
> +		new_vl = ret & PR_SVE_VL_LEN_MASK;
> +
> +		/* Check that we actually have the reported new VL */
> +		if (data->rdvl() != new_vl) {
> +			ksft_print_msg("Set %s VL %d but RDVL
> reports %d\n",
> +				       data->name, new_vl, data->rdvl());
> +			errors++;
> +		}
> +
> +		/* Was that the VL we asked for? */
> +		if (new_vl == vl)
> +			continue;
> +
> +		/* Should round up to the minimum VL if below it */
> +		if (vl < data->min_vl) {
> +			if (new_vl != data->min_vl) {
> +				ksft_print_msg("%s VL %d returned %d not
> minimum %d\n",
> +					       data->name, vl, new_vl,
> +					       data->min_vl);
> +				errors++;
> +			}
> +
> +			continue;
> +		}
> +
> +		/* Should round down to maximum VL if above it */
> +		if (vl > data->max_vl) {
> +			if (new_vl != data->max_vl) {
> +				ksft_print_msg("%s VL %d returned %d not
> maximum %d\n",
> +					       data->name, vl, new_vl,
> +					       data->max_vl);
> +				errors++;
> +			}
> +
> +			continue;
> +		}
> +
> +		/* Otherwise we should've rounded down */
> +		if (!(new_vl < vl)) {
> +			ksft_print_msg("%s VL %d returned %d, did not round
> down\n",
> +				       data->name, vl, new_vl);
> +			errors++;
> +
> +			continue;
> +		}
> +	}
> +
> +	ksft_test_result(errors == 0, "%s prctl() set all VLs, %d errors\n",
> +			 data->name, errors);
> +}
> +
>  typedef void (*test_type)(struct vec_data *);
> 
>  static const test_type tests[] = {
> @@ -557,6 +627,7 @@ static const test_type tests[] = {
>  	prctl_set_no_child,
>  	prctl_set_for_child,
>  	prctl_set_onexec,
> +	prctl_set_all_vqs,
>  };
> 
>  int main(void)
> --
> 2.20.1


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

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

* RE: [PATCH v2 4/4] selftests: arm64: Verify that all possible vector lengths are handled
@ 2021-09-17 12:26     ` misono.tomohiro
  0 siblings, 0 replies; 26+ messages in thread
From: misono.tomohiro @ 2021-09-17 12:26 UTC (permalink / raw)
  To: 'Mark Brown',
	Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest

Reviewed-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>

Thanks,
Misono

> Subject: [PATCH v2 4/4] selftests: arm64: Verify that all possible vector lengths
> are handled
> 
> As part of the enumeration interface for setting vector lengths it is valid
> to set vector lengths not supported in the system, these will be rounded to
> a supported vector length and returned from the prctl(). Add a test which
> exercises this for every valid vector length and makes sure that the return
> value is as expected and that this is reflected in the actual system state.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  tools/testing/selftests/arm64/fp/vec-syscfg.c | 71
> +++++++++++++++++++
>  1 file changed, 71 insertions(+)
> 
> diff --git a/tools/testing/selftests/arm64/fp/vec-syscfg.c
> b/tools/testing/selftests/arm64/fp/vec-syscfg.c
> index 9d6ac843e651..de11cd2f5d79 100644
> --- a/tools/testing/selftests/arm64/fp/vec-syscfg.c
> +++ b/tools/testing/selftests/arm64/fp/vec-syscfg.c
> @@ -540,6 +540,76 @@ static void prctl_set_onexec(struct vec_data *data)
>  	file_write_integer(data->default_vl_file, data->default_vl);
>  }
> 
> +/* For each VQ verify that setting via prctl() does the right thing */
> +static void prctl_set_all_vqs(struct vec_data *data)
> +{
> +	int ret, vq, vl, new_vl;
> +	int errors = 0;
> +
> +	for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
> +		vl = sve_vl_from_vq(vq);
> +
> +		/* Attempt to set the VL */
> +		ret = prctl(data->prctl_set, vl);
> +		if (ret < 0) {
> +			errors++;
> +			ksft_print_msg("%s prctl set failed for %d: %d
> (%s)\n",
> +				       data->name, vl,
> +				       errno, strerror(errno));
> +			continue;
> +		}
> +
> +		new_vl = ret & PR_SVE_VL_LEN_MASK;
> +
> +		/* Check that we actually have the reported new VL */
> +		if (data->rdvl() != new_vl) {
> +			ksft_print_msg("Set %s VL %d but RDVL
> reports %d\n",
> +				       data->name, new_vl, data->rdvl());
> +			errors++;
> +		}
> +
> +		/* Was that the VL we asked for? */
> +		if (new_vl == vl)
> +			continue;
> +
> +		/* Should round up to the minimum VL if below it */
> +		if (vl < data->min_vl) {
> +			if (new_vl != data->min_vl) {
> +				ksft_print_msg("%s VL %d returned %d not
> minimum %d\n",
> +					       data->name, vl, new_vl,
> +					       data->min_vl);
> +				errors++;
> +			}
> +
> +			continue;
> +		}
> +
> +		/* Should round down to maximum VL if above it */
> +		if (vl > data->max_vl) {
> +			if (new_vl != data->max_vl) {
> +				ksft_print_msg("%s VL %d returned %d not
> maximum %d\n",
> +					       data->name, vl, new_vl,
> +					       data->max_vl);
> +				errors++;
> +			}
> +
> +			continue;
> +		}
> +
> +		/* Otherwise we should've rounded down */
> +		if (!(new_vl < vl)) {
> +			ksft_print_msg("%s VL %d returned %d, did not round
> down\n",
> +				       data->name, vl, new_vl);
> +			errors++;
> +
> +			continue;
> +		}
> +	}
> +
> +	ksft_test_result(errors == 0, "%s prctl() set all VLs, %d errors\n",
> +			 data->name, errors);
> +}
> +
>  typedef void (*test_type)(struct vec_data *);
> 
>  static const test_type tests[] = {
> @@ -557,6 +627,7 @@ static const test_type tests[] = {
>  	prctl_set_no_child,
>  	prctl_set_for_child,
>  	prctl_set_onexec,
> +	prctl_set_all_vqs,
>  };
> 
>  int main(void)
> --
> 2.20.1


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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
  2021-09-17 12:08 ` Mark Brown
@ 2021-09-29 14:31   ` Will Deacon
  -1 siblings, 0 replies; 26+ messages in thread
From: Will Deacon @ 2021-09-29 14:31 UTC (permalink / raw)
  To: Mark Brown
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro

On Fri, Sep 17, 2021 at 01:08:51PM +0100, Mark Brown wrote:
> This series fixes up a few issues introduced into vec-syscfg during
> refactoring in the review process, then adds a new test which ensures
> that the behaviour when we attempt to set a vector length which is not
> supported by the current system matches what is documented in the SVE
> ABI documentation.
> 
> v2:
>  - Fix handling of missing VLs when checking that vector length setting
>    works as expected.

With this series applied, I see a test failing under qemu with:

# selftests: arm64: vec-syscfg
# TAP version 13
# 1..10
# ok 1 SVE default vector length 64
# ok 2 # SKIP Need to be root to write to /proc
# ok 3 # SKIP Need to be root to write to /proc
# ok 4 SVE current VL is 64
# ok 5 SVE set VL 64 and have VL 64
# ok 6 # SKIP SVE only one VL supported
# ok 7 # SKIP SVE only one VL supported
# ok 8 # SKIP SVE only one VL supported
# ok 9 # SKIP SVE only one VL supported
# # SVE VL 272 returned 256 not maximum 0
# # SVE VL 288 returned 256 not maximum 0
# # SVE VL 304 returned 256 not maximum 0
# # SVE VL 320 returned 256 not maximum 0
# # SVE VL 336 returned 256 not maximum 0
# # SVE VL 352 returned 256 not maximum 0

[repeat similar messages for ages]

  # SVE VL 8160 returned 256 not maximum 0
# # SVE VL 8176 returned 256 not maximum 0
# # SVE VL 8192 returned 256 not maximum 0
# not ok 10 SVE prctl() set all VLs, 496 errors
# # Totals: pass:3 fail:1 xfail:0 xpass:0 skip:6 error:0

Will

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-29 14:31   ` Will Deacon
  0 siblings, 0 replies; 26+ messages in thread
From: Will Deacon @ 2021-09-29 14:31 UTC (permalink / raw)
  To: Mark Brown
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro

On Fri, Sep 17, 2021 at 01:08:51PM +0100, Mark Brown wrote:
> This series fixes up a few issues introduced into vec-syscfg during
> refactoring in the review process, then adds a new test which ensures
> that the behaviour when we attempt to set a vector length which is not
> supported by the current system matches what is documented in the SVE
> ABI documentation.
> 
> v2:
>  - Fix handling of missing VLs when checking that vector length setting
>    works as expected.

With this series applied, I see a test failing under qemu with:

# selftests: arm64: vec-syscfg
# TAP version 13
# 1..10
# ok 1 SVE default vector length 64
# ok 2 # SKIP Need to be root to write to /proc
# ok 3 # SKIP Need to be root to write to /proc
# ok 4 SVE current VL is 64
# ok 5 SVE set VL 64 and have VL 64
# ok 6 # SKIP SVE only one VL supported
# ok 7 # SKIP SVE only one VL supported
# ok 8 # SKIP SVE only one VL supported
# ok 9 # SKIP SVE only one VL supported
# # SVE VL 272 returned 256 not maximum 0
# # SVE VL 288 returned 256 not maximum 0
# # SVE VL 304 returned 256 not maximum 0
# # SVE VL 320 returned 256 not maximum 0
# # SVE VL 336 returned 256 not maximum 0
# # SVE VL 352 returned 256 not maximum 0

[repeat similar messages for ages]

  # SVE VL 8160 returned 256 not maximum 0
# # SVE VL 8176 returned 256 not maximum 0
# # SVE VL 8192 returned 256 not maximum 0
# not ok 10 SVE prctl() set all VLs, 496 errors
# # Totals: pass:3 fail:1 xfail:0 xpass:0 skip:6 error:0

Will

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
  2021-09-29 14:31   ` Will Deacon
@ 2021-09-29 14:43     ` Mark Brown
  -1 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-29 14:43 UTC (permalink / raw)
  To: Will Deacon
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro

[-- Attachment #1: Type: text/plain, Size: 1225 bytes --]

On Wed, Sep 29, 2021 at 03:31:14PM +0100, Will Deacon wrote:

> With this series applied, I see a test failing under qemu with:

> # selftests: arm64: vec-syscfg
> # TAP version 13
> # 1..10
> # ok 1 SVE default vector length 64
> # ok 2 # SKIP Need to be root to write to /proc
> # ok 3 # SKIP Need to be root to write to /proc

AFAICT this is due to running as a non-root user, the testsuite was
already having serious issues before then...

> # ok 4 SVE current VL is 64
> # ok 5 SVE set VL 64 and have VL 64
> # ok 6 # SKIP SVE only one VL supported
> # ok 7 # SKIP SVE only one VL supported
> # ok 8 # SKIP SVE only one VL supported
> # ok 9 # SKIP SVE only one VL supported
> # # SVE VL 272 returned 256 not maximum 0

...as it's starting off by testing an interface that's only writable by
root and then relying on that information, the existing tests were also
not working usefully.  qemu by default supports way more than one vector
length.  In any case it's just the test added by the last patch that's
causing the output here, the first four patches should be fine and fix
issues.

I'm not sure it's a particularly good idea to run kselftest as a
non-root user TBH, it's going to cause you to skip a lot of tests.

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-29 14:43     ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-29 14:43 UTC (permalink / raw)
  To: Will Deacon
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro


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

On Wed, Sep 29, 2021 at 03:31:14PM +0100, Will Deacon wrote:

> With this series applied, I see a test failing under qemu with:

> # selftests: arm64: vec-syscfg
> # TAP version 13
> # 1..10
> # ok 1 SVE default vector length 64
> # ok 2 # SKIP Need to be root to write to /proc
> # ok 3 # SKIP Need to be root to write to /proc

AFAICT this is due to running as a non-root user, the testsuite was
already having serious issues before then...

> # ok 4 SVE current VL is 64
> # ok 5 SVE set VL 64 and have VL 64
> # ok 6 # SKIP SVE only one VL supported
> # ok 7 # SKIP SVE only one VL supported
> # ok 8 # SKIP SVE only one VL supported
> # ok 9 # SKIP SVE only one VL supported
> # # SVE VL 272 returned 256 not maximum 0

...as it's starting off by testing an interface that's only writable by
root and then relying on that information, the existing tests were also
not working usefully.  qemu by default supports way more than one vector
length.  In any case it's just the test added by the last patch that's
causing the output here, the first four patches should be fine and fix
issues.

I'm not sure it's a particularly good idea to run kselftest as a
non-root user TBH, it's going to cause you to skip a lot of tests.

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

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

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
  2021-09-29 14:43     ` Mark Brown
@ 2021-09-29 15:35       ` Will Deacon
  -1 siblings, 0 replies; 26+ messages in thread
From: Will Deacon @ 2021-09-29 15:35 UTC (permalink / raw)
  To: Mark Brown
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro

On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:
> On Wed, Sep 29, 2021 at 03:31:14PM +0100, Will Deacon wrote:
> 
> > With this series applied, I see a test failing under qemu with:
> 
> > # selftests: arm64: vec-syscfg
> > # TAP version 13
> > # 1..10
> > # ok 1 SVE default vector length 64
> > # ok 2 # SKIP Need to be root to write to /proc
> > # ok 3 # SKIP Need to be root to write to /proc
> 
> AFAICT this is due to running as a non-root user, the testsuite was
> already having serious issues before then...
> 
> > # ok 4 SVE current VL is 64
> > # ok 5 SVE set VL 64 and have VL 64
> > # ok 6 # SKIP SVE only one VL supported
> > # ok 7 # SKIP SVE only one VL supported
> > # ok 8 # SKIP SVE only one VL supported
> > # ok 9 # SKIP SVE only one VL supported
> > # # SVE VL 272 returned 256 not maximum 0
> 
> ...as it's starting off by testing an interface that's only writable by
> root and then relying on that information, the existing tests were also
> not working usefully.  qemu by default supports way more than one vector
> length.  In any case it's just the test added by the last patch that's
> causing the output here, the first four patches should be fine and fix
> issues.
> 
> I'm not sure it's a particularly good idea to run kselftest as a
> non-root user TBH, it's going to cause you to skip a lot of tests.

Ah, thanks for pointing that out. It would probably be better to skip the
tests rather than fail them if they're not running with sufficient
permissions, but I'll go ahead and queue your v3 for now.

Will

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-29 15:35       ` Will Deacon
  0 siblings, 0 replies; 26+ messages in thread
From: Will Deacon @ 2021-09-29 15:35 UTC (permalink / raw)
  To: Mark Brown
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro

On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:
> On Wed, Sep 29, 2021 at 03:31:14PM +0100, Will Deacon wrote:
> 
> > With this series applied, I see a test failing under qemu with:
> 
> > # selftests: arm64: vec-syscfg
> > # TAP version 13
> > # 1..10
> > # ok 1 SVE default vector length 64
> > # ok 2 # SKIP Need to be root to write to /proc
> > # ok 3 # SKIP Need to be root to write to /proc
> 
> AFAICT this is due to running as a non-root user, the testsuite was
> already having serious issues before then...
> 
> > # ok 4 SVE current VL is 64
> > # ok 5 SVE set VL 64 and have VL 64
> > # ok 6 # SKIP SVE only one VL supported
> > # ok 7 # SKIP SVE only one VL supported
> > # ok 8 # SKIP SVE only one VL supported
> > # ok 9 # SKIP SVE only one VL supported
> > # # SVE VL 272 returned 256 not maximum 0
> 
> ...as it's starting off by testing an interface that's only writable by
> root and then relying on that information, the existing tests were also
> not working usefully.  qemu by default supports way more than one vector
> length.  In any case it's just the test added by the last patch that's
> causing the output here, the first four patches should be fine and fix
> issues.
> 
> I'm not sure it's a particularly good idea to run kselftest as a
> non-root user TBH, it's going to cause you to skip a lot of tests.

Ah, thanks for pointing that out. It would probably be better to skip the
tests rather than fail them if they're not running with sufficient
permissions, but I'll go ahead and queue your v3 for now.

Will

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
  2021-09-29 15:35       ` Will Deacon
@ 2021-09-29 15:38         ` Mark Brown
  -1 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-29 15:38 UTC (permalink / raw)
  To: Will Deacon
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

On Wed, Sep 29, 2021 at 04:35:12PM +0100, Will Deacon wrote:
> On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:

> > I'm not sure it's a particularly good idea to run kselftest as a
> > non-root user TBH, it's going to cause you to skip a lot of tests.

> Ah, thanks for pointing that out. It would probably be better to skip the
> tests rather than fail them if they're not running with sufficient
> permissions, but I'll go ahead and queue your v3 for now.

Yes, that's what my v3 does - it skips the new test if it failed to
enumerate minimum and maximum vector lengths, like the other tests do.

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-29 15:38         ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-29 15:38 UTC (permalink / raw)
  To: Will Deacon
  Cc: Catalin Marinas, Shuah Khan, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro


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

On Wed, Sep 29, 2021 at 04:35:12PM +0100, Will Deacon wrote:
> On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:

> > I'm not sure it's a particularly good idea to run kselftest as a
> > non-root user TBH, it's going to cause you to skip a lot of tests.

> Ah, thanks for pointing that out. It would probably be better to skip the
> tests rather than fail them if they're not running with sufficient
> permissions, but I'll go ahead and queue your v3 for now.

Yes, that's what my v3 does - it skips the new test if it failed to
enumerate minimum and maximum vector lengths, like the other tests do.

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

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

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
  2021-09-29 15:35       ` Will Deacon
@ 2021-09-29 16:26         ` Shuah Khan
  -1 siblings, 0 replies; 26+ messages in thread
From: Shuah Khan @ 2021-09-29 16:26 UTC (permalink / raw)
  To: Will Deacon, Mark Brown
  Cc: Catalin Marinas, Shuah Khan, linux-arm-kernel, linux-kselftest,
	misono.tomohiro, Shuah Khan

On 9/29/21 9:35 AM, Will Deacon wrote:
> On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:
>> On Wed, Sep 29, 2021 at 03:31:14PM +0100, Will Deacon wrote:
>>
>>> With this series applied, I see a test failing under qemu with:
>>
>>> # selftests: arm64: vec-syscfg
>>> # TAP version 13
>>> # 1..10
>>> # ok 1 SVE default vector length 64
>>> # ok 2 # SKIP Need to be root to write to /proc
>>> # ok 3 # SKIP Need to be root to write to /proc
>>
>> AFAICT this is due to running as a non-root user, the testsuite was
>> already having serious issues before then...
>>
>>> # ok 4 SVE current VL is 64
>>> # ok 5 SVE set VL 64 and have VL 64
>>> # ok 6 # SKIP SVE only one VL supported
>>> # ok 7 # SKIP SVE only one VL supported
>>> # ok 8 # SKIP SVE only one VL supported
>>> # ok 9 # SKIP SVE only one VL supported
>>> # # SVE VL 272 returned 256 not maximum 0
>>
>> ...as it's starting off by testing an interface that's only writable by
>> root and then relying on that information, the existing tests were also
>> not working usefully.  qemu by default supports way more than one vector
>> length.  In any case it's just the test added by the last patch that's
>> causing the output here, the first four patches should be fine and fix
>> issues.
>>
>> I'm not sure it's a particularly good idea to run kselftest as a
>> non-root user TBH, it's going to cause you to skip a lot of tests.
> 

We don't want Kselftest default run to be as root. Users can choose to
run as root which would be an explicit choice so they expect and plan
for the impact. Example panic test.

> Ah, thanks for pointing that out. It would probably be better to skip the
> tests rather than fail them if they're not running with sufficient
> permissions, but I'll go ahead and queue your v3 for now.
> 

Correct. I would like to see tests skipped not failed if either config
or permissions are lacking to run the tests.

thanks,
-- Shuah

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-29 16:26         ` Shuah Khan
  0 siblings, 0 replies; 26+ messages in thread
From: Shuah Khan @ 2021-09-29 16:26 UTC (permalink / raw)
  To: Will Deacon, Mark Brown
  Cc: Catalin Marinas, Shuah Khan, linux-arm-kernel, linux-kselftest,
	misono.tomohiro, Shuah Khan

On 9/29/21 9:35 AM, Will Deacon wrote:
> On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:
>> On Wed, Sep 29, 2021 at 03:31:14PM +0100, Will Deacon wrote:
>>
>>> With this series applied, I see a test failing under qemu with:
>>
>>> # selftests: arm64: vec-syscfg
>>> # TAP version 13
>>> # 1..10
>>> # ok 1 SVE default vector length 64
>>> # ok 2 # SKIP Need to be root to write to /proc
>>> # ok 3 # SKIP Need to be root to write to /proc
>>
>> AFAICT this is due to running as a non-root user, the testsuite was
>> already having serious issues before then...
>>
>>> # ok 4 SVE current VL is 64
>>> # ok 5 SVE set VL 64 and have VL 64
>>> # ok 6 # SKIP SVE only one VL supported
>>> # ok 7 # SKIP SVE only one VL supported
>>> # ok 8 # SKIP SVE only one VL supported
>>> # ok 9 # SKIP SVE only one VL supported
>>> # # SVE VL 272 returned 256 not maximum 0
>>
>> ...as it's starting off by testing an interface that's only writable by
>> root and then relying on that information, the existing tests were also
>> not working usefully.  qemu by default supports way more than one vector
>> length.  In any case it's just the test added by the last patch that's
>> causing the output here, the first four patches should be fine and fix
>> issues.
>>
>> I'm not sure it's a particularly good idea to run kselftest as a
>> non-root user TBH, it's going to cause you to skip a lot of tests.
> 

We don't want Kselftest default run to be as root. Users can choose to
run as root which would be an explicit choice so they expect and plan
for the impact. Example panic test.

> Ah, thanks for pointing that out. It would probably be better to skip the
> tests rather than fail them if they're not running with sufficient
> permissions, but I'll go ahead and queue your v3 for now.
> 

Correct. I would like to see tests skipped not failed if either config
or permissions are lacking to run the tests.

thanks,
-- Shuah

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
  2021-09-29 16:26         ` Shuah Khan
@ 2021-09-29 16:37           ` Mark Brown
  -1 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-29 16:37 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Will Deacon, Catalin Marinas, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

On Wed, Sep 29, 2021 at 10:26:49AM -0600, Shuah Khan wrote:
> On 9/29/21 9:35 AM, Will Deacon wrote:
> > On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:

> > > I'm not sure it's a particularly good idea to run kselftest as a
> > > non-root user TBH, it's going to cause you to skip a lot of tests.

> We don't want Kselftest default run to be as root. Users can choose to
> run as root which would be an explicit choice so they expect and plan
> for the impact. Example panic test.

OTOH if you're trying to verify that the tests aren't broken it's not
that great since it'll mean that you'll not be exercising a bunch of the
code.

> > Ah, thanks for pointing that out. It would probably be better to skip the
> > tests rather than fail them if they're not running with sufficient
> > permissions, but I'll go ahead and queue your v3 for now.

> Correct. I would like to see tests skipped not failed if either config
> or permissions are lacking to run the tests.

As I said previously that's what my v3 that Will referenced above does.

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-29 16:37           ` Mark Brown
  0 siblings, 0 replies; 26+ messages in thread
From: Mark Brown @ 2021-09-29 16:37 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Will Deacon, Catalin Marinas, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro


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

On Wed, Sep 29, 2021 at 10:26:49AM -0600, Shuah Khan wrote:
> On 9/29/21 9:35 AM, Will Deacon wrote:
> > On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:

> > > I'm not sure it's a particularly good idea to run kselftest as a
> > > non-root user TBH, it's going to cause you to skip a lot of tests.

> We don't want Kselftest default run to be as root. Users can choose to
> run as root which would be an explicit choice so they expect and plan
> for the impact. Example panic test.

OTOH if you're trying to verify that the tests aren't broken it's not
that great since it'll mean that you'll not be exercising a bunch of the
code.

> > Ah, thanks for pointing that out. It would probably be better to skip the
> > tests rather than fail them if they're not running with sufficient
> > permissions, but I'll go ahead and queue your v3 for now.

> Correct. I would like to see tests skipped not failed if either config
> or permissions are lacking to run the tests.

As I said previously that's what my v3 that Will referenced above does.

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

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

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

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
  2021-09-29 16:37           ` Mark Brown
@ 2021-09-29 18:23             ` Shuah Khan
  -1 siblings, 0 replies; 26+ messages in thread
From: Shuah Khan @ 2021-09-29 18:23 UTC (permalink / raw)
  To: Mark Brown
  Cc: Will Deacon, Catalin Marinas, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro, Shuah Khan

On 9/29/21 10:37 AM, Mark Brown wrote:
> On Wed, Sep 29, 2021 at 10:26:49AM -0600, Shuah Khan wrote:
>> On 9/29/21 9:35 AM, Will Deacon wrote:
>>> On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:
> 
>>>> I'm not sure it's a particularly good idea to run kselftest as a
>>>> non-root user TBH, it's going to cause you to skip a lot of tests.
> 
>> We don't want Kselftest default run to be as root. Users can choose to
>> run as root which would be an explicit choice so they expect and plan
>> for the impact. Example panic test.
> 
> OTOH if you're trying to verify that the tests aren't broken it's not
> that great since it'll mean that you'll not be exercising a bunch of the
> code.
> 

Correct. Running Kselftest as root is the best approach for full coverage.

thanks,
-- Shuah

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

* Re: [PATCH v2 0/4] selftests: arm64: vec-syscfg updates
@ 2021-09-29 18:23             ` Shuah Khan
  0 siblings, 0 replies; 26+ messages in thread
From: Shuah Khan @ 2021-09-29 18:23 UTC (permalink / raw)
  To: Mark Brown
  Cc: Will Deacon, Catalin Marinas, Shuah Khan, linux-arm-kernel,
	linux-kselftest, misono.tomohiro, Shuah Khan

On 9/29/21 10:37 AM, Mark Brown wrote:
> On Wed, Sep 29, 2021 at 10:26:49AM -0600, Shuah Khan wrote:
>> On 9/29/21 9:35 AM, Will Deacon wrote:
>>> On Wed, Sep 29, 2021 at 03:43:23PM +0100, Mark Brown wrote:
> 
>>>> I'm not sure it's a particularly good idea to run kselftest as a
>>>> non-root user TBH, it's going to cause you to skip a lot of tests.
> 
>> We don't want Kselftest default run to be as root. Users can choose to
>> run as root which would be an explicit choice so they expect and plan
>> for the impact. Example panic test.
> 
> OTOH if you're trying to verify that the tests aren't broken it's not
> that great since it'll mean that you'll not be exercising a bunch of the
> code.
> 

Correct. Running Kselftest as root is the best approach for full coverage.

thanks,
-- Shuah

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

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

end of thread, other threads:[~2021-09-29 18:25 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17 12:08 [PATCH v2 0/4] selftests: arm64: vec-syscfg updates Mark Brown
2021-09-17 12:08 ` Mark Brown
2021-09-17 12:08 ` [PATCH v2 1/4] selftests: arm64: Fix printf() format mismatch in vec-syscfg Mark Brown
2021-09-17 12:08   ` Mark Brown
2021-09-17 12:08 ` [PATCH v2 2/4] selftests: arm64: Remove bogus error check on writing to files Mark Brown
2021-09-17 12:08   ` Mark Brown
2021-09-17 12:08 ` [PATCH v2 3/4] selftests: arm64: Fix and enable test for setting current VL in vec-syscfg Mark Brown
2021-09-17 12:08   ` Mark Brown
2021-09-17 12:08 ` [PATCH v2 4/4] selftests: arm64: Verify that all possible vector lengths are handled Mark Brown
2021-09-17 12:08   ` Mark Brown
2021-09-17 12:26   ` misono.tomohiro
2021-09-17 12:26     ` misono.tomohiro
2021-09-29 14:31 ` [PATCH v2 0/4] selftests: arm64: vec-syscfg updates Will Deacon
2021-09-29 14:31   ` Will Deacon
2021-09-29 14:43   ` Mark Brown
2021-09-29 14:43     ` Mark Brown
2021-09-29 15:35     ` Will Deacon
2021-09-29 15:35       ` Will Deacon
2021-09-29 15:38       ` Mark Brown
2021-09-29 15:38         ` Mark Brown
2021-09-29 16:26       ` Shuah Khan
2021-09-29 16:26         ` Shuah Khan
2021-09-29 16:37         ` Mark Brown
2021-09-29 16:37           ` Mark Brown
2021-09-29 18:23           ` Shuah Khan
2021-09-29 18:23             ` Shuah Khan

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.