* [Qemu-devel] [PATCH V2] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270
@ 2011-11-09 13:37 Benoît Canet
2011-11-09 13:37 ` [Qemu-devel] [PATCH] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features Benoît Canet
0 siblings, 1 reply; 2+ messages in thread
From: Benoît Canet @ 2011-11-09 13:37 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet
A VFP was detected for pxa270 causing an "Illegal instruction"
exception.
The eglibc was not receiving the right AT_HWCAP from elfloader.c.
This version fix typos.
Benoît Canet (1):
arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features.
linux-user/elfload.c | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features.
2011-11-09 13:37 [Qemu-devel] [PATCH V2] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
@ 2011-11-09 13:37 ` Benoît Canet
0 siblings, 0 replies; 2+ messages in thread
From: Benoît Canet @ 2011-11-09 13:37 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet
The cpu capabilities passed by the elf loader in AT_HWCAP where
a constant.
Make AT_HWCAP reflect the emulated cpu features in order to give
correct clues to eglibc.
Fix : [Bug 887516] [NEW] VFP support reported for the PXA270
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
linux-user/elfload.c | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index a413976..c22ccf4 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -375,10 +375,33 @@ bool guest_validate_base(unsigned long guest_base)
return 1; /* All good */
}
-#define ELF_HWCAP (ARM_HWCAP_ARM_SWP | ARM_HWCAP_ARM_HALF \
- | ARM_HWCAP_ARM_THUMB | ARM_HWCAP_ARM_FAST_MULT \
- | ARM_HWCAP_ARM_FPA | ARM_HWCAP_ARM_VFP \
- | ARM_HWCAP_ARM_NEON | ARM_HWCAP_ARM_VFPv3 )
+
+#define ELF_HWCAP get_elf_hwcap()
+
+static uint32_t get_elf_hwcap(void)
+{
+ CPUState *e = thread_env;
+ uint32_t hwcaps = 0;
+
+ hwcaps |= ARM_HWCAP_ARM_SWP;
+ hwcaps |= ARM_HWCAP_ARM_HALF;
+ hwcaps |= ARM_HWCAP_ARM_THUMB;
+ hwcaps |= ARM_HWCAP_ARM_FAST_MULT;
+ hwcaps |= ARM_HWCAP_ARM_FPA;
+
+ /* probe for the extra features */
+#define GET_FEATURE(feat, hwcap) \
+ do {if (arm_feature(e, feat)) { hwcaps |= hwcap; } } while (0)
+ GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP);
+ GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT);
+ GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE);
+ GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON);
+ GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3);
+ GET_FEATURE(ARM_FEATURE_VFP_FP16, ARM_HWCAP_ARM_VFPv3D16);
+#undef GET_FEATURE
+
+ return hwcaps;
+}
#endif
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-09 13:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 13:37 [Qemu-devel] [PATCH V2] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
2011-11-09 13:37 ` [Qemu-devel] [PATCH] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features Benoît Canet
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).