arm: Always enable access to coprocessors initially

Allows non-AArch64 environments to always access coprocessors initially.
Removes the need to do avoidable register management when testing
floating-point code.
This commit is contained in:
Lioncash 2019-04-13 19:21:49 -04:00
parent 5bcb1e13ab
commit ddcf400955
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 14 additions and 12 deletions

View file

@ -210,21 +210,23 @@ static void arm_cpu_reset(CPUState *s)
env->pc = cpu->rvbar;
#endif
} else {
#if defined(CONFIG_USER_ONLY)
// Unicorn: commented out to always allow accesses to FP/Neon
//#if defined(CONFIG_USER_ONLY)
/* Userspace expects access to cp10 and cp11 for FP/Neon */
env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 20, 4, 0xf);
#endif
//#endif
}
#if defined(CONFIG_USER_ONLY)
env->uncached_cpsr = ARM_CPU_MODE_USR;
/* For user mode we must enable access to coprocessors */
// Unicorn: Always enable access to the coprocessors initially.
env->vfp.xregs[ARM_VFP_FPEXC] = 1 << 30;
if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
env->cp15.c15_cpar = 3;
} else if (arm_feature(env, ARM_FEATURE_XSCALE)) {
env->cp15.c15_cpar = 1;
}
#if defined(CONFIG_USER_ONLY)
env->uncached_cpsr = ARM_CPU_MODE_USR;
#else
/*
* If the highest available EL is EL2, AArch32 will start in Hyp

View file

@ -13644,6 +13644,13 @@ static bool arm_pre_translate_insn(DisasContext *dc)
}
#endif
// Unicorn: end address tells us to stop emulation
if (dc->pc == dc->uc->addr_end) {
// imitate WFI instruction to halt emulation
dc->base.is_jmp = DISAS_WFI;
return true;
}
if (dc->ss_active && !dc->pstate_ss) {
/* Singlestep state is Active-pending.
* If we're in this state at the start of a TB then either
@ -13667,13 +13674,6 @@ static bool arm_pre_translate_insn(DisasContext *dc)
static void arm_post_translate_insn(DisasContext *dc)
{
// Unicorn: end address tells us to stop emulation
if (dc->pc == dc->uc->addr_end) {
// imitate WFI instruction to halt emulation
dc->base.is_jmp = DISAS_WFI;
return;
}
if (dc->condjmp && !dc->base.is_jmp) {
TCGContext *tcg_ctx = dc->uc->tcg_ctx;
gen_set_label(tcg_ctx, dc->condlabel);