syn_pactrap is fairly simple as the ISS is all RES0.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/arm/syndrome.h | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h
index abec0a4908e..19c7659fb4f 100644
--- a/target/arm/syndrome.h
+++ b/target/arm/syndrome.h
@@ -398,15 +398,32 @@ static inline uint32_t syn_smetrap(SMEExceptionType etype, bool is_16bit)
return res;
}
+/*
+ * ISS encoding for a PAC Fail exceptions
+ */
+FIELD(PACFAIL_ISS, BnA, 0, 1) /* B key or A key */
+FIELD(PACFAIL_ISS, DnI, 1, 1) /* Data or Instruction */
+
static inline uint32_t syn_pacfail(bool data, int keynumber)
{
- int error_code = (data << 1) | keynumber;
- return (EC_PACFAIL << ARM_EL_EC_SHIFT) | ARM_EL_IL | error_code;
+ uint32_t res = syn_set_ec(0, EC_PACFAIL);
+ res = FIELD_DP32(res, SYNDROME, IL, 1);
+
+ res = FIELD_DP32(res, PACFAIL_ISS, DnI, data);
+ res = FIELD_DP32(res, PACFAIL_ISS, BnA, keynumber);
+
+ return res;
}
+/*
+ * ISS encoding for an exception from a trapped Pointer
+ * Authentication instruction is RES0
+ */
static inline uint32_t syn_pactrap(void)
{
- return (EC_PACTRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL;
+ uint32_t res = syn_set_ec(0, EC_PACTRAP);
+ res = FIELD_DP32(res, SYNDROME, IL, 1);
+ return res;
}
static inline uint32_t syn_btitrap(int btype)
--
2.47.3