Skip to contentSkip to conversation

kselftest/arm64: Remove local definitions of MTE prctls

PATCH In review Mark Brown 4 participants 4 messages Jan 26, 2022 – Feb 15, 2022

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 kselftest/arm64: Remove local definitions of MTE prctls

The GCR EL1 test unconditionally includes local definitions of the prctls it tests. Since not only will the kselftest build infrastructure ensure that the in tree uapi headers are available but the toolchain being used to build kselftest may ensure that system uapi headers with MTE support are available this causes the compiler to warn about duplicate definitions. Remove these duplicate definitions.

---
 .../selftests/arm64/mte/check_gcr_el1_cswitch.c       | 11 -----------
 1 file changed, 11 deletions(-)
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c +0 -11
index a876db1f096a..325bca0de0f6 100644
@@ -19,17 +19,6 @@
 #include "kselftest.h"
 #include "mte_common_util.h"
 
-#define PR_SET_TAGGED_ADDR_CTRL 55
-#define PR_GET_TAGGED_ADDR_CTRL 56
-# define PR_TAGGED_ADDR_ENABLE  (1UL << 0)
-# define PR_MTE_TCF_SHIFT	1
-# define PR_MTE_TCF_NONE	(0UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TCF_SYNC	(1UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TCF_ASYNC	(2UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TCF_MASK	(3UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TAG_SHIFT	3
-# define PR_MTE_TAG_MASK	(0xffffUL << PR_MTE_TAG_SHIFT)
-
 #include "mte_def.h"
 
 #define NUM_ITERATIONS		1024
Signature · 1 line
2.30.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Mark Brown

The GCR EL1 test unconditionally includes local definitions of the prctls it tests. Since not only will the kselftest build infrastructure ensure that the in tree uapi headers are available but the toolchain being used to build kselftest may ensure that system uapi headers with MTE support are available this causes the compiler to warn about duplicate definitions. Remove these duplicate definitions.

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Mark Brown
Quoted 25 lines · Mark Brown

The GCR EL1 test unconditionally includes local definitions of the prctls it tests. Since not only will the kselftest build infrastructure ensure that the in tree uapi headers are available but the toolchain being used to build kselftest may ensure that system uapi headers with MTE support are available this causes the compiler to warn about duplicate definitions. Remove these duplicate definitions.

---
  .../selftests/arm64/mte/check_gcr_el1_cswitch.c       | 11 -----------
  1 file changed, 11 deletions(-)
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c +0 -4
index a876db1f096a..325bca0de0f6 100644
@@ -19,17 +19,6 @@
  #include "kselftest.h"
  #include "mte_common_util.h"
 
-#define PR_SET_TAGGED_ADDR_CTRL 55
-#define PR_GET_TAGGED_ADDR_CTRL 56
-# define PR_TAGGED_ADDR_ENABLE  (1UL << 0)
-# define PR_MTE_TCF_SHIFT	1

tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c line 24

Quoted 10 lines
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c +0 -7
-# define PR_MTE_TCF_NONE	(0UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TCF_SYNC	(1UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TCF_ASYNC	(2UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TCF_MASK	(3UL << PR_MTE_TCF_SHIFT)
-# define PR_MTE_TAG_SHIFT	3
-# define PR_MTE_TAG_MASK	(0xffffUL << PR_MTE_TAG_SHIFT)
-
  #include "mte_def.h"
 
  #define NUM_ITERATIONS		1024

Thank you for cleaning this up. Assuming it is going to go through arm tree:

thanks,
-- Shuah

maintainer
#3 lore raw
In reply to Mark Brown
Quoted 8 lines · Mark Brown

The GCR EL1 test unconditionally includes local definitions of the prctls it tests. Since not only will the kselftest build infrastructure ensure that the in tree uapi headers are available but the toolchain being used to build kselftest may ensure that system uapi headers with MTE support are available this causes the compiler to warn about duplicate definitions. Remove these duplicate definitions.

[...]

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

[1/1] kselftest/arm64: Remove local definitions of MTE prctls

      https://git.kernel.org/arm64/c/396520759bd3

Cheers,

Signature · 5 lines
Will

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