Browse Source
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. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20230829232335.965414-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>pull/251/head
committed by
Peter Maydell
5 changed files with 98 additions and 13 deletions
@ -0,0 +1,23 @@ |
|||
/*
|
|||
* Helper for pauth test case |
|||
* |
|||
* Copyright (c) 2023 Linaro Ltd |
|||
* SPDX-License-Identifier: GPL-2.0-or-later |
|||
*/ |
|||
|
|||
#include <assert.h> |
|||
#include <sys/auxv.h> |
|||
|
|||
static int get_pac_feature(void) |
|||
{ |
|||
unsigned long isar1, isar2; |
|||
|
|||
assert(getauxval(AT_HWCAP) & HWCAP_CPUID); |
|||
|
|||
asm("mrs %0, id_aa64isar1_el1" : "=r"(isar1)); |
|||
asm("mrs %0, S3_0_C0_C6_2" : "=r"(isar2)); /* id_aa64isar2_el1 */ |
|||
|
|||
return ((isar1 >> 4) & 0xf) /* APA */ |
|||
| ((isar1 >> 8) & 0xf) /* API */ |
|||
| ((isar2 >> 12) & 0xf); /* APA3 */ |
|||
} |
|||
Loading…
Reference in new issue