From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Christophe Lyon <christophe.lyon@linaro.org>
Subject: [PATCH 3/3] target/arm: Consolidate ifdef blocks in reset
Date: Tue, 14 Sep 2021 13:07:25 +0100 [thread overview]
Message-ID: <20210914120725.24992-4-peter.maydell@linaro.org> (raw)
In-Reply-To: <20210914120725.24992-1-peter.maydell@linaro.org>
Move an ifndef CONFIG_USER_ONLY code block up in arm_cpu_reset() so
it can be merged with another earlier one.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/cpu.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 7b1665a1d0c..4df640b9974 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -265,6 +265,16 @@ static void arm_cpu_reset(DeviceState *dev)
env->uncached_cpsr = ARM_CPU_MODE_SVC;
}
env->daif = PSTATE_D | PSTATE_A | PSTATE_I | PSTATE_F;
+
+ /* AArch32 has a hard highvec setting of 0xFFFF0000. If we are currently
+ * executing as AArch32 then check if highvecs are enabled and
+ * adjust the PC accordingly.
+ */
+ if (A32_BANKED_CURRENT_REG_GET(env, sctlr) & SCTLR_V) {
+ env->regs[15] = 0xFFFF0000;
+ }
+
+ env->vfp.xregs[ARM_VFP_FPEXC] = 0;
#endif
if (arm_feature(env, ARM_FEATURE_M)) {
@@ -372,18 +382,6 @@ static void arm_cpu_reset(DeviceState *dev)
#endif
}
-#ifndef CONFIG_USER_ONLY
- /* AArch32 has a hard highvec setting of 0xFFFF0000. If we are currently
- * executing as AArch32 then check if highvecs are enabled and
- * adjust the PC accordingly.
- */
- if (A32_BANKED_CURRENT_REG_GET(env, sctlr) & SCTLR_V) {
- env->regs[15] = 0xFFFF0000;
- }
-
- env->vfp.xregs[ARM_VFP_FPEXC] = 0;
-#endif
-
/* M profile requires that reset clears the exclusive monitor;
* A profile does not, but clearing it makes more sense than having it
* set with an exclusive access on address zero.
--
2.20.1
next prev parent reply other threads:[~2021-09-14 12:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 12:07 [PATCH 0/3] target/arm: Set FPSCR.LTPSIZE for user-mode Peter Maydell
2021-09-14 12:07 ` [PATCH 1/3] target/arm: Don't skip M-profile reset entirely in user mode Peter Maydell
2021-09-14 12:07 ` [PATCH 2/3] target/arm: Always clear exclusive monitor on reset Peter Maydell
2021-09-14 12:07 ` Peter Maydell [this message]
2021-09-14 13:10 ` [PATCH 0/3] target/arm: Set FPSCR.LTPSIZE for user-mode Richard Henderson
2021-09-15 9:57 ` Christophe Lyon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210914120725.24992-4-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=christophe.lyon@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).