test(tftf): test PAuth in Realm
- Enable PAuth in Realm RL1 by default.
- Check if PAuth keys are accessible in Realm RL1.
- Check if Realm PAuth keys are preserved across RMM entry/exit.
- Check if NS PAuth keys are preserved across RMM entry/exit.
- Generate PAuth fault by cloberring LR.
Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: I85d8e03ec604c96117555e7aa866453cb2745cfe
diff --git a/include/lib/extensions/pauth.h b/include/lib/extensions/pauth.h
index d072f5c..c8d577f 100644
--- a/include/lib/extensions/pauth.h
+++ b/include/lib/extensions/pauth.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -7,6 +7,7 @@
#ifndef PAUTH_H
#define PAUTH_H
+#include <stdbool.h>
#include <stdint.h>
#ifdef __aarch64__
@@ -18,6 +19,22 @@
/* Disable ARMv8.3-PAuth */
void pauth_disable(void);
+
+/*
+ * Fill Pauth Keys and template with random values if keys werenot initialized earlier,
+ * Else Copy PAuth key registers to template.
+ */
+void pauth_test_lib_fill_regs_and_template(void);
+
+/* Read and Compare PAuth registers with provided template values. */
+bool pauth_test_lib_compare_template(void);
+
+/* Read and Store PAuth registers in template. */
+void pauth_test_lib_read_keys(void);
+
+/* Test PAuth instructions. */
+void pauth_test_lib_test_intrs(void);
+
#endif /* __aarch64__ */
#endif /* PAUTH_H */