Skip to contentSkip to conversation

regression: target/ppc: convert VSX logical operations to vector operations broke X for ppc64le guest

Qemu-devel Andrew Randrianasulu 3 participants 7 messages Feb 26, 2019 – Mar 6, 2019

lore
Share & tools
lore

Andrew Randrianasulu

author Acked-by David Gibson
#0 lore raw

Hello.

I bisected this problem with fonts (and multicolored vertical stripes) in qemu git (ppc64-softmmu)

guest@slax:/dev/shm/qemu$ git bisect good
7b8fe477e12b164dda97f79e27b55b805d90384f is the first bad commit
commit 7b8fe477e12b164dda97f79e27b55b805d90384f
Author: Richard Henderson <[email protected]>
Date:   Fri Feb 15 10:00:46 2019 +0000

target/ppc: convert VSX logical operations to vector operations

Message-Id: <[email protected]>

:040000 040000 da3024ad2c9dfc3b7170516a8b321ef8c5d5bdf8
a0257b9f5880ecc8e7001a59ccaa10407084623f M target

guest@slax:/dev/shm/qemu$ git bisect log
git bisect start
# good: [32a1a94dd324d33578dca1dc96d7896a0244d768] Update version for v3.1.0 
release
git bisect good 32a1a94dd324d33578dca1dc96d7896a0244d768
# bad: [86c7e2f4a93322a76afea5ee6806a83420d1dfea] Merge remote-tracking 
branch 'remotes/berrange/tags/authz-core-pull-request' into staging
git bisect bad 86c7e2f4a93322a76afea5ee6806a83420d1dfea
# good: [95ebd99dcd37b8574426c876502bfcc7c299584b] target/arm: Decode PAuth 
within disas_data_proc_1src
git bisect good 95ebd99dcd37b8574426c876502bfcc7c299584b
# good: [268dfefa690b2bdee1f8c5090d2343871cf3467c] hw/microblaze/Makefile.objs: 
Create configs for petalogix and xilinx boards
git bisect good 268dfefa690b2bdee1f8c5090d2343871cf3467c
# good: [f5117fd28552fe3fe32ef0495582b1caaef7a28d] hw/mips_cpc: kick a VP when 
putting it into Run statewq
git bisect good f5117fd28552fe3fe32ef0495582b1caaef7a28d
# bad: [2e68b8620637a4ee8c79b5724144b726af1e261b] Merge remote-tracking 
branch 'remotes/dgibson/tags/ppc-for-4.0-20190219' into staging
git bisect bad 2e68b8620637a4ee8c79b5724144b726af1e261b
# good: [4c668f4a3d684ec133a52d936314379f6edd672e] target/ppc: Remove some #if 
0'ed code
git bisect good 4c668f4a3d684ec133a52d936314379f6edd672e
# bad: [9b5b74da0a07a89ef71c7f7da0b36560a3bac521] target/ppc: Split out VSCR_SAT 
to a vector field
git bisect bad 9b5b74da0a07a89ef71c7f7da0b36560a3bac521
# good: [444d6ca301d97de141a502851940943b09a9ebee] spapr/irq: Use the "simple" 
ICS class for KVM
git bisect good 444d6ca301d97de141a502851940943b09a9ebee
# bad: [9bb0048ec6f8f3bcc144b2c5769d9301e824f946] target/ppc: convert xxspltw to 
vector operations
git bisect bad 9bb0048ec6f8f3bcc144b2c5769d9301e824f946
# good: [471ff3d0257135b938d0a5f2181f22cd753d50de] target/ppc: convert 
vspltis[bhw] to use vector operations
git bisect good 471ff3d0257135b938d0a5f2181f22cd753d50de
# bad: [7b8fe477e12b164dda97f79e27b55b805d90384f] target/ppc: convert VSX 
logical operations to vector operations
git bisect bad 7b8fe477e12b164dda97f79e27b55b805d90384f
# good: [0f6a6d5db853c0cbe438c1831c70710bfb6530ee] target/ppc: convert 
vsplt[bhw] to use vector operations
git bisect good 0f6a6d5db853c0cbe438c1831c70710bfb6530ee
# first bad commit: [7b8fe477e12b164dda97f79e27b55b805d90384f] target/ppc: 
convert VSX logical operations to vector operations
guest@slax:/dev/shm/qemu$                                                

configure line:
setarch i686 ./configure --target-list=ppc64-softmmu

launch line:
ppc64-softmmu/qemu-system-ppc64 -display
sdl,gl=on -hda /mnt/sdb1/PPC-img/alpine_disk.img

where alpine_disk.img is HDD installed Alpine 3.7 for ppc64le with xfce4 desktop.

#1 lore raw

On 26/02/2019 22:25, Andrew Randrianasulu wrote:

(adding qemu-ppc, Richard and David - please make sure you add the relevant maintainer on bug reports, as otherwise due to the high volume of mails to the list it's very easy to miss things)

Quoted 70 lines

Hello.

I bisected this problem with fonts (and multicolored vertical stripes) in qemu git (ppc64-softmmu)

guest@slax:/dev/shm/qemu$ git bisect good
7b8fe477e12b164dda97f79e27b55b805d90384f is the first bad commit
commit 7b8fe477e12b164dda97f79e27b55b805d90384f
Author: Richard Henderson <[email protected]>
Date:   Fri Feb 15 10:00:46 2019 +0000

target/ppc: convert VSX logical operations to vector operations

Message-Id: <[email protected]>

:040000 040000 da3024ad2c9dfc3b7170516a8b321ef8c5d5bdf8
a0257b9f5880ecc8e7001a59ccaa10407084623f M target

guest@slax:/dev/shm/qemu$ git bisect log
git bisect start
# good: [32a1a94dd324d33578dca1dc96d7896a0244d768] Update version for v3.1.0 
release
git bisect good 32a1a94dd324d33578dca1dc96d7896a0244d768
# bad: [86c7e2f4a93322a76afea5ee6806a83420d1dfea] Merge remote-tracking 
branch 'remotes/berrange/tags/authz-core-pull-request' into staging
git bisect bad 86c7e2f4a93322a76afea5ee6806a83420d1dfea
# good: [95ebd99dcd37b8574426c876502bfcc7c299584b] target/arm: Decode PAuth 
within disas_data_proc_1src
git bisect good 95ebd99dcd37b8574426c876502bfcc7c299584b
# good: [268dfefa690b2bdee1f8c5090d2343871cf3467c] hw/microblaze/Makefile.objs: 
Create configs for petalogix and xilinx boards
git bisect good 268dfefa690b2bdee1f8c5090d2343871cf3467c
# good: [f5117fd28552fe3fe32ef0495582b1caaef7a28d] hw/mips_cpc: kick a VP when 
putting it into Run statewq
git bisect good f5117fd28552fe3fe32ef0495582b1caaef7a28d
# bad: [2e68b8620637a4ee8c79b5724144b726af1e261b] Merge remote-tracking 
branch 'remotes/dgibson/tags/ppc-for-4.0-20190219' into staging
git bisect bad 2e68b8620637a4ee8c79b5724144b726af1e261b
# good: [4c668f4a3d684ec133a52d936314379f6edd672e] target/ppc: Remove some #if 
0'ed code
git bisect good 4c668f4a3d684ec133a52d936314379f6edd672e
# bad: [9b5b74da0a07a89ef71c7f7da0b36560a3bac521] target/ppc: Split out VSCR_SAT 
to a vector field
git bisect bad 9b5b74da0a07a89ef71c7f7da0b36560a3bac521
# good: [444d6ca301d97de141a502851940943b09a9ebee] spapr/irq: Use the "simple" 
ICS class for KVM
git bisect good 444d6ca301d97de141a502851940943b09a9ebee
# bad: [9bb0048ec6f8f3bcc144b2c5769d9301e824f946] target/ppc: convert xxspltw to 
vector operations
git bisect bad 9bb0048ec6f8f3bcc144b2c5769d9301e824f946
# good: [471ff3d0257135b938d0a5f2181f22cd753d50de] target/ppc: convert 
vspltis[bhw] to use vector operations
git bisect good 471ff3d0257135b938d0a5f2181f22cd753d50de
# bad: [7b8fe477e12b164dda97f79e27b55b805d90384f] target/ppc: convert VSX 
logical operations to vector operations
git bisect bad 7b8fe477e12b164dda97f79e27b55b805d90384f
# good: [0f6a6d5db853c0cbe438c1831c70710bfb6530ee] target/ppc: convert 
vsplt[bhw] to use vector operations
git bisect good 0f6a6d5db853c0cbe438c1831c70710bfb6530ee
# first bad commit: [7b8fe477e12b164dda97f79e27b55b805d90384f] target/ppc: 
convert VSX logical operations to vector operations
guest@slax:/dev/shm/qemu$                                                

configure line:
setarch i686 ./configure --target-list=ppc64-softmmu

Quoted 6 lines

launch line:
ppc64-softmmu/qemu-system-ppc64 -display
sdl,gl=on -hda /mnt/sdb1/PPC-img/alpine_disk.img

where alpine_disk.img is HDD installed Alpine 3.7 for ppc64le with xfce4 desktop.

AFAICT the vector instructions converted here are independent of endian, so I can't see why this patch on its own would have any effect.

Maybe it could be because the "setarch i686" part forces use of some lesser-used 32-bit paths in the vector code - is this required? And do you see the same issue on a x86_64 build?

ATB,

Mark.

#2 lore raw

В сообщении от Thursday 28 February 2019 08:06:45 Mark Cave-Ayland написал(а):

Quoted 5 lines · Andrew Randrianasulu

(adding qemu-ppc, Richard and David - please make sure you add the relevant maintainer on bug reports, as otherwise due to the high volume of mails to the list it's very easy to miss things)

ok

Quoted 80 lines
Quoted 73 lines

Hello.

I bisected this problem with fonts (and multicolored vertical stripes) in qemu git (ppc64-softmmu)

guest@slax:/dev/shm/qemu$ git bisect good
7b8fe477e12b164dda97f79e27b55b805d90384f is the first bad commit
commit 7b8fe477e12b164dda97f79e27b55b805d90384f
Author: Richard Henderson <[email protected]>
Date:   Fri Feb 15 10:00:46 2019 +0000

target/ppc: convert VSX logical operations to vector operations

Message-Id: <[email protected]>

:040000 040000 da3024ad2c9dfc3b7170516a8b321ef8c5d5bdf8

a0257b9f5880ecc8e7001a59ccaa10407084623f M target

guest@slax:/dev/shm/qemu$ git bisect log
git bisect start
# good: [32a1a94dd324d33578dca1dc96d7896a0244d768] Update version for
v3.1.0 release
git bisect good 32a1a94dd324d33578dca1dc96d7896a0244d768
# bad: [86c7e2f4a93322a76afea5ee6806a83420d1dfea] Merge remote-tracking
branch 'remotes/berrange/tags/authz-core-pull-request' into staging
git bisect bad 86c7e2f4a93322a76afea5ee6806a83420d1dfea
# good: [95ebd99dcd37b8574426c876502bfcc7c299584b] target/arm: Decode
PAuth within disas_data_proc_1src
git bisect good 95ebd99dcd37b8574426c876502bfcc7c299584b
# good: [268dfefa690b2bdee1f8c5090d2343871cf3467c]
hw/microblaze/Makefile.objs: Create configs for petalogix and xilinx
boards
git bisect good 268dfefa690b2bdee1f8c5090d2343871cf3467c
# good: [f5117fd28552fe3fe32ef0495582b1caaef7a28d] hw/mips_cpc: kick a VP
when putting it into Run statewq
git bisect good f5117fd28552fe3fe32ef0495582b1caaef7a28d
# bad: [2e68b8620637a4ee8c79b5724144b726af1e261b] Merge remote-tracking
branch 'remotes/dgibson/tags/ppc-for-4.0-20190219' into staging
git bisect bad 2e68b8620637a4ee8c79b5724144b726af1e261b
# good: [4c668f4a3d684ec133a52d936314379f6edd672e] target/ppc: Remove
some #if 0'ed code
git bisect good 4c668f4a3d684ec133a52d936314379f6edd672e
# bad: [9b5b74da0a07a89ef71c7f7da0b36560a3bac521] target/ppc: Split out
VSCR_SAT to a vector field
git bisect bad 9b5b74da0a07a89ef71c7f7da0b36560a3bac521
# good: [444d6ca301d97de141a502851940943b09a9ebee] spapr/irq: Use the
"simple" ICS class for KVM
git bisect good 444d6ca301d97de141a502851940943b09a9ebee
# bad: [9bb0048ec6f8f3bcc144b2c5769d9301e824f946] target/ppc: convert
xxspltw to vector operations
git bisect bad 9bb0048ec6f8f3bcc144b2c5769d9301e824f946
# good: [471ff3d0257135b938d0a5f2181f22cd753d50de] target/ppc: convert
vspltis[bhw] to use vector operations
git bisect good 471ff3d0257135b938d0a5f2181f22cd753d50de
# bad: [7b8fe477e12b164dda97f79e27b55b805d90384f] target/ppc: convert VSX
logical operations to vector operations
git bisect bad 7b8fe477e12b164dda97f79e27b55b805d90384f
# good: [0f6a6d5db853c0cbe438c1831c70710bfb6530ee] target/ppc: convert
vsplt[bhw] to use vector operations
git bisect good 0f6a6d5db853c0cbe438c1831c70710bfb6530ee
# first bad commit: [7b8fe477e12b164dda97f79e27b55b805d90384f]
target/ppc: convert VSX logical operations to vector operations
guest@slax:/dev/shm/qemu$

configure line:
setarch i686 ./configure --target-list=ppc64-softmmu

Quoted 6 lines

launch line:
ppc64-softmmu/qemu-system-ppc64 -display
sdl,gl=on -hda /mnt/sdb1/PPC-img/alpine_disk.img

where alpine_disk.img is HDD installed Alpine 3.7 for ppc64le with xfce4 desktop.

Quoted 6 lines

AFAICT the vector instructions converted here are independent of endian, so I can't see why this patch on its own would have any effect.

Maybe it could be because the "setarch i686" part forces use of some lesser-used 32-bit paths in the vector code - is this required? And do you see the same issue on a x86_64 build?

I use 32-bit Slackware userland with x86_64 kerenl - so setarch prevent most of configures from detecting my arch wrongly.

Yes, bug was and is present with qemu compiled for x86_64 (inside chroot). I initially discovered it there, and after dropping -O3 and even march=native, and even disabling avx2 via configure switch - moved to bisect.

https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg06414.html

Quoted 5 lines

ATB,

Mark.

#3 lore raw
Quoted 17 lines · Andrew Randrianasulu
Quoted 10 lines
Quoted 9 lines

configure line:
setarch i686 ./configure --target-list=ppc64-softmmu

launch line:
ppc64-softmmu/qemu-system-ppc64 -display
sdl,gl=on -hda /mnt/sdb1/PPC-img/alpine_disk.img

where alpine_disk.img is HDD installed Alpine 3.7 for ppc64le with xfce4 desktop.

Quoted 6 lines

AFAICT the vector instructions converted here are independent of endian, so I can't see why this patch on its own would have any effect.

Maybe it could be because the "setarch i686" part forces use of some lesser-used 32-bit paths in the vector code - is this required? And do you see the same issue on a x86_64 build?

Quoted 8 lines

I use 32-bit Slackware userland with x86_64 kerenl - so setarch prevent most of configures from detecting my arch wrongly.

Yes, bug was and is present with qemu compiled for x86_64 (inside chroot). I initially discovered it there, and after dropping -O3 and even march=native, and even disabling avx2 via configure switch - moved to bisect.

https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg06414.html

Can you upload your alpine_disk.img somewhere and then email me the link off-list? I'll see if I can take a look when I get a spare moment.

ATB,

Mark.

Acked-by David Gibson
#4 lore raw
Quoted 22 lines · Mark Cave-Ayland
Quoted 20 lines · Andrew Randrianasulu
Quoted 10 lines
Quoted 9 lines

configure line:
setarch i686 ./configure --target-list=ppc64-softmmu

launch line:
ppc64-softmmu/qemu-system-ppc64 -display
sdl,gl=on -hda /mnt/sdb1/PPC-img/alpine_disk.img

where alpine_disk.img is HDD installed Alpine 3.7 for ppc64le with xfce4 desktop.

Quoted 6 lines

AFAICT the vector instructions converted here are independent of endian, so I can't see why this patch on its own would have any effect.

Maybe it could be because the "setarch i686" part forces use of some lesser-used 32-bit paths in the vector code - is this required? And do you see the same issue on a x86_64 build?

I use 32-bit Slackware userland with x86_64 kerenl - so setarch prevent most of configures from detecting my arch wrongly.

Quoted 8 lines
Quoted 5 lines

Yes, bug was and is present with qemu compiled for x86_64 (inside chroot). I initially discovered it there, and after dropping -O3 and even march=native, and even disabling avx2 via configure switch - moved to bisect.

https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg06414.html

Can you upload your alpine_disk.img somewhere and then email me the link off-list? I'll see if I can take a look when I get a spare moment.

I've also bisected to this commit for a problem with qemu-pp64le.

commit 7b8fe477e12b164dda97f79e27b55b805d90384f

Author: Richard Henderson <[email protected]>
Date:   Fri Feb 15 10:00:46 2019 +0000

target/ppc: convert VSX logical operations to vector operations

Message-Id: <[email protected]>

debian stretch ppc64el fails to build the well known hello.c example:
# $ cat /tmp/hello.c
#include <stdio.h>
int main(void)

{
    printf("Hello World!\n");
    return 0;
}
# cc -o /tmp/hello /tmp/hello.c
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:26:2: error: unknown type name '_STDC_'
    explicitly includes a system header.  GCC knows the name of this
  ^ ~~~~
/usr/include/stdc-predef.h:28:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '_STDC_PREDEF_H'

^
/usr/include/stdc-predef.h:42:2: error: missing terminating ' character
#endif
^~~~~
...

#5 lore raw
Quoted 62 lines · Laurent Vivier
Quoted 22 lines · Mark Cave-Ayland
Quoted 20 lines · Andrew Randrianasulu
Quoted 10 lines
Quoted 9 lines

configure line:
setarch i686 ./configure --target-list=ppc64-softmmu

launch line:
ppc64-softmmu/qemu-system-ppc64 -display
sdl,gl=on -hda /mnt/sdb1/PPC-img/alpine_disk.img

where alpine_disk.img is HDD installed Alpine 3.7 for ppc64le with xfce4 desktop.

Quoted 6 lines

AFAICT the vector instructions converted here are independent of endian, so I can't see why this patch on its own would have any effect.

Maybe it could be because the "setarch i686" part forces use of some lesser-used 32-bit paths in the vector code - is this required? And do you see the same issue on a x86_64 build?

I use 32-bit Slackware userland with x86_64 kerenl - so setarch prevent most of configures from detecting my arch wrongly.

Quoted 8 lines
Quoted 5 lines

Yes, bug was and is present with qemu compiled for x86_64 (inside chroot). I initially discovered it there, and after dropping -O3 and even march=native, and even disabling avx2 via configure switch - moved to bisect.

https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg06414.html

Can you upload your alpine_disk.img somewhere and then email me the link off-list? I'll see if I can take a look when I get a spare moment.

I've also bisected to this commit for a problem with qemu-pp64le.

commit 7b8fe477e12b164dda97f79e27b55b805d90384f

Author: Richard Henderson <[email protected]>
Date:   Fri Feb 15 10:00:46 2019 +0000

target/ppc: convert VSX logical operations to vector operations

Message-Id: <[email protected]>

debian stretch ppc64el fails to build the well known hello.c example:
# $ cat /tmp/hello.c
#include <stdio.h>
int main(void)

{
    printf("Hello World!\n");
    return 0;
}
# cc -o /tmp/hello /tmp/hello.c
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:26:2: error: unknown type name '_STDC_'
    explicitly includes a system header.  GCC knows the name of this
  ^ ~~~~
/usr/include/stdc-predef.h:28:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '_STDC_PREDEF_H'
Quoted 5 lines

^
/usr/include/stdc-predef.h:42:2: error: missing terminating ' character
#endif
^~~~~
...

Hi Laurent,

This should be fixed by the patchset at
https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg00473.html - can you test and confirm that it also works for you?

I'm currently in the process of working on a v2 to address Richard's comments, hopefully I will be able to send it through later this evening or tomorrow.

ATB,

Mark.

#6 lore raw
Quoted 70 lines · Mark Cave-Ayland
Quoted 62 lines · Laurent Vivier
Quoted 22 lines · Mark Cave-Ayland
Quoted 20 lines · Andrew Randrianasulu
Quoted 10 lines
Quoted 9 lines

configure line:
setarch i686 ./configure --target-list=ppc64-softmmu

launch line:
ppc64-softmmu/qemu-system-ppc64 -display
sdl,gl=on -hda /mnt/sdb1/PPC-img/alpine_disk.img

where alpine_disk.img is HDD installed Alpine 3.7 for ppc64le with xfce4 desktop.

Quoted 6 lines

AFAICT the vector instructions converted here are independent of endian, so I can't see why this patch on its own would have any effect.

Maybe it could be because the "setarch i686" part forces use of some lesser-used 32-bit paths in the vector code - is this required? And do you see the same issue on a x86_64 build?

I use 32-bit Slackware userland with x86_64 kerenl - so setarch prevent most of configures from detecting my arch wrongly.

Quoted 8 lines
Quoted 5 lines

Yes, bug was and is present with qemu compiled for x86_64 (inside chroot). I initially discovered it there, and after dropping -O3 and even march=native, and even disabling avx2 via configure switch - moved to bisect.

https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg06414.html

Can you upload your alpine_disk.img somewhere and then email me the link off-list? I'll see if I can take a look when I get a spare moment.

I've also bisected to this commit for a problem with qemu-pp64le.

commit 7b8fe477e12b164dda97f79e27b55b805d90384f

Author: Richard Henderson <[email protected]>
Date:   Fri Feb 15 10:00:46 2019 +0000

target/ppc: convert VSX logical operations to vector operations

Message-Id: <[email protected]>

debian stretch ppc64el fails to build the well known hello.c example:
# $ cat /tmp/hello.c
#include <stdio.h>
int main(void)

{
    printf("Hello World!\n");
    return 0;
}
# cc -o /tmp/hello /tmp/hello.c
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:26:2: error: unknown type name '_STDC_'
    explicitly includes a system header.  GCC knows the name of this
  ^ ~~~~
/usr/include/stdc-predef.h:28:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' before '_STDC_PREDEF_H'
Quoted 5 lines

^
/usr/include/stdc-predef.h:42:2: error: missing terminating ' character
#endif
^~~~~
...

Quoted 8 lines

Hi Laurent,

This should be fixed by the patchset at
https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg00473.html - can you test and confirm that it also works for you?

I'm currently in the process of working on a v2 to address Richard's comments, hopefully I will be able to send it through later this evening or tomorrow.

Thank you Mark.

yes, this series fixes the problem for me too.

Thanks,
Laurent