qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes
@ 2016-12-07  4:30 Richard Henderson
  2016-12-07  4:30 ` [Qemu-devel] [PATCH 1/2] target-arm: Fix aarch64 vec_reg_offset Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Richard Henderson @ 2016-12-07  4:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

I ran Alex's risu tests on an s390x host, and ran into two
problems not related to the s390 backend.


r~


Richard Henderson (2):
  target-arm: Fix aarch64 disas_ldst_single_struct
  target-arm: Fix aarch64 vec_reg_offset

 target-arm/translate-a64.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

-- 
2.7.4

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

* [Qemu-devel] [PATCH 1/2] target-arm: Fix aarch64 vec_reg_offset
  2016-12-07  4:30 [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes Richard Henderson
@ 2016-12-07  4:30 ` Richard Henderson
  2016-12-07  4:30 ` [Qemu-devel] [PATCH 2/2] target-arm: Fix aarch64 disas_ldst_single_struct Richard Henderson
  2016-12-13 12:42 ` [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2016-12-07  4:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Since CPUARMState.vfp.regs is not 16 byte aligned, the ^ 8 fixup used
for a big-endian host doesn't do what's intended.  Fix this by adding
in the vfp.regs offset after computing the inter-register offset.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-arm/translate-a64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index 6dc27a6..ef7601b 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -527,7 +527,7 @@ static inline void assert_fp_access_checked(DisasContext *s)
 static inline int vec_reg_offset(DisasContext *s, int regno,
                                  int element, TCGMemOp size)
 {
-    int offs = offsetof(CPUARMState, vfp.regs[regno * 2]);
+    int offs = 0;
 #ifdef HOST_WORDS_BIGENDIAN
     /* This is complicated slightly because vfp.regs[2n] is
      * still the low half and  vfp.regs[2n+1] the high half
@@ -540,6 +540,7 @@ static inline int vec_reg_offset(DisasContext *s, int regno,
 #else
     offs += element * (1 << size);
 #endif
+    offs += offsetof(CPUARMState, vfp.regs[regno * 2]);
     assert_fp_access_checked(s);
     return offs;
 }
-- 
2.7.4

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

* [Qemu-devel] [PATCH 2/2] target-arm: Fix aarch64 disas_ldst_single_struct
  2016-12-07  4:30 [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes Richard Henderson
  2016-12-07  4:30 ` [Qemu-devel] [PATCH 1/2] target-arm: Fix aarch64 vec_reg_offset Richard Henderson
@ 2016-12-07  4:30 ` Richard Henderson
  2016-12-13 12:42 ` [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2016-12-07  4:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

We add s->be_data within do_vec_ld/st.  Adding it here means that
we have the wrong bits set in SIZE for a big-endian host, leading
to g_assert_not_reached in write_vec_element and read_vec_element.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-arm/translate-a64.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index ef7601b..f673d93 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -2830,9 +2830,9 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn)
         } else {
             /* Load/store one element per register */
             if (is_load) {
-                do_vec_ld(s, rt, index, tcg_addr, s->be_data + scale);
+                do_vec_ld(s, rt, index, tcg_addr, scale);
             } else {
-                do_vec_st(s, rt, index, tcg_addr, s->be_data + scale);
+                do_vec_st(s, rt, index, tcg_addr, scale);
             }
         }
         tcg_gen_addi_i64(tcg_addr, tcg_addr, ebytes);
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes
  2016-12-07  4:30 [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes Richard Henderson
  2016-12-07  4:30 ` [Qemu-devel] [PATCH 1/2] target-arm: Fix aarch64 vec_reg_offset Richard Henderson
  2016-12-07  4:30 ` [Qemu-devel] [PATCH 2/2] target-arm: Fix aarch64 disas_ldst_single_struct Richard Henderson
@ 2016-12-13 12:42 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2016-12-13 12:42 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, qemu-arm

On 7 December 2016 at 04:30, Richard Henderson <rth@twiddle.net> wrote:
> I ran Alex's risu tests on an s390x host, and ran into two
> problems not related to the s390 backend.
>
>
> r~
>
>
> Richard Henderson (2):
>   target-arm: Fix aarch64 disas_ldst_single_struct
>   target-arm: Fix aarch64 vec_reg_offset
>
>  target-arm/translate-a64.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)



Applied to target-arm.next for 2.9, thanks.

-- PMM

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

end of thread, other threads:[~2016-12-13 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-07  4:30 [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes Richard Henderson
2016-12-07  4:30 ` [Qemu-devel] [PATCH 1/2] target-arm: Fix aarch64 vec_reg_offset Richard Henderson
2016-12-07  4:30 ` [Qemu-devel] [PATCH 2/2] target-arm: Fix aarch64 disas_ldst_single_struct Richard Henderson
2016-12-13 12:42 ` [Qemu-devel] [PATCH 0/2] target-arm aarch64 big-endian fixes 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).