All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector)
@ 2018-07-11 10:39 Richard Henderson
  2018-07-11 11:04 ` Laurent Desnogues
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Richard Henderson @ 2018-07-11 10:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, alex.bennee

'I' was being double-incremented; correctly within the inner loop
and incorrectly within the outer loop.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---

Fixes a SIGSEGV within one of these generated helpers,
exposed by an armclang vectorized code sample.


r~

---
 target/arm/sve_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
index cec0d3ee54..ddc592ff79 100644
--- a/target/arm/sve_helper.c
+++ b/target/arm/sve_helper.c
@@ -4855,7 +4855,7 @@ void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm,       \
     intptr_t i, oprsz = simd_oprsz(desc);                               \
     unsigned scale = simd_data(desc);                                   \
     uintptr_t ra = GETPC();                                             \
-    for (i = 0; i < oprsz; i++) {                                       \
+    for (i = 0; i < oprsz; ) {                                          \
         uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3));                 \
         do {                                                            \
             TYPEM m = 0;                                                \
@@ -4936,7 +4936,7 @@ void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm,       \
     uintptr_t ra = GETPC();                                             \
     bool first = true;                                                  \
     mmap_lock();                                                        \
-    for (i = 0; i < oprsz; i++) {                                       \
+    for (i = 0; i < oprsz; ) {                                          \
         uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3));                 \
         do {                                                            \
             TYPEM m = 0;                                                \
-- 
2.17.1

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

* Re: [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector)
  2018-07-11 10:39 [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector) Richard Henderson
@ 2018-07-11 11:04 ` Laurent Desnogues
  2018-07-11 13:23   ` Richard Henderson
  2018-07-12 13:04 ` Alex Bennée
  2018-07-12 15:56 ` Peter Maydell
  2 siblings, 1 reply; 5+ messages in thread
From: Laurent Desnogues @ 2018-07-11 11:04 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel, Peter Maydell, Alex Bennée

Hello,

On Wed, Jul 11, 2018 at 12:39 PM, Richard Henderson
<richard.henderson@linaro.org> wrote:
> 'I' was being double-incremented; correctly within the inner loop
> and incorrectly within the outer loop.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

I didn't try to apply the patch but line numbers look wrong.

I guess this should apply to DO_LD1_ZPZ_S and DO_LDFF1_ZPZ macros, in
which case you get my review:

Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>

Thanks,

Laurent

> ---
>
> Fixes a SIGSEGV within one of these generated helpers,
> exposed by an armclang vectorized code sample.
>
>
> r~
>
> ---
>  target/arm/sve_helper.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
> index cec0d3ee54..ddc592ff79 100644
> --- a/target/arm/sve_helper.c
> +++ b/target/arm/sve_helper.c
> @@ -4855,7 +4855,7 @@ void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm,       \
>      intptr_t i, oprsz = simd_oprsz(desc);                               \
>      unsigned scale = simd_data(desc);                                   \
>      uintptr_t ra = GETPC();                                             \
> -    for (i = 0; i < oprsz; i++) {                                       \
> +    for (i = 0; i < oprsz; ) {                                          \
>          uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3));                 \
>          do {                                                            \
>              TYPEM m = 0;                                                \
> @@ -4936,7 +4936,7 @@ void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm,       \
>      uintptr_t ra = GETPC();                                             \
>      bool first = true;                                                  \
>      mmap_lock();                                                        \
> -    for (i = 0; i < oprsz; i++) {                                       \
> +    for (i = 0; i < oprsz; ) {                                          \
>          uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3));                 \
>          do {                                                            \
>              TYPEM m = 0;                                                \
> --
> 2.17.1
>
>

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

* Re: [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector)
  2018-07-11 11:04 ` Laurent Desnogues
@ 2018-07-11 13:23   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2018-07-11 13:23 UTC (permalink / raw)
  To: Laurent Desnogues; +Cc: qemu-devel, Peter Maydell, Alex Bennée

On 07/11/2018 04:04 AM, Laurent Desnogues wrote:
> Hello,
> 
> On Wed, Jul 11, 2018 at 12:39 PM, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>> 'I' was being double-incremented; correctly within the inner loop
>> and incorrectly within the outer loop.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> 
> I didn't try to apply the patch but line numbers look wrong.
> 
> I guess this should apply to DO_LD1_ZPZ_S and DO_LDFF1_ZPZ macros, in
> which case you get my review:

The patch was pulled out of the middle of a branch,
so the line numbers might be off.  I probably should
have cherry-picked it to master before posting...


r~

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

* Re: [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector)
  2018-07-11 10:39 [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector) Richard Henderson
  2018-07-11 11:04 ` Laurent Desnogues
@ 2018-07-12 13:04 ` Alex Bennée
  2018-07-12 15:56 ` Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Bennée @ 2018-07-12 13:04 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel, peter.maydell


Richard Henderson <richard.henderson@linaro.org> writes:

> 'I' was being double-incremented; correctly within the inner loop
> and incorrectly within the outer loop.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>
> Fixes a SIGSEGV within one of these generated helpers,
> exposed by an armclang vectorized code sample.
>
>
> r~
>
> ---
>  target/arm/sve_helper.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
> index cec0d3ee54..ddc592ff79 100644
> --- a/target/arm/sve_helper.c
> +++ b/target/arm/sve_helper.c
> @@ -4855,7 +4855,7 @@ void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm,       \
>      intptr_t i, oprsz = simd_oprsz(desc);                               \
>      unsigned scale = simd_data(desc);                                   \
>      uintptr_t ra = GETPC();                                             \
> -    for (i = 0; i < oprsz; i++) {                                       \
> +    for (i = 0; i < oprsz; ) {                                          \
>          uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3));                 \
>          do {                                                            \
>              TYPEM m = 0;                                                \
> @@ -4936,7 +4936,7 @@ void HELPER(NAME)(CPUARMState *env, void *vd, void *vg, void *vm,       \
>      uintptr_t ra = GETPC();                                             \
>      bool first = true;                                                  \
>      mmap_lock();                                                        \
> -    for (i = 0; i < oprsz; i++) {                                       \
> +    for (i = 0; i < oprsz; ) {                                          \
>          uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3));                 \
>          do {                                                            \
>              TYPEM m = 0;                                                \


--
Alex Bennée

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

* Re: [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector)
  2018-07-11 10:39 [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector) Richard Henderson
  2018-07-11 11:04 ` Laurent Desnogues
  2018-07-12 13:04 ` Alex Bennée
@ 2018-07-12 15:56 ` Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2018-07-12 15:56 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Alex Bennée

On 11 July 2018 at 11:39, Richard Henderson
<richard.henderson@linaro.org> wrote:
> 'I' was being double-incremented; correctly within the inner loop
> and incorrectly within the outer loop.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>
> Fixes a SIGSEGV within one of these generated helpers,
> exposed by an armclang vectorized code sample.
>


Applied to target-arm.next, thanks.

-- PMM

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

end of thread, other threads:[~2018-07-12 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 10:39 [Qemu-devel] [PATCH for-3.0] target/arm: Fix LD1W and LDFF1W (scalar plus vector) Richard Henderson
2018-07-11 11:04 ` Laurent Desnogues
2018-07-11 13:23   ` Richard Henderson
2018-07-12 13:04 ` Alex Bennée
2018-07-12 15:56 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.