test(pauth): updated helpers to include QARMA3
QARMA3 is a pointer authentication algorithm introduced by v8.3
extensions. Previous tests did not consider the possible presence
of QARMA3 algorithm, as it was released in v8.8. This algorithm
can be detected through fields ID_AA64ISAR2_EL1.{GPA3, APA3} when
they are not 0.
This patch modifies the helper function that detects the presence
of PAuth, considering the possibility of having QARMA3 available.
In addition, is_armv8_3_pauth_gpa_gpi_present() and
is_armv8_3_pauth_apa_api_present() were modified to take into
account fields GPA3 and APA3 (from ID_AA64ISAR2_EL1) respectively.
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: I486c6d3118a040b3352eff2b0d5709baf0518314
diff --git a/tftf/framework/main.c b/tftf/framework/main.c
index f75cb07..a203bd2 100644
--- a/tftf/framework/main.c
+++ b/tftf/framework/main.c
@@ -550,7 +550,7 @@
* authentication would fail then.
*/
#if ENABLE_PAUTH
- assert(is_armv8_3_pauth_apa_api_present());
+ assert(is_armv8_3_pauth_apa_api_apa3_present());
/*
* Program APIAKey_EL1 key and enable ARMv8.3-PAuth here as this
diff --git a/tftf/tests/extensions/pauth/test_pauth.c b/tftf/tests/extensions/pauth/test_pauth.c
index 30b78ef..b7434a8 100644
--- a/tftf/tests/extensions/pauth/test_pauth.c
+++ b/tftf/tests/extensions/pauth/test_pauth.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -60,7 +60,7 @@
memset(pauth_keys_before, 0, NUM_KEYS * sizeof(uint128_t));
- if (is_armv8_3_pauth_apa_api_present()) {
+ if (is_armv8_3_pauth_apa_api_apa3_present()) {
if (is_pauth_key_enabled(SCTLR_EnIA_BIT)) {
/* Read APIAKey_EL1 */
plat_key = read_apiakeylo_el1() |
@@ -119,7 +119,7 @@
* APGAKey_EL1 can be re-programmed, as this key is not set in
* TF-A Test suite and PACGA instruction is not used.
*/
- if (is_armv8_3_pauth_gpa_gpi_present()) {
+ if (is_armv8_3_pauth_gpa_gpi_gpa3_present()) {
/* Program APGAKey_EL1 */
plat_key = init_apkey();
write_apgakeylo_el1((uint64_t)plat_key);
@@ -138,7 +138,7 @@
{
memset(pauth_keys_after, 0, NUM_KEYS * sizeof(uint128_t));
- if (is_armv8_3_pauth_apa_api_present()) {
+ if (is_armv8_3_pauth_apa_api_apa3_present()) {
/* Read APIAKey_EL1 */
pauth_keys_after[0] = read_apiakeylo_el1() |
((uint128_t)(read_apiakeyhi_el1()) << 64);
@@ -156,7 +156,7 @@
((uint128_t)(read_apdbkeyhi_el1()) << 64);
}
- if (is_armv8_3_pauth_gpa_gpi_present()) {
+ if (is_armv8_3_pauth_gpa_gpi_gpa3_present()) {
/* Read APGAKey_EL1 */
pauth_keys_after[4] = read_apgakeylo_el1() |
((uint128_t)(read_apgakeyhi_el1()) << 64);