[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 1/9] tests/tcg/aarch64: Adjust pauth tests for FEAT_FPAC
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 1/9] tests/tcg/aarch64: Adjust pauth tests for FEAT_FPAC |
Date: |
Tue, 29 Aug 2023 13:52:15 +0100 |
On Tue, 22 Aug 2023 at 05:27, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> With FEAT_FPAC, AUT* instructions that fail authentication
> do not produce an error value but instead fault.
>
> For pauth-2, install a signal handler and verify it gets called.
>
> For pauth-4 and pauth-5, we are explicitly testing the error value,
> so there's nothing to test with FEAT_FPAC, so exit early.
> Adjust the makefile to use -cpu neoverse-v1, which has FEAT_EPAC
> but not FEAT_FPAC.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> tests/tcg/aarch64/pauth-2.c | 61 +++++++++++++++++++++++++++----
> tests/tcg/aarch64/pauth-4.c | 28 ++++++++++++--
> tests/tcg/aarch64/pauth-5.c | 20 ++++++++++
> tests/tcg/aarch64/Makefile.target | 5 ++-
> 4 files changed, 101 insertions(+), 13 deletions(-)
> int main()
> {
> + static const struct sigaction sa = {
> + .sa_sigaction = sigill,
> + .sa_flags = SA_SIGINFO
> + };
> + unsigned long isar1, isar2;
> +
> + assert(getauxval(AT_HWCAP) & HWCAP_CPUID);
> +
> + asm("mrs %0, id_aa64isar1_el1" : "=r"(isar1));
> + asm("mrs %0, id_aa64isar2_el1" : "=r"(isar2));
You need to use the S3_n_Cn_Cn_n encoding for
ID_AA64ISAR2_EL1 in this test and the others,
to avoid problems with older binutils. Compare
how tests/tcg/aarch64/sysregs.c does it.
> diff --git a/tests/tcg/aarch64/Makefile.target
> b/tests/tcg/aarch64/Makefile.target
> index 681dfa077c..780ab3f183 100644
> --- a/tests/tcg/aarch64/Makefile.target
> +++ b/tests/tcg/aarch64/Makefile.target
> @@ -42,7 +42,10 @@ endif
> ifneq ($(CROSS_CC_HAS_ARMV8_3),)
> AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
> pauth-%: CFLAGS += -march=armv8.3-a
> -run-pauth-%: QEMU_OPTS += -cpu max
> +run-pauth-1: QEMU_OPTS += -cpu max
> +run-pauth-2: QEMU_OPTS += -cpu max
> +run-pauth-4: QEMU_OPTS += -cpu neoverse-v1
> +run-pauth-5: QEMU_OPTS += -cpu neoverse-v1
Why do we need to specify neoverse-v1 here ? A comment
would help.
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH v4 0/9] Implement Most ARMv8.3 Pointer Authentication Features, Richard Henderson, 2023/08/22
- [PATCH v4 2/9] target/arm: Add ID_AA64ISAR2_EL1, Richard Henderson, 2023/08/22
- [PATCH v4 1/9] tests/tcg/aarch64: Adjust pauth tests for FEAT_FPAC, Richard Henderson, 2023/08/22
- Re: [PATCH v4 1/9] tests/tcg/aarch64: Adjust pauth tests for FEAT_FPAC,
Peter Maydell <=
- [PATCH v4 3/9] target/arm: Add feature detection for FEAT_Pauth2 and extensions, Richard Henderson, 2023/08/22
- [PATCH v4 4/9] target/arm: Don't change pauth features when changing algorithm, Richard Henderson, 2023/08/22
- [PATCH v4 6/9] target/arm: Implement FEAT_EPAC, Richard Henderson, 2023/08/22
- [PATCH v4 5/9] target/arm: Implement FEAT_PACQARMA3, Richard Henderson, 2023/08/22
- [PATCH v4 7/9] target/arm: Implement FEAT_Pauth2, Richard Henderson, 2023/08/22
- [PATCH v4 8/9] targer/arm: Inform helpers whether a PAC instruction is 'combined', Richard Henderson, 2023/08/22