[PATCH v3 3/3] tools/kselftest: add MTE_FAR hwcap test

Yeoreum Yun posted 3 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH v3 3/3] tools/kselftest: add MTE_FAR hwcap test
Posted by Yeoreum Yun 8 months, 1 week ago
add MTE_FAR hwcap test on kselftest.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/abi/hwcap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
index 35f521e5f41c..a539eeb0bfc0 100644
--- a/tools/testing/selftests/arm64/abi/hwcap.c
+++ b/tools/testing/selftests/arm64/abi/hwcap.c
@@ -1098,6 +1098,12 @@ static const struct hwcap_data {
 		.sigill_fn = hbc_sigill,
 		.sigill_reliable = true,
 	},
+	{
+		.name = "MTE_FAR",
+		.at_hwcap = AT_HWCAP3,
+		.hwcap_bit = HWCAP3_MTE_FAR,
+		.cpuinfo = "mte_far",
+	},
 };

 typedef void (*sighandler_fn)(int, siginfo_t *, void *);
--
LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
Re: [PATCH v3 3/3] tools/kselftest: add MTE_FAR hwcap test
Posted by Catalin Marinas 7 months, 2 weeks ago
On Thu, Apr 10, 2025 at 08:47:21AM +0100, Yeoreum Yun wrote:
> diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
> index 35f521e5f41c..a539eeb0bfc0 100644
> --- a/tools/testing/selftests/arm64/abi/hwcap.c
> +++ b/tools/testing/selftests/arm64/abi/hwcap.c
> @@ -1098,6 +1098,12 @@ static const struct hwcap_data {
>  		.sigill_fn = hbc_sigill,
>  		.sigill_reliable = true,
>  	},
> +	{
> +		.name = "MTE_FAR",
> +		.at_hwcap = AT_HWCAP3,
> +		.hwcap_bit = HWCAP3_MTE_FAR,
> +		.cpuinfo = "mte_far",
> +	},
>  };

This is all good but I'd also like to see a test to check the FAR_EL1
bits are actually exposed to the signal handler when the hwcap is
present.

-- 
Catalin
Re: [PATCH v3 3/3] tools/kselftest: add MTE_FAR hwcap test
Posted by Yeoreum Yun 7 months, 2 weeks ago
Hi Catalin,

> On Thu, Apr 10, 2025 at 08:47:21AM +0100, Yeoreum Yun wrote:
> > diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
> > index 35f521e5f41c..a539eeb0bfc0 100644
> > --- a/tools/testing/selftests/arm64/abi/hwcap.c
> > +++ b/tools/testing/selftests/arm64/abi/hwcap.c
> > @@ -1098,6 +1098,12 @@ static const struct hwcap_data {
> >  		.sigill_fn = hbc_sigill,
> >  		.sigill_reliable = true,
> >  	},
> > +	{
> > +		.name = "MTE_FAR",
> > +		.at_hwcap = AT_HWCAP3,
> > +		.hwcap_bit = HWCAP3_MTE_FAR,
> > +		.cpuinfo = "mte_far",
> > +	},
> >  };
>
> This is all good but I'd also like to see a test to check the FAR_EL1
> bits are actually exposed to the signal handler when the hwcap is
> present.
>

Okay. I'll integrate the address tag check test into check_mamp_option.

--
Sincerely,
Yeoreum Yun