|
From: | Richard Henderson |
Subject: | Re: [PATCH v2 08/30] bsd-user/arm/target_arch_cpu.h: Implement trivial EXCP exceptions |
Date: | Tue, 2 Nov 2021 23:17:29 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 11/2/21 6:52 PM, Warner Losh wrote:
+ case EXCP_UDEF: + { + /* See arm/arm/undefined.c undefinedinstruction(); */ + info.si_addr = env->regs[15]; + + /* + * Make sure the PC is correctly aligned. (It should + * be.) + */ + if ((info.si_addr & 3) != 0) { + info.si_signo = TARGET_SIGILL; + info.si_errno = 0; + info.si_code = TARGET_ILL_ILLADR; + queue_signal(env, info.si_signo, &info);
You won't need this; unaligned pc will raise a different exception.
+ } else { + int rc = 0; +#ifdef NOT_YET + uint32_t opcode; + + /* + * Get the opcode. + * + * FIXME - what to do if get_user() fails? + */ + get_user_u32(opcode, env->regs[15]); + + /* Check the opcode with CP handlers we may have. */ + rc = EmulateAll(opcode, &ts->fpa, env); +#endif /* NOT_YET */
Drop this til you need it. Even then, we prefer to emulate all insns in the front-end. We can talk about what changes need to happen such that the actual CP registers are simply available at EL0. I suspect they've already been done for linux-user anyway...
r~
[Prev in Thread] | Current Thread | [Next in Thread] |