qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ARM: Permit any ARMv6K CPU to read the MVFR0 and MVFR1 VFP registers.
@ 2012-03-28 14:37 Andrew Towers
  2012-03-28 15:24 ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Towers @ 2012-03-28 14:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Paul Brook, Andrew Towers

From: Andrew Towers <atowers@gmail.com>

Replaces the ARM_FEATURE_VFP3 check when reading MVFR0/1 with a check for
ARM_FEATURE_V6K. Rationale: MVFR0/1 were introduced in the ARM1136 at the
same time as ARMv6K, and a survey of TRMs indicates support in later models.

According to reference documentation on arm.com, MVFR0 and MVFR1 were
introduced in ARM1136JF-S r1p1 (ARMv6K, VFPv2). They are also present in
ARM1156T2F-S and ARM1176JZF-S, which contain VFP11 r5, and in ARM11 MPCore
r1 which contains VFP11 r4.

Reference (ARM DDI 0211H, 0290G, 0301H, 0360E)
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0211h/Ffbefjag.html

Without this change, the linux kernel will not boot with VFP support enabled
under ARM1176 system emulation, due to the unconditional use of MVFR1 at the
end of vfp_init() in arch/arm/vfp/vfpmodule.c in the kernel:

  VFP support v0.3: implemetor 41 architecture 1 part 20 variant b rev 5
  Internal error: Oops - undefined instruction: 0 [#1]

Yes, I am slightly abusing the versatilepb hw emulation, but then so is
everyone else in the world who is still waiting for their Raspberry Pi ;)

Signed-off-by: Andrew Towers <atowers@gmail.com>
---
 target-arm/translate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 81725d1..b5861c8 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -2906,7 +2906,7 @@ static int disas_vfp_insn(CPUARMState * env, DisasContext *s, uint32_t insn)
                         case ARM_VFP_MVFR0:
                         case ARM_VFP_MVFR1:
                             if (IS_USER(s)
-                                || !arm_feature(env, ARM_FEATURE_VFP3))
+                                || !arm_feature(env, ARM_FEATURE_V6K))
                                 return 1;
                             tmp = load_cpu_field(vfp.xregs[rn]);
                             break;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-29 13:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-28 14:37 [Qemu-devel] [PATCH] ARM: Permit any ARMv6K CPU to read the MVFR0 and MVFR1 VFP registers Andrew Towers
2012-03-28 15:24 ` Peter Maydell
2012-03-29 12:41   ` [Qemu-devel] [PATCH v2] " Andrew Towers
2012-03-29 13:10     ` Andreas Färber
2012-03-29 13:46     ` Peter Maydell

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).