diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2019-06-09 15:22:49 -0700 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-06-13 15:14:03 +0100 |
commit | d67ebada159148bfdfde84871338738e4465e985 (patch) | |
tree | 1a22c5021c3d4cee752a06149c42b6dd9f71f488 /target | |
parent | be1ba4d56eba5666ee03b40e286d7315862ab188 (diff) |
target/arm: Fix output of PAuth Auth
The ARM pseudocode installs the error_code into the original
pointer, not the encrypted pointer. The difference applies
within the 7 bits of pac data; the result should be the sign
extension of bit 55.
Add a testcase to that effect.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/arm/pauth_helper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c index 7f30ae7395..d3194f2043 100644 --- a/target/arm/pauth_helper.c +++ b/target/arm/pauth_helper.c @@ -344,9 +344,9 @@ static uint64_t pauth_auth(CPUARMState *env, uint64_t ptr, uint64_t modifier, if (unlikely(extract64(test, bot_bit, top_bit - bot_bit))) { int error_code = (keynumber << 1) | (keynumber ^ 1); if (param.tbi) { - return deposit64(ptr, 53, 2, error_code); + return deposit64(orig_ptr, 53, 2, error_code); } else { - return deposit64(ptr, 61, 2, error_code); + return deposit64(orig_ptr, 61, 2, error_code); } } return orig_ptr; |