[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 2/4] target/arm: only update pc after semihosting complete
From: |
Richard Henderson |
Subject: |
Re: [PATCH v1 2/4] target/arm: only update pc after semihosting completes |
Date: |
Wed, 18 Dec 2019 09:45:15 -1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 12/18/19 8:00 AM, Alex Bennée wrote:
> Before we introduce blocking semihosting calls we need to ensure we
> can restart the system on semi hosting exception. To be able to do
> this the EXCP_SEMIHOST operation should be idempotent until it finally
> completes. Practically this means ensureing we only update the pc
ensuring.
> after the semihosting call has completed.
>
> Signed-off-by: Alex Bennée <address@hidden>
> ---
> linux-user/aarch64/cpu_loop.c | 1 +
> linux-user/arm/cpu_loop.c | 1 +
> target/arm/helper.c | 2 ++
> target/arm/m_helper.c | 1 +
> target/arm/translate-a64.c | 2 +-
> target/arm/translate.c | 6 +++---
> 6 files changed, 9 insertions(+), 4 deletions(-)
...
> +++ b/target/arm/m_helper.c
> @@ -2185,6 +2185,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
> "...handling as semihosting call 0x%x\n",
> env->regs[0]);
> env->regs[0] = do_arm_semihosting(env);
> + env->regs[15] += env->thumb ? 2 : 4;
... although thumb should never be false here, it does match the other
instances.
I do wonder if it's worth inventing do_arm{32,64}_semihosting wrappers that
consolidate this register manipulation.
But either way,
Reviewed-by: Richard Henderson <address@hidden>
r~
- [PATCH v1 0/4] semihosting read console support, Alex Bennée, 2019/12/18
- [PATCH v1 1/4] target/arm: remove unused EXCP_SEMIHOST leg, Alex Bennée, 2019/12/18
- [PATCH v1 2/4] target/arm: only update pc after semihosting completes, Alex Bennée, 2019/12/18
- Re: [PATCH v1 2/4] target/arm: only update pc after semihosting completes,
Richard Henderson <=
- [PATCH v1 3/4] semihosting: add qemu_semihosting_console_inc for SYS_READC, Alex Bennée, 2019/12/18
- [PATCH v1 4/4] tests/tcg: add a dumb-as-bricks semihosting console test, Alex Bennée, 2019/12/18
- Re: [PATCH v1 0/4] semihosting read console support, Keith Packard, 2019/12/18