linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kselftest/arm4: Provide local defines for AT_HWCAP3
@ 2025-07-15 21:11 Mark Brown
  2025-07-16  2:34 ` Anshuman Khandual
  2025-07-17 10:46 ` Will Deacon
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2025-07-15 21:11 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, linux-kernel, Mark Brown

Some build environments for the selftests are not picking up the newly
added AT_HWCAP3 when using the libc headers, even with headers_install
(which we require already for the arm64 selftests).  As a quick fix add
local definitions of the constant to tools use it, while auxvec.h is
installed with some toolchains it needs some persuasion to get picked up.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/abi/hwcap.c       | 4 ++++
 tools/testing/selftests/arm64/mte/check_prctl.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
index 35f521e5f41c..aa902408facd 100644
--- a/tools/testing/selftests/arm64/abi/hwcap.c
+++ b/tools/testing/selftests/arm64/abi/hwcap.c
@@ -21,6 +21,10 @@
 
 #define TESTS_PER_HWCAP 3
 
+#ifndef AT_HWCAP3
+#define AT_HWCAP3 29
+#endif
+
 /*
  * Function expected to generate exception when the feature is not
  * supported and return when it is supported. If the specific exception
diff --git a/tools/testing/selftests/arm64/mte/check_prctl.c b/tools/testing/selftests/arm64/mte/check_prctl.c
index 4c89e9538ca0..c36c4c49ff95 100644
--- a/tools/testing/selftests/arm64/mte/check_prctl.c
+++ b/tools/testing/selftests/arm64/mte/check_prctl.c
@@ -12,6 +12,10 @@
 
 #include "kselftest.h"
 
+#ifndef AT_HWCAP3
+#define AT_HWCAP3 29
+#endif
+
 static int set_tagged_addr_ctrl(int val)
 {
 	int ret;

---
base-commit: 86731a2a651e58953fc949573895f2fa6d456841
change-id: 20250710-arm64-selftest-bodge-hwcap3-b6ab30ab69cd

Best regards,
--  
Mark Brown <broonie@kernel.org>


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

* Re: [PATCH] kselftest/arm4: Provide local defines for AT_HWCAP3
  2025-07-15 21:11 [PATCH] kselftest/arm4: Provide local defines for AT_HWCAP3 Mark Brown
@ 2025-07-16  2:34 ` Anshuman Khandual
  2025-07-16 10:37   ` Mark Brown
  2025-07-17 10:46 ` Will Deacon
  1 sibling, 1 reply; 4+ messages in thread
From: Anshuman Khandual @ 2025-07-16  2:34 UTC (permalink / raw)
  To: Mark Brown, Catalin Marinas, Will Deacon, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, linux-kernel



On 16/07/25 2:41 AM, Mark Brown wrote:
> Some build environments for the selftests are not picking up the newly
> added AT_HWCAP3 when using the libc headers, even with headers_install
> (which we require already for the arm64 selftests).  As a quick fix add
> local definitions of the constant to tools use it, while auxvec.h is
> installed with some toolchains it needs some persuasion to get picked up.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  tools/testing/selftests/arm64/abi/hwcap.c       | 4 ++++
>  tools/testing/selftests/arm64/mte/check_prctl.c | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
> index 35f521e5f41c..aa902408facd 100644
> --- a/tools/testing/selftests/arm64/abi/hwcap.c
> +++ b/tools/testing/selftests/arm64/abi/hwcap.c
> @@ -21,6 +21,10 @@
>  
>  #define TESTS_PER_HWCAP 3
>  
> +#ifndef AT_HWCAP3
> +#define AT_HWCAP3 29

Just wondering - would it be better to add a comment that this is a
temporary construct till libc headers pick up AT_HWCAP3 definitions.


> +#endif
> +
>  /*
>   * Function expected to generate exception when the feature is not
>   * supported and return when it is supported. If the specific exception
> diff --git a/tools/testing/selftests/arm64/mte/check_prctl.c b/tools/testing/selftests/arm64/mte/check_prctl.c
> index 4c89e9538ca0..c36c4c49ff95 100644
> --- a/tools/testing/selftests/arm64/mte/check_prctl.c
> +++ b/tools/testing/selftests/arm64/mte/check_prctl.c
> @@ -12,6 +12,10 @@
>  
>  #include "kselftest.h"
>  
> +#ifndef AT_HWCAP3
> +#define AT_HWCAP3 29
> +#endif
> +
>  static int set_tagged_addr_ctrl(int val)
>  {
>  	int ret;
> 
> ---
> base-commit: 86731a2a651e58953fc949573895f2fa6d456841
> change-id: 20250710-arm64-selftest-bodge-hwcap3-b6ab30ab69cd
> 
> Best regards,
> --  
> Mark Brown <broonie@kernel.org>
> 
> 


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

* Re: [PATCH] kselftest/arm4: Provide local defines for AT_HWCAP3
  2025-07-16  2:34 ` Anshuman Khandual
@ 2025-07-16 10:37   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-07-16 10:37 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: Catalin Marinas, Will Deacon, Shuah Khan, linux-arm-kernel,
	linux-kselftest, linux-kernel

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

On Wed, Jul 16, 2025 at 08:04:54AM +0530, Anshuman Khandual wrote:
> On 16/07/25 2:41 AM, Mark Brown wrote:

> >  #define TESTS_PER_HWCAP 3

> > +#ifndef AT_HWCAP3
> > +#define AT_HWCAP3 29

> Just wondering - would it be better to add a comment that this is a
> temporary construct till libc headers pick up AT_HWCAP3 definitions.

Possibly?  We tend to be against comments for this stuff in the tests
though.  We don't 100% need people's libcs updating, if we can work out
how to get the kernel header picked up in favour of the libc one
robustly that'd be fine too.

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

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

* Re: [PATCH] kselftest/arm4: Provide local defines for AT_HWCAP3
  2025-07-15 21:11 [PATCH] kselftest/arm4: Provide local defines for AT_HWCAP3 Mark Brown
  2025-07-16  2:34 ` Anshuman Khandual
@ 2025-07-17 10:46 ` Will Deacon
  1 sibling, 0 replies; 4+ messages in thread
From: Will Deacon @ 2025-07-17 10:46 UTC (permalink / raw)
  To: Catalin Marinas, Shuah Khan, Mark Brown
  Cc: kernel-team, Will Deacon, linux-arm-kernel, linux-kselftest,
	linux-kernel

On Tue, 15 Jul 2025 22:11:41 +0100, Mark Brown wrote:
> Some build environments for the selftests are not picking up the newly
> added AT_HWCAP3 when using the libc headers, even with headers_install
> (which we require already for the arm64 selftests).  As a quick fix add
> local definitions of the constant to tools use it, while auxvec.h is
> installed with some toolchains it needs some persuasion to get picked up.
> 
> 
> [...]

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

[1/1] kselftest/arm4: Provide local defines for AT_HWCAP3
      https://git.kernel.org/arm64/c/54c605124da6

Cheers,
-- 
Will

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

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

end of thread, other threads:[~2025-07-17 10:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 21:11 [PATCH] kselftest/arm4: Provide local defines for AT_HWCAP3 Mark Brown
2025-07-16  2:34 ` Anshuman Khandual
2025-07-16 10:37   ` Mark Brown
2025-07-17 10:46 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).