target/arm: Fix SVE system register access checks

Leave ARM_CP_SVE, removing ARM_CP_FPU; the sve_access_check
produced by the flag already includes fp_access_check. If
we also check ARM_CP_FPU the double fp_access_check asserts.

Backports commit 11d7870b1b4d038d7beb827f3afa72e284701351 from qemu
This commit is contained in:
Richard Henderson 2018-07-03 05:07:07 -04:00 committed by Lioncash
parent f64e48dbee
commit 6d81235ebb
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 6 additions and 7 deletions

View file

@ -3851,25 +3851,25 @@ static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
}
static const ARMCPRegInfo zcr_el1_reginfo = {
"ZCR_EL1", 0,1,2, 3,0,0, ARM_CP_STATE_AA64, ARM_CP_SVE | ARM_CP_FPU,
"ZCR_EL1", 0,1,2, 3,0,0, ARM_CP_STATE_AA64, ARM_CP_SVE,
PL1_RW, 0, NULL, 0, offsetof(CPUARMState, vfp.zcr_el[1]), {0, 0},
NULL, NULL, zcr_write, NULL, raw_write
};
static const ARMCPRegInfo zcr_el2_reginfo = {
"ZCR_EL2", 0,1,2, 3,4,0, ARM_CP_STATE_AA64, ARM_CP_SVE | ARM_CP_FPU,
"ZCR_EL2", 0,1,2, 3,4,0, ARM_CP_STATE_AA64, ARM_CP_SVE,
PL2_RW, 0, NULL, 0, offsetof(CPUARMState, vfp.zcr_el[2]), {0, 0},
NULL, NULL, zcr_write, NULL, raw_write
};
static const ARMCPRegInfo zcr_no_el2_reginfo = {
"ZCR_EL2", 0,1,2, 3,4,0, ARM_CP_STATE_AA64, ARM_CP_SVE | ARM_CP_FPU,
"ZCR_EL2", 0,1,2, 3,4,0, ARM_CP_STATE_AA64, ARM_CP_SVE,
PL2_RW, 0, NULL, 0, 0, {0, 0},
NULL, arm_cp_read_zero, arm_cp_write_ignore
};
static const ARMCPRegInfo zcr_el3_reginfo = {
"ZCR_EL3", 0,1,2, 3,6,0, ARM_CP_STATE_AA64, ARM_CP_SVE | ARM_CP_FPU,
"ZCR_EL3", 0,1,2, 3,6,0, ARM_CP_STATE_AA64, ARM_CP_SVE,
PL3_RW, 0, NULL, 0, offsetof(CPUARMState, vfp.zcr_el[3]), {0, 0},
NULL, NULL, zcr_write, NULL, raw_write
};

View file

@ -1698,11 +1698,10 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
default:
break;
}
if ((ri->type & ARM_CP_SVE) && !sve_access_check(s)) {
return;
}
if ((ri->type & ARM_CP_FPU) && !fp_access_check(s)) {
return;
} else if ((ri->type & ARM_CP_SVE) && !sve_access_check(s)) {
return;
}
// Unicorn: if'd out