This will check for presence of pointer authentication extension.
According to the reference manual, Pointer authentication is
implemented if the value of at least one of
ID_AA64ISAR1_EL1.{APA, API, GPA, GPI}
is not 0b0000.
Change-Id: I4e98e65758e8edc953794e5b618d2c6c3f6000ae
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33454
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
     return getAff2(arm_sys, tc) | getAff1(arm_sys, tc) | getAff0(arm_sys, tc);
 }
 
+bool
+HavePACExt(ThreadContext *tc)
+{
+    AA64ISAR1 id_aa64isar1 = tc->readMiscReg(MISCREG_ID_AA64ISAR1_EL1);
+    return id_aa64isar1.api | id_aa64isar1.apa |
+        id_aa64isar1.gpi | id_aa64isar1.gpa;
+}
+
 bool
 HaveVirtHostExt(ThreadContext *tc)
 {
 
     return opModeToEL((OperatingMode) (uint8_t)cpsr.mode);
 }
 
+bool HavePACExt(ThreadContext *tc);
 bool HaveVirtHostExt(ThreadContext *tc);
 bool HaveSecureEL2Ext(ThreadContext *tc);
 bool IsSecureEL2Enabled(ThreadContext *tc);