fix(pauth): restore inlining test instructions
After the change [1] pauth instructions are no longer invoked in
sequence, introducing bl/ret instructions in between test helpers
invocations. This pattern breaks Realm payload pauth test.
Restore the inline asm function making sure the top level test helper
is constituted of the well defined pauth instructions sequence.
[1] https://review.trustedfirmware.org/c/TF-A/tf-a-tests/+/33144
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ic062aad8f4c85daf7741094eb9b5ef6769ee8dc6
diff --git a/include/lib/extensions/pauth.h b/include/lib/extensions/pauth.h
index 8ae5896..8816e18 100644
--- a/include/lib/extensions/pauth.h
+++ b/include/lib/extensions/pauth.h
@@ -25,10 +25,6 @@
/* Disable ARMv8.3-PAuth */
void pauth_disable(void);
-void paciasp(void);
-void autiasp(void);
-void xpaclri(void);
-
/*
* Fill Pauth Keys and template with random values if keys werenot initialized earlier,
* Else Copy PAuth key registers to template.
diff --git a/lib/extensions/pauth/aarch64/pauth.c b/lib/extensions/pauth/aarch64/pauth.c
index c407f5a..da254a7 100644
--- a/lib/extensions/pauth/aarch64/pauth.c
+++ b/lib/extensions/pauth/aarch64/pauth.c
@@ -169,8 +169,9 @@
void pauth_test_lib_test_intrs(void)
{
/* Pointer authentication instructions */
- paciasp();
- autiasp();
- paciasp();
- xpaclri();
+ __asm__ volatile (
+ "hint #25\n" /* PACIASP */
+ "hint #29\n" /* AUTIASP */
+ "hint #25\n" /* PACIASP */
+ "hint #7"); /* XPACLRI */
}
diff --git a/lib/extensions/pauth/aarch64/pauth_helpers.S b/lib/extensions/pauth/aarch64/pauth_helpers.S
index 2146f27..52fb272 100644
--- a/lib/extensions/pauth/aarch64/pauth_helpers.S
+++ b/lib/extensions/pauth/aarch64/pauth_helpers.S
@@ -56,21 +56,6 @@
ret
endfunc pauth_init_enable
-func paciasp
- hint #25
- ret
-endfunc paciasp
-
-func autiasp
- hint #29
- ret
-endfunc autiasp
-
-func xpaclri
- hint #7
- ret
-endfunc xpaclri
-
/* -----------------------------------------------------------
* Disable pointer authentication in EL1/EL2
* -----------------------------------------------------------