mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 11:04:58 -06:00
target-arm: Handle the CPU being in AArch32 mode in the AArch64 set_pc
The AArch64 implementation of the set_pc method needs to be updated to handle the possibility that the CPU is in AArch32 mode; otherwise there are weird crashes when doing interprocessing in system emulation mode when an interrupt occurs and we fail to resynchronize the 32-bit PC with the TB we need to execute next. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
This commit is contained in:
parent
c29f9a0a29
commit
7633378d5f
1 changed files with 8 additions and 4 deletions
|
@ -172,11 +172,15 @@ static void aarch64_cpu_finalizefn(Object *obj)
|
||||||
static void aarch64_cpu_set_pc(CPUState *cs, vaddr value)
|
static void aarch64_cpu_set_pc(CPUState *cs, vaddr value)
|
||||||
{
|
{
|
||||||
ARMCPU *cpu = ARM_CPU(cs);
|
ARMCPU *cpu = ARM_CPU(cs);
|
||||||
/*
|
/* It's OK to look at env for the current mode here, because it's
|
||||||
* TODO: this will need updating for system emulation,
|
* never possible for an AArch64 TB to chain to an AArch32 TB.
|
||||||
* when the core may be in AArch32 mode.
|
* (Otherwise we would need to use synchronize_from_tb instead.)
|
||||||
*/
|
*/
|
||||||
cpu->env.pc = value;
|
if (is_a64(&cpu->env)) {
|
||||||
|
cpu->env.pc = value;
|
||||||
|
} else {
|
||||||
|
cpu->env.regs[15] = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aarch64_cpu_class_init(ObjectClass *oc, void *data)
|
static void aarch64_cpu_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue