* [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c
2011-11-09 14:41 [Qemu-devel] [PATCH V3] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
@ 2011-11-09 14:41 ` Benoît Canet
2011-11-09 14:47 ` Peter Maydell
0 siblings, 1 reply; 11+ messages in thread
From: Benoît Canet @ 2011-11-09 14:41 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet, afaerber
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
target-arm/cpu.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index c4d742f..e51bc8a 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -353,6 +353,8 @@ enum arm_cpu_mode {
#define ARM_IWMMXT_wCGR2 10
#define ARM_IWMMXT_wCGR3 11
+/* remember to update linux-user/elfload.c get_elf_hwcap arm's
+ * version when adding a feature */
enum arm_features {
ARM_FEATURE_VFP,
ARM_FEATURE_AUXCR, /* ARM1026 Auxiliary control register. */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c
2011-11-09 14:41 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
@ 2011-11-09 14:47 ` Peter Maydell
0 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2011-11-09 14:47 UTC (permalink / raw)
To: Benoît Canet; +Cc: qemu-devel, afaerber
2011/11/9 Benoît Canet <benoit.canet@gmail.com>:
> +/* remember to update linux-user/elfload.c get_elf_hwcap arm's
> + * version when adding a feature */
/* If adding a feature bit which corresponds to a Linux ELF
* HWCAP bit, remember to update the feature-bit-to-hwcap
* mapping in linux-user/elfload.c:get_elf_hwcap().
*/
-- PMM
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c
2011-11-09 15:02 [Qemu-devel] [PATCH V4] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
@ 2011-11-09 15:02 ` Benoît Canet
0 siblings, 0 replies; 11+ messages in thread
From: Benoît Canet @ 2011-11-09 15:02 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet, afaerber
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
target-arm/cpu.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index c4d742f..6639c2e 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -353,6 +353,10 @@ enum arm_cpu_mode {
#define ARM_IWMMXT_wCGR2 10
#define ARM_IWMMXT_wCGR3 11
+/* If adding a feature bit which corresponds to a Linux ELF
+ * HWCAP bit, remember to update the feature-bit-to-hwcap
+ * mapping in linux-user/elfload.c:get_elf_hwcap().
+ */
enum arm_features {
ARM_FEATURE_VFP,
ARM_FEATURE_AUXCR, /* ARM1026 Auxiliary control register. */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c
2011-11-09 15:46 [Qemu-devel] [PATCH V5] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
@ 2011-11-09 15:46 ` Benoît Canet
0 siblings, 0 replies; 11+ messages in thread
From: Benoît Canet @ 2011-11-09 15:46 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet, afaerber
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
target-arm/cpu.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index c4d742f..6639c2e 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -353,6 +353,10 @@ enum arm_cpu_mode {
#define ARM_IWMMXT_wCGR2 10
#define ARM_IWMMXT_wCGR3 11
+/* If adding a feature bit which corresponds to a Linux ELF
+ * HWCAP bit, remember to update the feature-bit-to-hwcap
+ * mapping in linux-user/elfload.c:get_elf_hwcap().
+ */
enum arm_features {
ARM_FEATURE_VFP,
ARM_FEATURE_AUXCR, /* ARM1026 Auxiliary control register. */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH V6] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270
@ 2011-11-09 17:03 Benoît Canet
2011-11-09 17:03 ` [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features Benoît Canet
2011-11-09 17:03 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
0 siblings, 2 replies; 11+ messages in thread
From: Benoît Canet @ 2011-11-09 17:03 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet, afaerber
A VFP was detected for pxa270 causing an "Illegal instruction"
exception.
The eglibc was not receiving the right AT_HWCAP from elfloader.c.
In this version :
Fix macro coding style issue
Benoît Canet (2):
arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features.
target-arm: remind to keep arm features in sync with
linux-user/elfload.c
linux-user/elfload.c | 46 ++++++++++++++++++++++++++++++++++++++++++----
target-arm/cpu.h | 4 ++++
2 files changed, 46 insertions(+), 4 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features.
2011-11-09 17:03 [Qemu-devel] [PATCH V6] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
@ 2011-11-09 17:03 ` Benoît Canet
2011-11-09 17:07 ` Andreas Färber
2011-11-09 17:25 ` Peter Maydell
2011-11-09 17:03 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
1 sibling, 2 replies; 11+ messages in thread
From: Benoît Canet @ 2011-11-09 17:03 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet, afaerber
The cpu capabilities passed by the elf loader in AT_HWCAP were
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 | 46 ++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index a413976..1c30c23 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -330,6 +330,10 @@ enum
ARM_HWCAP_ARM_NEON = 1 << 11,
ARM_HWCAP_ARM_VFPv3 = 1 << 12,
ARM_HWCAP_ARM_VFPv3D16 = 1 << 13,
+ ARM_HWCAP_ARM_TLS = 1 << 14,
+ ARM_HWCAP_ARM_VFPv4 = 1 << 15,
+ ARM_HWCAP_ARM_IDIVA = 1 << 16,
+ ARM_HWCAP_ARM_IDIVT = 1 << 17,
};
#define TARGET_HAS_GUEST_VALIDATE_BASE
@@ -375,10 +379,44 @@ 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;
+
+ /* probe for the extra features */
+#define SET_HWCAP(feat, hwcap) do { \
+ if (arm_feature(e, feat)) { \
+ hwcaps |= hwcap; \
+ } \
+ } while (0)
+ SET_HWCAP(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP);
+ SET_HWCAP(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT);
+ SET_HWCAP(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE);
+ SET_HWCAP(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON);
+ SET_HWCAP(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3);
+
+ /* Strictly should be ARM_FEATURE_V5TE but we don't distinguish
+ * as all our v5 cores are v5TE at the moment
+ */
+ SET_HWCAP(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP);
+
+ SET_HWCAP(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS);
+ SET_HWCAP(ARM_FEATURE_VFP4, ARM_HWCAP_ARM_VFPv4);
+ SET_HWCAP(ARM_FEATURE_ARM_DIV, ARM_HWCAP_ARM_IDIVA);
+ SET_HWCAP(ARM_FEATURE_THUMB_DIV, ARM_HWCAP_ARM_IDIVT);
+#undef SET_HWCAP
+
+ return hwcaps;
+}
#endif
--
1.7.5.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c
2011-11-09 17:03 [Qemu-devel] [PATCH V6] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
2011-11-09 17:03 ` [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features Benoît Canet
@ 2011-11-09 17:03 ` Benoît Canet
2011-11-09 17:25 ` Peter Maydell
1 sibling, 1 reply; 11+ messages in thread
From: Benoît Canet @ 2011-11-09 17:03 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet, afaerber
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
target-arm/cpu.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index c4d742f..6639c2e 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -353,6 +353,10 @@ enum arm_cpu_mode {
#define ARM_IWMMXT_wCGR2 10
#define ARM_IWMMXT_wCGR3 11
+/* If adding a feature bit which corresponds to a Linux ELF
+ * HWCAP bit, remember to update the feature-bit-to-hwcap
+ * mapping in linux-user/elfload.c:get_elf_hwcap().
+ */
enum arm_features {
ARM_FEATURE_VFP,
ARM_FEATURE_AUXCR, /* ARM1026 Auxiliary control register. */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features.
2011-11-09 17:03 ` [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features Benoît Canet
@ 2011-11-09 17:07 ` Andreas Färber
2011-11-09 17:25 ` Peter Maydell
1 sibling, 0 replies; 11+ messages in thread
From: Andreas Färber @ 2011-11-09 17:07 UTC (permalink / raw)
To: Benoît Canet; +Cc: peter.maydell, qemu-devel
Am 09.11.2011 18:03, schrieb Benoît Canet:
> The cpu capabilities passed by the elf loader in AT_HWCAP were
> 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>
Thanks for your patience,
Reviewed-by: Andreas Färber <afaerber@suse.de>
Andreas
> ---
> linux-user/elfload.c | 46 ++++++++++++++++++++++++++++++++++++++++++----
> 1 files changed, 42 insertions(+), 4 deletions(-)
>
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index a413976..1c30c23 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -330,6 +330,10 @@ enum
> ARM_HWCAP_ARM_NEON = 1 << 11,
> ARM_HWCAP_ARM_VFPv3 = 1 << 12,
> ARM_HWCAP_ARM_VFPv3D16 = 1 << 13,
> + ARM_HWCAP_ARM_TLS = 1 << 14,
> + ARM_HWCAP_ARM_VFPv4 = 1 << 15,
> + ARM_HWCAP_ARM_IDIVA = 1 << 16,
> + ARM_HWCAP_ARM_IDIVT = 1 << 17,
> };
>
> #define TARGET_HAS_GUEST_VALIDATE_BASE
> @@ -375,10 +379,44 @@ 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;
> +
> + /* probe for the extra features */
> +#define SET_HWCAP(feat, hwcap) do { \
> + if (arm_feature(e, feat)) { \
> + hwcaps |= hwcap; \
> + } \
> + } while (0)
> + SET_HWCAP(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP);
> + SET_HWCAP(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT);
> + SET_HWCAP(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE);
> + SET_HWCAP(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON);
> + SET_HWCAP(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3);
> +
> + /* Strictly should be ARM_FEATURE_V5TE but we don't distinguish
> + * as all our v5 cores are v5TE at the moment
> + */
> + SET_HWCAP(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP);
> +
> + SET_HWCAP(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS);
> + SET_HWCAP(ARM_FEATURE_VFP4, ARM_HWCAP_ARM_VFPv4);
> + SET_HWCAP(ARM_FEATURE_ARM_DIV, ARM_HWCAP_ARM_IDIVA);
> + SET_HWCAP(ARM_FEATURE_THUMB_DIV, ARM_HWCAP_ARM_IDIVT);
> +#undef SET_HWCAP
> +
> + return hwcaps;
> +}
>
> #endif
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features.
2011-11-09 17:03 ` [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features Benoît Canet
2011-11-09 17:07 ` Andreas Färber
@ 2011-11-09 17:25 ` Peter Maydell
1 sibling, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2011-11-09 17:25 UTC (permalink / raw)
To: Benoît Canet; +Cc: Riku Voipio, qemu-devel, afaerber
2011/11/9 Benoît Canet <benoit.canet@gmail.com>:
> The cpu capabilities passed by the elf loader in AT_HWCAP were
> 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>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
As this is a linux-user patch it should go via Riku (cc'ing).
-- PMM
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c
2011-11-09 17:03 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
@ 2011-11-09 17:25 ` Peter Maydell
0 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2011-11-09 17:25 UTC (permalink / raw)
To: Benoît Canet; +Cc: qemu-devel, afaerber
2011/11/9 Benoît Canet <benoit.canet@gmail.com>:
> Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
-- PMM
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c
2011-11-09 17:32 [Qemu-devel] [PATCH V7] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
@ 2011-11-09 17:32 ` Benoît Canet
0 siblings, 0 replies; 11+ messages in thread
From: Benoît Canet @ 2011-11-09 17:32 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Benoît Canet, afaerber
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
target-arm/cpu.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index c4d742f..6639c2e 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -353,6 +353,10 @@ enum arm_cpu_mode {
#define ARM_IWMMXT_wCGR2 10
#define ARM_IWMMXT_wCGR3 11
+/* If adding a feature bit which corresponds to a Linux ELF
+ * HWCAP bit, remember to update the feature-bit-to-hwcap
+ * mapping in linux-user/elfload.c:get_elf_hwcap().
+ */
enum arm_features {
ARM_FEATURE_VFP,
ARM_FEATURE_AUXCR, /* ARM1026 Auxiliary control register. */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-11-09 17:33 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 17:03 [Qemu-devel] [PATCH V6] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
2011-11-09 17:03 ` [Qemu-devel] [PATCH 1/2] arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features Benoît Canet
2011-11-09 17:07 ` Andreas Färber
2011-11-09 17:25 ` Peter Maydell
2011-11-09 17:03 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
2011-11-09 17:25 ` Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2011-11-09 17:32 [Qemu-devel] [PATCH V7] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
2011-11-09 17:32 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
2011-11-09 15:46 [Qemu-devel] [PATCH V5] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
2011-11-09 15:46 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
2011-11-09 15:02 [Qemu-devel] [PATCH V4] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
2011-11-09 15:02 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
2011-11-09 14:41 [Qemu-devel] [PATCH V3] Fix : [Bug 887516] [NEW] VFP support reported for the PXA270 Benoît Canet
2011-11-09 14:41 ` [Qemu-devel] [PATCH 2/2] target-arm: remind to keep arm features in sync with linux-user/elfload.c Benoît Canet
2011-11-09 14:47 ` 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).