[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 18/20] target/arm: Rebuild hflags at CPSR writes
From: |
Richard Henderson |
Subject: |
Re: [PATCH v6 18/20] target/arm: Rebuild hflags at CPSR writes |
Date: |
Mon, 14 Oct 2019 12:15:02 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 10/14/19 12:08 PM, Alex Bennée wrote:
>
> Richard Henderson <address@hidden> writes:
>
>> Continue setting, but not relying upon, env->hflags.
>>
>> Signed-off-by: Richard Henderson <address@hidden>
>> ---
>> target/arm/op_helper.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
>> index ccc2cecb46..b529d6c1bf 100644
>> --- a/target/arm/op_helper.c
>> +++ b/target/arm/op_helper.c
>> @@ -224,6 +224,7 @@ uint32_t HELPER(usat16)(CPUARMState *env, uint32_t x,
>> uint32_t shift)
>> void HELPER(setend)(CPUARMState *env)
>> {
>> env->uncached_cpsr ^= CPSR_E;
>> + arm_rebuild_hflags(env);
>> }
>>
>> /* Function checks whether WFx (WFI/WFE) instructions are set up to be
>> trapped.
>> @@ -387,6 +388,8 @@ uint32_t HELPER(cpsr_read)(CPUARMState *env)
>> void HELPER(cpsr_write)(CPUARMState *env, uint32_t val, uint32_t mask)
>> {
>> cpsr_write(env, val, mask, CPSRWriteByInstr);
>> + /* TODO: Not all cpsr bits are relevant to hflags. */
>
> Do you mean by this we could check which bits changed and avoid a
> re-compute if we wanted to? Is it likely to be anything other than the
> SS_ACTIVE bit?
Yes. Well, there's also NZCV. But neither case happens particularly often, so
it's probably not worth worrying about.
r~
- [PATCH v6 13/20] target/arm: Split out arm_mmu_idx_el, (continued)
- [PATCH v6 13/20] target/arm: Split out arm_mmu_idx_el, Richard Henderson, 2019/10/11
- [PATCH v6 14/20] target/arm: Hoist store to cs_base in cpu_get_tb_cpu_state, Richard Henderson, 2019/10/11
- [PATCH v6 15/20] target/arm: Add HELPER(rebuild_hflags_{a32, a64, m32}), Richard Henderson, 2019/10/11
- [PATCH v6 17/20] target/arm: Rebuild hflags at MSR writes, Richard Henderson, 2019/10/11
- [PATCH v6 18/20] target/arm: Rebuild hflags at CPSR writes, Richard Henderson, 2019/10/11
- [PATCH v6 19/20] target/arm: Rebuild hflags for M-profile., Richard Henderson, 2019/10/11
- [PATCH v6 20/20] target/arm: Rely on hflags correct in cpu_get_tb_cpu_state, Richard Henderson, 2019/10/11
- [PATCH v6 16/20] target/arm: Rebuild hflags at EL changes, Richard Henderson, 2019/10/11
- Re: [PATCH v6 00/20] target/arm: Reduce overhead of cpu_get_tb_cpu_state, Peter Maydell, 2019/10/17