[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 19/20] target/arm: Rebuild hflags for M-profile.
From: |
Peter Maydell |
Subject: |
Re: [PATCH v7 19/20] target/arm: Rebuild hflags for M-profile. |
Date: |
Fri, 18 Oct 2019 13:25:49 +0100 |
On Thu, 17 Oct 2019 at 19:51, Richard Henderson
<address@hidden> wrote:
>
> Continue setting, but not relying upon, env->hflags.
>
> Reviewed-by: Alex Bennée <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> v7: Add rebuilds for v7m_msr and nvic_writel to v7m.ccr.
> ---
> hw/intc/armv7m_nvic.c | 1 +
> target/arm/m_helper.c | 6 ++++++
> target/arm/translate.c | 5 ++++-
> 3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
> index 8e93e51e81..a3993e7b72 100644
> --- a/hw/intc/armv7m_nvic.c
> +++ b/hw/intc/armv7m_nvic.c
> @@ -1604,6 +1604,7 @@ static void nvic_writel(NVICState *s, uint32_t offset,
> uint32_t value,
> }
>
> cpu->env.v7m.ccr[attrs.secure] = value;
> + arm_rebuild_hflags(&cpu->env);
> break;
> case 0xd24: /* System Handler Control and State (SHCSR) */
> if (!arm_feature(&cpu->env, ARM_FEATURE_V7)) {
This seems fragile -- we have to remember to add in
a call to arm_rebuild_hflags() for every individual
case of a memory-mapped system register that we choose
to cache in tb flags. It doesn't seem consistent with
the choice for A-profile to rebuild hflags for pretty
much any sysreg write. Maybe it would be better to just
always rebuild hflags at the end of nvic_sysreg_write() ?
thanks
-- PMM
- [PATCH v7 17/20] target/arm: Rebuild hflags at MSR writes, (continued)
- [PATCH v7 15/20] target/arm: Add HELPER(rebuild_hflags_{a32, a64, m32}), Richard Henderson, 2019/10/17
- [PATCH v7 13/20] target/arm: Split out arm_mmu_idx_el, Richard Henderson, 2019/10/17
- [PATCH v7 16/20] target/arm: Rebuild hflags at EL changes, Richard Henderson, 2019/10/17
- [PATCH v7 14/20] target/arm: Hoist store to cs_base in cpu_get_tb_cpu_state, Richard Henderson, 2019/10/17
- [PATCH v7 18/20] target/arm: Rebuild hflags at CPSR writes, Richard Henderson, 2019/10/17
- [PATCH v7 19/20] target/arm: Rebuild hflags for M-profile., Richard Henderson, 2019/10/17
- Re: [PATCH v7 19/20] target/arm: Rebuild hflags for M-profile.,
Peter Maydell <=
[PATCH v7 20/20] target/arm: Rely on hflags correct in cpu_get_tb_cpu_state, Richard Henderson, 2019/10/17
[PATCH v7 12/20] target/arm: Add arm_rebuild_hflags, Richard Henderson, 2019/10/17