Skip to contentSkip to conversation

Provide safe_syscall for s390x

Qemu-devel Michael Tokarev 5 participants 12 messages Oct 14, 2016 – Oct 26, 2016

lore
Share & tools
lore
#0 lore raw

Hi.

This commit: c9bc3437a905b660561a26cd4ecc64579843267b
Author: Richard Henderson <[email protected]>
Date: Tue Jun 21 17:32:12 2016 -0700

    linux-user: Provide safe_syscall for s390x

does not build on debian unstable porterbox for s390x, with the following error message:

linux-user/host/s390x/safe-syscall.inc.S: Assembler messages:
linux-user/host/s390x/safe-syscall.inc.S:75: Error: Unrecognized opcode: `lt' rules.mak:72: recipe for target 'linux-user/safe-syscall.o' failed

Since I know nothing about s390, I've no idea what's at fault here... :) Thought I'd report this :)

Thanks,

/mjt

#1 lore raw
Quoted 11 lines · Michael Tokarev

Hi.

This commit: c9bc3437a905b660561a26cd4ecc64579843267b
Author: Richard Henderson <[email protected]>
Date: Tue Jun 21 17:32:12 2016 -0700

    linux-user: Provide safe_syscall for s390x

does not build on debian unstable porterbox for s390x, with the following error message:

Quoted 7 lines

linux-user/host/s390x/safe-syscall.inc.S: Assembler messages:
linux-user/host/s390x/safe-syscall.inc.S:75: Error: Unrecognized opcode:
`lt'
rules.mak:72: recipe for target 'linux-user/safe-syscall.o' failed

Since I know nothing about s390, I've no idea what's at fault here... :) Thought I'd report this :)

"lt" seems to be a newer s390x opcode which has been added to the architecture within the last ten years or so. So maybe you've got to add some "-march=xxx" flag when compiling this file?
Could you maybe start with finding out the exact comand line that is used to compile this file?

Thomas

#2 lore raw

17.10.2016 11:26, Thomas Huth пишет:

Quoted 17 lines · Michael Tokarev
Quoted 16 lines

Hi.

This commit: c9bc3437a905b660561a26cd4ecc64579843267b
Author: Richard Henderson <[email protected]>
Date: Tue Jun 21 17:32:12 2016 -0700

    linux-user: Provide safe_syscall for s390x

does not build on debian unstable porterbox for s390x, with the following error message:

linux-user/host/s390x/safe-syscall.inc.S: Assembler messages:
linux-user/host/s390x/safe-syscall.inc.S:75: Error: Unrecognized opcode:
`lt'
rules.mak:72: recipe for target 'linux-user/safe-syscall.o' failed

Quoted 8 lines
Quoted 2 lines

Since I know nothing about s390, I've no idea what's at fault here... :) Thought I'd report this :)

"lt" seems to be a newer s390x opcode which has been added to the architecture within the last ten years or so. So maybe you've got to add some "-march=xxx" flag when compiling this file?
Could you maybe start with finding out the exact comand line that is used to compile this file?

Here we go:

cc -I/«BUILDDIR»/qemu-2.7+dfsg/tcg -I/«BUILDDIR»/qemu-2.7+dfsg/tcg/s390 -I/«BUILDDIR»/qemu-2.7+dfsg/linux-headers -I/«BUILDDIR»/qemu-2.7+dfsg/qemu-build/linux-headers -I. -I/«BUILDDIR»/qemu-2.7+dfsg -I/«BUILDDIR»/qemu-2.7+dfsg/include -I/«BUILDDIR»/qemu-2.7+dfsg/linux-user -Ilinux-user -I/usr/include/pixman-1 -DHAS_LIBSSH2_SFTP_FSYNC -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -g -O2 -fdebug-prefix-map=/«BUILDDIR»/qemu-2.7+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DCONFIG_QEMU_DATAPATH='"/usr/share/qemu:/usr/share/seabios:/usr/lib/ipxe/qemu"' -DVENDOR_DEBIAN -Wendif-labels -Wno-shift-negative-value -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong
-I/usr/include/p11-kit-1 -I/usr/include/libpng16
-I/usr/include/cacard -I/usr/include/libusb-1.0 -I../linux-headers
-I.. -I/«BUILDDIR»/qemu-2.7+dfsg/target-alpha -DNEED_CPU_H -I/«BUILDDIR»/qemu-2.7+dfsg/include -I/«BUILDDIR»/qemu-2.7+dfsg/linux-user/alpha -I/«BUILDDIR»/qemu-2.7+dfsg/linux-user/host/s390x -I/«BUILDDIR»/qemu-2.7+dfsg/linux-user -MMD -MP -MT linux-user/safe-syscall.o -MF linux-user/safe-syscall.d -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/glib-2.0 -I/usr/lib/s390x-linux-gnu/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/s390x-linux-gnu/glib-2.0/include -g -c -o linux-user/safe-syscall.o /«BUILDDIR»/qemu-2.7+dfsg/linux-user/safe-syscall.S /«BUILDDIR»/qemu-2.7+dfsg/linux-user/host/s390x/safe-syscall.inc.S:
Assembler messages:
/«BUILDDIR»/qemu-2.7+dfsg/linux-user/host/s390x/safe-syscall.inc.S:75:
Error: Unrecognized opcode: `lt' /«BUILDDIR»/qemu-2.7+dfsg/rules.mak:72: recipe for target 'linux-user/safe-syscall.o' failed
make[2]: *** [linux-user/safe-syscall.o] Error 1

(cc is gcc 6.2.0)

I've no idea which -march is the default and what choices are available.

/mjt

#3 lore raw
Quoted 3 lines · Michael Tokarev

(cc is gcc 6.2.0)

I've no idea which -march is the default and what choices are available.

$ gcc -march=?
gcc: error: unrecognized argument in option '-march=?'
gcc: note: valid arguments to '-march=' are: g5 g6 native z10 z13 z196
z9-109 z9-ec z900 z990 zEC12

I guess g5 is the default?

Thanks,

/mjt

#4 lore raw
Quoted 4 lines · Michael Tokarev
Quoted 2 lines · Michael Tokarev

(cc is gcc 6.2.0)

Quoted 8 lines
Quoted 1 line

I've no idea which -march is the default and what choices are available.

$ gcc -march=?
gcc: error: unrecognized argument in option '-march=?'
gcc: note: valid arguments to '-march=' are: g5 g6 native z10 z13 z196
z9-109 z9-ec z900 z990 zEC12

I guess g5 is the default?

I hope it is not the default - at least not for -m64.

Could you please run the following and post the results:

gcc -Q --help=target

Thanks,
Thomas

#5 lore raw
Quoted 7 lines · Thomas Huth
Quoted 6 lines · Michael Tokarev
Quoted 3 lines · Michael Tokarev

(cc is gcc 6.2.0)

I've no idea which -march is the default and what choices are available.

Quoted 8 lines
Quoted 6 lines
$ gcc -march=?
gcc: error: unrecognized argument in option '-march=?'
gcc: note: valid arguments to '-march=' are: g5 g6 native z10 z13 z196
z9-109 z9-ec z900 z990 zEC12

I guess g5 is the default?

I hope it is not the default - at least not for -m64.

Nope, z900 is the default. For it and z990, asm generates that error.

Quoted 3 lines

Could you please run the following and post the results:

gcc -Q --help=target

The following options are target specific:

  -m31                        		[disabled]
  -m64                        		[enabled]
  -march=                     		z900
  -mbackchain                 		[disabled]
  -mbionic                    		[disabled]
  -mbranch-cost=              		0x1
  -mdebug                     		[disabled]
  -mesa                       		[disabled]
  -mfused-madd                		
  -mglibc                     		[enabled]
  -mhard-dfp                  		[enabled]
  -mhard-float                		[enabled]
  -mhotpatch=                 		
  -mhtm                       		[enabled]
  -mlong-double-128           		[disabled]
  -mlong-double-64            		[enabled]
  -mlra                       		[enabled]
  -mmusl                      		[disabled]
  -mmvcle                     		[disabled]
  -mno-stack-guard            		
  -mno-stack-size             		
  -mpacked-stack              		[disabled]
  -msmall-exec                		[disabled]
  -msoft-float                		[disabled]
  -mstack-guard=              		0
  -mstack-size=               		0
  -mtune=                     		[default]
  -muclibc                    		[disabled]
  -mvx                        		[enabled]
  -mwarn-dynamicstack         		[disabled]
  -mwarn-framesize=           		0
  -mzarch                     		[enabled]
  -mzvector                   		[disabled]

Thanks,

/mjt

#6 lore raw
In reply to Michael Tokarev
Quoted 4 lines · Michael Tokarev
Quoted 2 lines · Michael Tokarev

(cc is gcc 6.2.0)

Quoted 8 lines
Quoted 1 line

I've no idea which -march is the default and what choices are available.

$ gcc -march=?
gcc: error: unrecognized argument in option '-march=?'
gcc: note: valid arguments to '-march=' are: g5 g6 native z10 z13 z196
z9-109 z9-ec z900 z990 zEC12

I guess g5 is the default?

No it is not.

g5 and g6 are deprecated. z900 is the default, and this one produces the error with `lt' instruction. All other variants works fine.

Thanks,

/mjt

#7 lore raw
In reply to Thomas Huth
Quoted 17 lines · Thomas Huth
Quoted 16 lines · Michael Tokarev

Hi.

This commit: c9bc3437a905b660561a26cd4ecc64579843267b
Author: Richard Henderson <[email protected]>
Date: Tue Jun 21 17:32:12 2016 -0700

    linux-user: Provide safe_syscall for s390x

does not build on debian unstable porterbox for s390x, with the following error message:

linux-user/host/s390x/safe-syscall.inc.S: Assembler messages:
linux-user/host/s390x/safe-syscall.inc.S:75: Error: Unrecognized opcode:
`lt'
rules.mak:72: recipe for target 'linux-user/safe-syscall.o' failed

Quoted 8 lines
Quoted 2 lines

Since I know nothing about s390, I've no idea what's at fault here... :) Thought I'd report this :)

"lt" seems to be a newer s390x opcode which has been added to the architecture within the last ten years or so. So maybe you've got to add some "-march=xxx" flag when compiling this file?
Could you maybe start with finding out the exact comand line that is used to compile this file?

Yes, lt was added with the extended immidiate facility. So either use -march=z9-109 (introduced in 2005) or replace the lt with an l + ltr to also run on older models.

#8 lore raw
Quoted 21 lines · Christian Borntraeger
Quoted 20 lines · Thomas Huth
Quoted 18 lines · Michael Tokarev

Hi.

This commit: c9bc3437a905b660561a26cd4ecc64579843267b
Author: Richard Henderson <[email protected]>
Date: Tue Jun 21 17:32:12 2016 -0700

    linux-user: Provide safe_syscall for s390x

does not build on debian unstable porterbox for s390x, with the following error message:

linux-user/host/s390x/safe-syscall.inc.S: Assembler messages:
linux-user/host/s390x/safe-syscall.inc.S:75: Error: Unrecognized opcode:
`lt'
rules.mak:72: recipe for target 'linux-user/safe-syscall.o' failed

Since I know nothing about s390, I've no idea what's at fault here... :) Thought I'd report this :)

Quoted 9 lines
Quoted 5 lines

"lt" seems to be a newer s390x opcode which has been added to the architecture within the last ten years or so. So maybe you've got to add some "-march=xxx" flag when compiling this file?
Could you maybe start with finding out the exact comand line that is used to compile this file?

Yes, lt was added with the extended immidiate facility. So either use -march=z9-109 (introduced in 2005) or replace the lt with an l + ltr to also run on older models.

Whoops. I'd forgotten that RHEL defaults to z196 these days. This piece of code is certainly not important enough to conditionalize on newer hardware. I'll put together a patch.

r~

#9 lore raw
Quoted 28 lines · Richard Henderson
Quoted 27 lines · Christian Borntraeger
Quoted 25 lines · Thomas Huth
Quoted 11 lines · Michael Tokarev

Hi.

This commit: c9bc3437a905b660561a26cd4ecc64579843267b
Author: Richard Henderson <[email protected]>
Date: Tue Jun 21 17:32:12 2016 -0700

    linux-user: Provide safe_syscall for s390x

does not build on debian unstable porterbox for s390x, with the following error message:

Quoted 7 lines

linux-user/host/s390x/safe-syscall.inc.S: Assembler messages:
linux-user/host/s390x/safe-syscall.inc.S:75: Error: Unrecognized opcode:
`lt'
rules.mak:72: recipe for target 'linux-user/safe-syscall.o' failed

Since I know nothing about s390, I've no idea what's at fault here... :) Thought I'd report this :)

"lt" seems to be a newer s390x opcode which has been added to the architecture within the last ten years or so. So maybe you've got to add some "-march=xxx" flag when compiling this file?
Could you maybe start with finding out the exact comand line that is used to compile this file?

Quoted 7 lines
Quoted 3 lines

Yes, lt was added with the extended immidiate facility. So either use -march=z9-109 (introduced in 2005) or replace the lt with an l + ltr to also run on older models.

Whoops. I'd forgotten that RHEL defaults to z196 these days. This piece of code is certainly not important enough to conditionalize on newer hardware. I'll put together a patch.

Actually gcc suggests to use icm %r0,15,0(%r8). It's even shorter than lt %r0,0(%r8).

Aurelien

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net
#10 lore raw
Quoted 2 lines · Aurelien Jarno

Actually gcc suggests to use icm %r0,15,0(%r8). It's even shorter than lt %r0,0(%r8).

Yep, that works too.

r~

#11 lore raw
Quoted 5 lines · Richard Henderson
Quoted 2 lines · Aurelien Jarno

Actually gcc suggests to use icm %r0,15,0(%r8). It's even shorter than lt %r0,0(%r8).

Yep, that works too.

So what's the final patch for this, if any? :)
Or should I just use extra -march?

Thanks,

/mjt