mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
target/arm: Report correct syndrome for FP/SIMD traps to Hyp mode
For traps of FP/SIMD instructions to AArch32 Hyp mode, the syndrome provided in HSR has more information than is reported to AArch64. Specifically, there are extra fields TA and coproc which indicate whether the trapped instruction was FP or SIMD. Add this extra information to the syndromes we construct, and mask it out when taking the exception to AArch64. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20181012144235.19646-11-peter.maydell@linaro.org
This commit is contained in:
parent
2ed08180db
commit
4be42f4013
3 changed files with 26 additions and 5 deletions
|
@ -288,6 +288,9 @@ static inline uint32_t syn_get_ec(uint32_t syn)
|
|||
* few cases the value in HSR for exceptions taken to AArch32 Hyp
|
||||
* mode differs slightly, and we fix this up when populating HSR in
|
||||
* arm_cpu_do_interrupt_aarch32_hyp().
|
||||
* The exception is FP/SIMD access traps -- these report extra information
|
||||
* when taking an exception to AArch32. For those we include the extra coproc
|
||||
* and TA fields, and mask them out when taking the exception to AArch64.
|
||||
*/
|
||||
static inline uint32_t syn_uncategorized(void)
|
||||
{
|
||||
|
@ -387,9 +390,18 @@ static inline uint32_t syn_cp15_rrt_trap(int cv, int cond, int opc1, int crm,
|
|||
|
||||
static inline uint32_t syn_fp_access_trap(int cv, int cond, bool is_16bit)
|
||||
{
|
||||
/* AArch32 FP trap or any AArch64 FP/SIMD trap: TA == 0 coproc == 0xa */
|
||||
return (EC_ADVSIMDFPACCESSTRAP << ARM_EL_EC_SHIFT)
|
||||
| (is_16bit ? 0 : ARM_EL_IL)
|
||||
| (cv << 24) | (cond << 20);
|
||||
| (cv << 24) | (cond << 20) | 0xa;
|
||||
}
|
||||
|
||||
static inline uint32_t syn_simd_access_trap(int cv, int cond, bool is_16bit)
|
||||
{
|
||||
/* AArch32 SIMD trap: TA == 1 coproc == 0 */
|
||||
return (EC_ADVSIMDFPACCESSTRAP << ARM_EL_EC_SHIFT)
|
||||
| (is_16bit ? 0 : ARM_EL_IL)
|
||||
| (cv << 24) | (cond << 20) | (1 << 5);
|
||||
}
|
||||
|
||||
static inline uint32_t syn_sve_access_trap(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue