From: Lars Munch <lars@segv.dk>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] linux-user: fix running programs with iwmmxt instructions
Date: Mon, 15 Mar 2010 17:14:47 +0100 [thread overview]
Message-ID: <20100315161447.GD8895@firewall> (raw)
In-Reply-To: <201003151253.25543.paul@codesourcery.com>
On Mon, Mar 15, 2010 at 12:53:25PM +0000, Paul Brook wrote:
> > +#if !defined(CONFIG_USER_ONLY)
> > if (arm_feature(env, ARM_FEATURE_XSCALE)
> > && ((env->cp15.c15_cpar ^ 0x3fff) & (1 << cpnum)))
> > return 1;
> > +#endif
>
> This is almost certainly the wrong way to fix this.
>
> Paul
>
Here is a different fix. Hopefully I am on the right track this time. This
patch inits the cpu to have CP0 and/or CP1 accessible from the beginning if in
linux-user mode.
Signed-off-by: Lars Munch <lars@segv.dk>
---
target-arm/helper.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 1a181ac..3a55da2 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -165,6 +165,9 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
/* JTAG_ID is ((id << 28) | 0x09265013) */
env->cp15.c0_cachetype = 0xd172172;
env->cp15.c1_sys = 0x00000078;
+#if defined (CONFIG_USER_ONLY)
+ env->cp15.c15_cpar = 0x00000001;
+#endif
break;
case ARM_CPUID_PXA270_A0:
case ARM_CPUID_PXA270_A1:
@@ -178,6 +181,9 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)
env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
env->cp15.c0_cachetype = 0xd172172;
env->cp15.c1_sys = 0x00000078;
+#if defined (CONFIG_USER_ONLY)
+ env->cp15.c15_cpar = 0x00000003;
+#endif
break;
default:
cpu_abort(env, "Bad CPU ID: %x\n", id);
--
1.7.0
prev parent reply other threads:[~2010-03-15 16:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 12:39 [Qemu-devel] [PATCH] linux-user: fix running programs with iwmmxt instructions Lars Munch
2010-03-15 12:53 ` Paul Brook
2010-03-15 16:14 ` Lars Munch [this message]
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=20100315161447.GD8895@firewall \
--to=lars@segv.dk \
--cc=paul@codesourcery.com \
--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).