[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 21/27] target/arm: make further preparation for the exception
From: |
Fabiano Rosas |
Subject: |
[RFC PATCH 21/27] target/arm: make further preparation for the exception code to move |
Date: |
Wed, 4 Jan 2023 18:58:29 -0300 |
From: Claudio Fontana <cfontana@suse.de>
the exception code needs some adjustment before being exposed to
KVM-only builds. We need to call arm_rebuild_hflags only when TCG is
enabled, or we will error out.
The direct call to helper_rebuild_hflags_a64(env, new_el) will not
be possible when extracting out to common code,
it seems safe to replace it with a call to arm_rebuild_hflags, since
the write to pstate is already done.
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
target/arm/helper.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index bea1ef242a..a536d77611 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -1131,7 +1131,9 @@ static void take_aarch32_exception(CPUARMState *env, int
new_mode,
env->regs[14] = env->regs[15] + offset;
}
env->regs[15] = newpc;
- arm_rebuild_hflags(env);
+ if (tcg_enabled()) {
+ arm_rebuild_hflags(env);
+ }
}
static void arm_cpu_do_interrupt_aarch32_hyp(CPUState *cs)
@@ -1687,7 +1689,11 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
pstate_write(env, PSTATE_DAIF | new_mode);
env->aarch64 = true;
aarch64_restore_sp(env, new_el);
- helper_rebuild_hflags_a64(env, new_el);
+
+ if (tcg_enabled()) {
+ /* pstate already written, so we can use arm_rebuild_hflags here */
+ arm_rebuild_hflags(env);
+ }
env->pc = addr;
--
2.35.3
- Re: [RFC PATCH 17/27] target/arm: Extract cpustate list manipulation to a file, (continued)
- [RFC PATCH 13/27] target/arm: move translate modules to tcg/, Fabiano Rosas, 2023/01/04
- [RFC PATCH 14/27] target/arm: Move regime_using_lpae_format into internal.h, Fabiano Rosas, 2023/01/04
- [RFC PATCH 18/27] target/arm: Move cpregs code out of cpu.h, Fabiano Rosas, 2023/01/04
- [RFC PATCH 19/27] target/arm: Move common cpregs code into a separate file, Fabiano Rosas, 2023/01/04
- [RFC PATCH 21/27] target/arm: make further preparation for the exception code to move,
Fabiano Rosas <=
- [RFC PATCH 20/27] target/arm: Move cpregs definitions into tcg/cpregs.c, Fabiano Rosas, 2023/01/04
- [RFC PATCH 24/27] tests: do not run qom-test on all machines for ARM KVM-only, Fabiano Rosas, 2023/01/04
- [RFC PATCH 22/27] target/arm: Move hflags code into the tcg directory, Fabiano Rosas, 2023/01/04
- [RFC PATCH 23/27] tests: do not run test-hmp on all machines for ARM KVM-only, Fabiano Rosas, 2023/01/04
- [RFC PATCH 27/27] target/arm: don't access TCG code when debugging with KVM, Fabiano Rosas, 2023/01/04
- [RFC PATCH 25/27] tests: device-introspect-test: cope with ARM TCG-only devices, Fabiano Rosas, 2023/01/04