qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] Provide safe_syscall for s390x
@ 2016-10-14 18:58 Michael Tokarev
  2016-10-17  8:26 ` Thomas Huth
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Tokarev @ 2016-10-14 18:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson

Hi.

This commit: c9bc3437a905b660561a26cd4ecc64579843267b
Author: Richard Henderson <rth@twiddle.net>
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

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-14 18:58 [Qemu-devel] Provide safe_syscall for s390x Michael Tokarev
@ 2016-10-17  8:26 ` Thomas Huth
  2016-10-17 10:39   ` Michael Tokarev
  2016-10-17 10:55   ` Christian Borntraeger
  0 siblings, 2 replies; 12+ messages in thread
From: Thomas Huth @ 2016-10-17  8:26 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel, Richard Henderson

On 14.10.2016 20:58, Michael Tokarev wrote:
> Hi.
> 
> This commit: c9bc3437a905b660561a26cd4ecc64579843267b
> Author: Richard Henderson <rth@twiddle.net>
> 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 :)

"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

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17  8:26 ` Thomas Huth
@ 2016-10-17 10:39   ` Michael Tokarev
  2016-10-17 10:49     ` Michael Tokarev
  2016-10-17 10:55   ` Christian Borntraeger
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Tokarev @ 2016-10-17 10:39 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Richard Henderson

17.10.2016 11:26, Thomas Huth пишет:
> On 14.10.2016 20:58, Michael Tokarev wrote:
>> Hi.
>>
>> This commit: c9bc3437a905b660561a26cd4ecc64579843267b
>> Author: Richard Henderson <rth@twiddle.net>
>> 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 :)
> 
> "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

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17 10:39   ` Michael Tokarev
@ 2016-10-17 10:49     ` Michael Tokarev
  2016-10-17 10:53       ` Thomas Huth
  2016-10-17 10:54       ` Michael Tokarev
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Tokarev @ 2016-10-17 10:49 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Richard Henderson

17.10.2016 13:39, Michael Tokarev wrote:

> (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

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17 10:49     ` Michael Tokarev
@ 2016-10-17 10:53       ` Thomas Huth
  2016-10-17 10:55         ` Michael Tokarev
  2016-10-17 10:54       ` Michael Tokarev
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Huth @ 2016-10-17 10:53 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel, Richard Henderson

On 17.10.2016 12:49, Michael Tokarev wrote:
> 17.10.2016 13:39, Michael Tokarev wrote:
> 
>> (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?

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

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17 10:49     ` Michael Tokarev
  2016-10-17 10:53       ` Thomas Huth
@ 2016-10-17 10:54       ` Michael Tokarev
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Tokarev @ 2016-10-17 10:54 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Richard Henderson

17.10.2016 13:49, Michael Tokarev wrote:
> 17.10.2016 13:39, Michael Tokarev wrote:
> 
>> (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?

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

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17 10:53       ` Thomas Huth
@ 2016-10-17 10:55         ` Michael Tokarev
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Tokarev @ 2016-10-17 10:55 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Richard Henderson

17.10.2016 13:53, Thomas Huth wrote:
> On 17.10.2016 12:49, Michael Tokarev wrote:
>> 17.10.2016 13:39, Michael Tokarev wrote:
>>
>>> (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?
> 
> 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.

> 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

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17  8:26 ` Thomas Huth
  2016-10-17 10:39   ` Michael Tokarev
@ 2016-10-17 10:55   ` Christian Borntraeger
  2016-10-17 14:35     ` Richard Henderson
  1 sibling, 1 reply; 12+ messages in thread
From: Christian Borntraeger @ 2016-10-17 10:55 UTC (permalink / raw)
  To: Thomas Huth, Michael Tokarev, qemu-devel, Richard Henderson

On 10/17/2016 10:26 AM, Thomas Huth wrote:
> On 14.10.2016 20:58, Michael Tokarev wrote:
>> Hi.
>>
>> This commit: c9bc3437a905b660561a26cd4ecc64579843267b
>> Author: Richard Henderson <rth@twiddle.net>
>> 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 :)
> 
> "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.

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17 10:55   ` Christian Borntraeger
@ 2016-10-17 14:35     ` Richard Henderson
  2016-10-18 22:17       ` Aurelien Jarno
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Henderson @ 2016-10-17 14:35 UTC (permalink / raw)
  To: Christian Borntraeger, Thomas Huth, Michael Tokarev, qemu-devel

On 10/17/2016 03:55 AM, Christian Borntraeger wrote:
> On 10/17/2016 10:26 AM, Thomas Huth wrote:
>> On 14.10.2016 20:58, Michael Tokarev wrote:
>>> Hi.
>>>
>>> This commit: c9bc3437a905b660561a26cd4ecc64579843267b
>>> Author: Richard Henderson <rth@twiddle.net>
>>> 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 :)
>>
>> "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~

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-17 14:35     ` Richard Henderson
@ 2016-10-18 22:17       ` Aurelien Jarno
  2016-10-19 17:24         ` Richard Henderson
  0 siblings, 1 reply; 12+ messages in thread
From: Aurelien Jarno @ 2016-10-18 22:17 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Christian Borntraeger, Thomas Huth, Michael Tokarev, qemu-devel

On 2016-10-17 07:35, Richard Henderson wrote:
> On 10/17/2016 03:55 AM, Christian Borntraeger wrote:
> > On 10/17/2016 10:26 AM, Thomas Huth wrote:
> > > On 14.10.2016 20:58, Michael Tokarev wrote:
> > > > Hi.
> > > > 
> > > > This commit: c9bc3437a905b660561a26cd4ecc64579843267b
> > > > Author: Richard Henderson <rth@twiddle.net>
> > > > 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 :)
> > > 
> > > "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.

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

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-18 22:17       ` Aurelien Jarno
@ 2016-10-19 17:24         ` Richard Henderson
  2016-10-26 17:10           ` Michael Tokarev
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Henderson @ 2016-10-19 17:24 UTC (permalink / raw)
  To: Aurelien Jarno
  Cc: Christian Borntraeger, Thomas Huth, Michael Tokarev, qemu-devel

On 10/18/2016 03:17 PM, Aurelien Jarno wrote:
> Actually gcc suggests to use icm %r0,15,0(%r8). It's even shorter than
> lt %r0,0(%r8).

Yep, that works too.


r~

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

* Re: [Qemu-devel] Provide safe_syscall for s390x
  2016-10-19 17:24         ` Richard Henderson
@ 2016-10-26 17:10           ` Michael Tokarev
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Tokarev @ 2016-10-26 17:10 UTC (permalink / raw)
  To: Richard Henderson, Aurelien Jarno
  Cc: Christian Borntraeger, Thomas Huth, qemu-devel

19.10.2016 20:24, Richard Henderson wrote:
> On 10/18/2016 03:17 PM, Aurelien Jarno wrote:
>> 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

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

end of thread, other threads:[~2016-10-26 17:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 18:58 [Qemu-devel] Provide safe_syscall for s390x Michael Tokarev
2016-10-17  8:26 ` Thomas Huth
2016-10-17 10:39   ` Michael Tokarev
2016-10-17 10:49     ` Michael Tokarev
2016-10-17 10:53       ` Thomas Huth
2016-10-17 10:55         ` Michael Tokarev
2016-10-17 10:54       ` Michael Tokarev
2016-10-17 10:55   ` Christian Borntraeger
2016-10-17 14:35     ` Richard Henderson
2016-10-18 22:17       ` Aurelien Jarno
2016-10-19 17:24         ` Richard Henderson
2016-10-26 17:10           ` Michael Tokarev

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).