2020-10-26 16:14:01

by Vincenzo Frascino

[permalink] [raw]
Subject: [PATCH 0/6] kselftest/arm64: MTE fixes

This series contains a set of fixes for the arm64 MTE kselftests [1].

A version of the fixes rebased on 5.10-rc1 can be found at [2].

To verify the fixes it is possible to use the command below:

make -C tools/testing/selftests/ ARCH=arm64 TARGETS=arm64 ARM64_SUBTARGETS=mte \
CC=<gcc compiler with MTE support>

[1] https://lore.kernel.org/lkml/[email protected]
[2] https://git.gitlab.arm.com/linux-arm/linux-vf.git mte/v5.fixes

Cc: Shuah Khan <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Gabor Kertesz <[email protected]>
Cc: Amit Daniel Kachhap <[email protected]>
Signed-off-by: Vincenzo Frascino <[email protected]>

Vincenzo Frascino (6):
kselftest/arm64: Fix check_buffer_fill test
kselftest/arm64: Fix check_tags_inclusion test
kselftest/arm64: Fix check_child_memory test
kselftest/arm64: Fix check_mmap_options test
kselftest/arm64: Fix check_ksm_options test
kselftest/arm64: Fix check_user_mem test

tools/testing/selftests/arm64/mte/check_buffer_fill.c | 3 +++
tools/testing/selftests/arm64/mte/check_child_memory.c | 3 +++
tools/testing/selftests/arm64/mte/check_ksm_options.c | 4 ++++
tools/testing/selftests/arm64/mte/check_mmap_options.c | 4 ++++
tools/testing/selftests/arm64/mte/check_tags_inclusion.c | 3 +++
tools/testing/selftests/arm64/mte/check_user_mem.c | 4 ++++
6 files changed, 21 insertions(+)

--
2.28.0


2020-10-26 16:14:05

by Vincenzo Frascino

[permalink] [raw]
Subject: [PATCH 2/6] kselftest/arm64: Fix check_tags_inclusion test

The check_tags_inclusion test reports the error below because the test
plan is not declared correctly:

# Planned tests != run tests (0 != 4)

Fix the test adding the correct test plan declaration.

Fixes: f3b2a26ca78d ("kselftest/arm64: Verify mte tag inclusion via prctl")
Cc: Shuah Khan <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Gabor Kertesz <[email protected]>
Cc: Amit Daniel Kachhap <[email protected]>
Signed-off-by: Vincenzo Frascino <[email protected]>
---
tools/testing/selftests/arm64/mte/check_tags_inclusion.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
index 94d245a0ed56..deaef1f61076 100644
--- a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
+++ b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
@@ -170,6 +170,9 @@ int main(int argc, char *argv[])
/* Register SIGSEGV handler */
mte_register_signal(SIGSEGV, mte_default_handler);

+ /* Set test plan */
+ ksft_set_plan(4);
+
evaluate_test(check_single_included_tags(USE_MMAP, MTE_SYNC_ERR),
"Check an included tag value with sync mode\n");
evaluate_test(check_multiple_included_tags(USE_MMAP, MTE_SYNC_ERR),
--
2.28.0

2020-10-26 16:14:23

by Vincenzo Frascino

[permalink] [raw]
Subject: [PATCH 1/6] kselftest/arm64: Fix check_buffer_fill test

The check_buffer_fill test reports the error below because the test
plan is not declared correctly:

# Planned tests != run tests (0 != 20)

Fix the test adding the correct test plan declaration.

Fixes: e9b60476bea0 ("kselftest/arm64: Add utilities and a test to validate mte memory")
Cc: Shuah Khan <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Gabor Kertesz <[email protected]>
Cc: Amit Daniel Kachhap <[email protected]>
Signed-off-by: Vincenzo Frascino <[email protected]>
---
tools/testing/selftests/arm64/mte/check_buffer_fill.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/arm64/mte/check_buffer_fill.c b/tools/testing/selftests/arm64/mte/check_buffer_fill.c
index 242635d79035..c9fa141ebdcc 100644
--- a/tools/testing/selftests/arm64/mte/check_buffer_fill.c
+++ b/tools/testing/selftests/arm64/mte/check_buffer_fill.c
@@ -417,6 +417,9 @@ int main(int argc, char *argv[])
/* Register SIGSEGV handler */
mte_register_signal(SIGSEGV, mte_default_handler);

+ /* Set test plan */
+ ksft_set_plan(20);
+
/* Buffer by byte tests */
evaluate_test(check_buffer_by_byte(USE_MMAP, MTE_SYNC_ERR),
"Check buffer correctness by byte with sync err mode and mmap memory\n");
--
2.28.0

2020-10-28 06:48:43

by Amit Kachhap

[permalink] [raw]
Subject: Re: [PATCH 1/6] kselftest/arm64: Fix check_buffer_fill test



On 10/26/20 5:42 PM, Vincenzo Frascino wrote:
> The check_buffer_fill test reports the error below because the test
> plan is not declared correctly:
>
> # Planned tests != run tests (0 != 20)
>
> Fix the test adding the correct test plan declaration.

This change is required and got missed earlier.
Acked by: Amit Daniel Kachhap <[email protected]>

>
> Fixes: e9b60476bea0 ("kselftest/arm64: Add utilities and a test to validate mte memory")
> Cc: Shuah Khan <[email protected]>
> Cc: Catalin Marinas <[email protected]>
> Cc: Will Deacon <[email protected]>
> Cc: Gabor Kertesz <[email protected]>
> Cc: Amit Daniel Kachhap <[email protected]>
> Signed-off-by: Vincenzo Frascino <[email protected]>
> ---
> tools/testing/selftests/arm64/mte/check_buffer_fill.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/testing/selftests/arm64/mte/check_buffer_fill.c b/tools/testing/selftests/arm64/mte/check_buffer_fill.c
> index 242635d79035..c9fa141ebdcc 100644
> --- a/tools/testing/selftests/arm64/mte/check_buffer_fill.c
> +++ b/tools/testing/selftests/arm64/mte/check_buffer_fill.c
> @@ -417,6 +417,9 @@ int main(int argc, char *argv[])
> /* Register SIGSEGV handler */
> mte_register_signal(SIGSEGV, mte_default_handler);
>
> + /* Set test plan */
> + ksft_set_plan(20);
> +
> /* Buffer by byte tests */
> evaluate_test(check_buffer_by_byte(USE_MMAP, MTE_SYNC_ERR),
> "Check buffer correctness by byte with sync err mode and mmap memory\n");
>

2020-10-28 06:51:30

by Amit Kachhap

[permalink] [raw]
Subject: Re: [PATCH 2/6] kselftest/arm64: Fix check_tags_inclusion test



On 10/26/20 5:42 PM, Vincenzo Frascino wrote:
> The check_tags_inclusion test reports the error below because the test
> plan is not declared correctly:
>
> # Planned tests != run tests (0 != 4)
>
> Fix the test adding the correct test plan declaration.

This change is required and got missed earlier.
Acked by: Amit Daniel Kachhap <[email protected]>

>
> Fixes: f3b2a26ca78d ("kselftest/arm64: Verify mte tag inclusion via prctl")
> Cc: Shuah Khan <[email protected]>
> Cc: Catalin Marinas <[email protected]>
> Cc: Will Deacon <[email protected]>
> Cc: Gabor Kertesz <[email protected]>
> Cc: Amit Daniel Kachhap <[email protected]>
> Signed-off-by: Vincenzo Frascino <[email protected]>
> ---
> tools/testing/selftests/arm64/mte/check_tags_inclusion.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
> index 94d245a0ed56..deaef1f61076 100644
> --- a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
> +++ b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
> @@ -170,6 +170,9 @@ int main(int argc, char *argv[])
> /* Register SIGSEGV handler */
> mte_register_signal(SIGSEGV, mte_default_handler);
>
> + /* Set test plan */
> + ksft_set_plan(4);
> +
> evaluate_test(check_single_included_tags(USE_MMAP, MTE_SYNC_ERR),
> "Check an included tag value with sync mode\n");
> evaluate_test(check_multiple_included_tags(USE_MMAP, MTE_SYNC_ERR),
>

2020-10-29 08:38:58

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH 0/6] kselftest/arm64: MTE fixes

On Mon, 26 Oct 2020 12:12:42 +0000, Vincenzo Frascino wrote:
> This series contains a set of fixes for the arm64 MTE kselftests [1].
>
> A version of the fixes rebased on 5.10-rc1 can be found at [2].
>
> To verify the fixes it is possible to use the command below:
>
> make -C tools/testing/selftests/ ARCH=arm64 TARGETS=arm64 ARM64_SUBTARGETS=mte \
> CC=<gcc compiler with MTE support>
>
> [...]

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

[1/6] kselftest/arm64: Fix check_buffer_fill test
https://git.kernel.org/arm64/c/5bc7c1156f3f
[2/6] kselftest/arm64: Fix check_tags_inclusion test
https://git.kernel.org/arm64/c/041fa41f5422
[3/6] kselftest/arm64: Fix check_child_memory test
https://git.kernel.org/arm64/c/386cf789fa6d
[4/6] kselftest/arm64: Fix check_mmap_options test
https://git.kernel.org/arm64/c/7419390a466e
[5/6] kselftest/arm64: Fix check_ksm_options test
https://git.kernel.org/arm64/c/cbb268af05de
[6/6] kselftest/arm64: Fix check_user_mem test
https://git.kernel.org/arm64/c/493b35db0548

Cheers,
--
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev