mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
target/arm: Implement FEAT_FPAC and FEAT_FPACCOMBINE
Signed-off-by: Aaron Lindsay <aaron@os.amperecomputing.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20230829232335.965414-10-richard.henderson@linaro.org Message-Id: <20230609172324.982888-8-aaron@os.amperecomputing.com> [rth: Simplify fpac comparison, reusing cmp_mask] Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
28b9dcb74b
commit
8a69a42340
4 changed files with 27 additions and 2 deletions
|
@ -396,6 +396,14 @@ static uint64_t pauth_original_ptr(uint64_t ptr, ARMVAParameters param)
|
|||
}
|
||||
}
|
||||
|
||||
static G_NORETURN
|
||||
void pauth_fail_exception(CPUARMState *env, bool data,
|
||||
int keynumber, uintptr_t ra)
|
||||
{
|
||||
raise_exception_ra(env, EXCP_UDEF, syn_pacfail(data, keynumber),
|
||||
exception_target_el(env), ra);
|
||||
}
|
||||
|
||||
static uint64_t pauth_auth(CPUARMState *env, uint64_t ptr, uint64_t modifier,
|
||||
ARMPACKey *key, bool data, int keynumber,
|
||||
uintptr_t ra, bool is_combined)
|
||||
|
@ -416,7 +424,15 @@ static uint64_t pauth_auth(CPUARMState *env, uint64_t ptr, uint64_t modifier,
|
|||
cmp_mask &= ~MAKE_64BIT_MASK(55, 1);
|
||||
|
||||
if (pauth_feature >= PauthFeat_2) {
|
||||
return ptr ^ (pac & cmp_mask);
|
||||
ARMPauthFeature fault_feature =
|
||||
is_combined ? PauthFeat_FPACCOMBINED : PauthFeat_FPAC;
|
||||
uint64_t result = ptr ^ (pac & cmp_mask);
|
||||
|
||||
if (pauth_feature >= fault_feature
|
||||
&& ((result ^ sextract64(result, 55, 1)) & cmp_mask)) {
|
||||
pauth_fail_exception(env, data, keynumber, ra);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if ((pac ^ ptr) & cmp_mask) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue