[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bit
From: |
Niek Linnenbank |
Subject: |
[PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on() |
Date: |
Tue, 17 Dec 2019 00:35:15 +0100 |
After setting CP15 bits in arm_set_cpu_on() the cached hflags must
be rebuild to reflect the changed processor state. Without rebuilding,
the cached hflags would be inconsistent until the next call to
arm_rebuild_hflags(). When QEMU is compiled with debugging enabled
(--enable-debug), this problem is captured shortly after the first
call to arm_set_cpu_on() for CPUs running in ARM 32-bit non-secure mode:
qemu-system-arm: target/arm/helper.c:11359: cpu_get_tb_cpu_state:
Assertion `flags == rebuild_hflags_internal(env)' failed.
Aborted (core dumped)
Fixes: 0c7f8c43daf65
Signed-off-by: Niek Linnenbank <address@hidden>
---
target/arm/arm-powerctl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index b064513d44..b75f813b40 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -127,6 +127,9 @@ static void arm_set_cpu_on_async_work(CPUState
*target_cpu_state,
target_cpu->env.regs[0] = info->context_id;
}
+ /* CP15 update requires rebuilding hflags */
+ arm_rebuild_hflags(&target_cpu->env);
+
/* Start the new CPU at the requested address */
cpu_set_pc(target_cpu_state, info->entry);
--
2.17.1
- [PATCH v2 00/10] Add Allwinner H3 SoC and Orange Pi PC Machine, Niek Linnenbank, 2019/12/16
- [PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(),
Niek Linnenbank <=
- Re: [PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(), Niek Linnenbank, 2019/12/16
- Re: [PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(), Peter Maydell, 2019/12/17
- Re: [PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(), Richard Henderson, 2019/12/17
- Re: [PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(), Peter Maydell, 2019/12/17
- Re: [PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(), Niek Linnenbank, 2019/12/18
- Re: [PATCH v2 06/10] arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on(), Richard Henderson, 2019/12/18
[PATCH v2 04/10] arm: allwinner-h3: add USB host controller, Niek Linnenbank, 2019/12/16
[PATCH v2 05/10] arm: allwinner-h3: add System Control module, Niek Linnenbank, 2019/12/16
[PATCH v2 03/10] arm: allwinner-h3: add Clock Control Unit, Niek Linnenbank, 2019/12/16
[PATCH v2 01/10] hw: arm: add Allwinner H3 System-on-Chip, Niek Linnenbank, 2019/12/16