public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Simon Marchi" <simon.marchi@polymtl.ca>
Cc: <simon.marchi@ericsson.com>,<tim.wiederhake@intel.com>,
	"GDB" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] x86-64: fix ZMM register state tracking
Date: Tue, 18 Sep 2018 13:38:00 -0000	[thread overview]
Message-ID: <5BA0FFB102000078001E97B0@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <f5a4adb4d3f4a0aa84b1666e7967a9fc@polymtl.ca>

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

>>> On 10.09.18 at 15:01, <simon.marchi@polymtl.ca> wrote:
> On 2018-09-10 07:25, Jan Beulich wrote:
>>>>> Simon Marchi <simon.marchi@ericsson.com> 09/08/18 1:13 AM >>>
>>> Would it be possible to update or create a test to exercise that?
>>> arch-specific tests are in testsuite/gdb.arch.
>> 
>> I'm sure it would be possible, but while I was happy to invest the time 
>> to
>> fix the actual bug (because it affects work I'm doing), I'm afraid I 
>> don't have
>> the time to learn how gdb test cases are to be constructed (I'm 
>> familiar
>> only with the binutils / gas side of things).
> 
> I understand.  If you can provide:
> 
>   - a minimal source file (C + assembly in this case, I suppose)
>   - GDB commands to reproduce the bug
>   - actual and expected output

Attached. vzero.s is the source file used (no C file needed). gdb.log
is a transcript of a session with a broken gdb (the one installed on
the system), while gdb.txt is a transcript for the fixed one that I've
built myself.

> I can take care of turning it in a GDB test case.

Thanks.

Jan



[-- Attachment #2: vzero.s --]
[-- Type: application/octet-stream, Size: 139 bytes --]

	.text
	.global main
main:
	vpternlogd $0xff, %zmm0, %zmm0, %zmm0
	vpternlogd $0xff, %zmm0, %zmm0, %zmm16
	vzeroupper
	xor	%eax, %eax
	ret

[-- Attachment #3: gdb.log --]
[-- Type: application/octet-stream, Size: 1636 bytes --]

[jbeulich@dus-dev-sles15v ~]$ gcc -Wall -W -o vzero{,.s} && gdb ./vzero
GNU gdb (GDB; SUSE Linux Enterprise 15) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./vzero...done.
(gdb) break main
Breakpoint 1 at 0x400497
(gdb) r
Starting program: /home/jbeulich/vzero 

Breakpoint 1, 0x0000000000400497 in main ()
(gdb) disp/i $pc
2: x/i $pc
=> 0x400497 <main>:	vpternlogd zmm0,zmm0,zmm0,0xff
(gdb) si
0x000000000040049e in main ()
2: x/i $pc
=> 0x40049e <main+7>:	vpternlogd zmm16,zmm0,zmm0,0xff
(gdb) 
0x00000000004004a5 in main ()
2: x/i $pc
=> 0x4004a5 <main+14>:	vzeroupper 
(gdb) print $zmm0.v16_int32
$1 = {-1 <repeats 16 times>}
(gdb) print $zmm16.v16_int32
$2 = {-1 <repeats 16 times>}
(gdb) si
0x00000000004004a8 in main ()
2: x/i $pc
=> 0x4004a8 <main+17>:	xor    eax,eax
(gdb) print $zmm16.v16_int32
$3 = {-1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0}
(gdb) q
A debugging session is active.

	Inferior 1 [process 56844] will be killed.

Quit anyway? (y or n) y

[-- Attachment #4: gdb.txt --]
[-- Type: text/plain, Size: 1645 bytes --]

[jbeulich@dus-dev-sles15v ~]$ gcc -Wall -W -o vzero{,.s} && gdbx ./vzero
GNU gdb (GDB) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./vzero...done.
(gdb) break main
Breakpoint 1 at 0x400497
(gdb) r
Starting program: /home/jbeulich/vzero 

Breakpoint 1, 0x0000000000400497 in main ()
(gdb) disp/i $pc
2: x/i $pc
=> 0x400497 <main>:	vpternlogd zmm0,zmm0,zmm0,0xff
(gdb) si
0x000000000040049e in main ()
2: x/i $pc
=> 0x40049e <main+7>:	vpternlogd zmm16,zmm0,zmm0,0xff
(gdb) 
0x00000000004004a5 in main ()
2: x/i $pc
=> 0x4004a5 <main+14>:	vzeroupper 
(gdb) print $zmm0.v16_int32
$1 = {-1 <repeats 16 times>}
(gdb) print $zmm16.v16_int32
$2 = {-1 <repeats 16 times>}
(gdb) si
0x00000000004004a8 in main ()
2: x/i $pc
=> 0x4004a8 <main+17>:	xor    eax,eax
(gdb) print $zmm16.v16_int32
$3 = {-1 <repeats 16 times>}
(gdb) q
A debugging session is active.

	Inferior 1 [process 56857] will be killed.

Quit anyway? (y or n) y


  reply	other threads:[~2018-09-18 13:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 13:23 Jan Beulich
2018-09-07 23:13 ` Simon Marchi
2018-09-10  6:25   ` Jan Beulich
2018-09-10 13:01     ` Simon Marchi
2018-09-18 13:38       ` Jan Beulich [this message]
2018-09-25  3:29         ` Simon Marchi
2018-09-25 15:04           ` Jan Beulich
2018-10-02 19:20             ` Simon Marchi
2018-10-03 14:30               ` Jan Beulich
2018-10-03 14:41                 ` Simon Marchi
2018-09-11 10:34 ` Pedro Alves
2018-09-11 11:34   ` Jan Beulich
2018-09-24 17:19 ` Metzger, Markus T
2018-09-25  7:47   ` Jan Beulich
2018-10-10 15:12 ` [PATCH v2] " Jan Beulich
2018-10-29 10:31 ` Ping: " Jan Beulich
2018-10-31 14:00   ` Simon Marchi
2018-11-07  9:07     ` Metzger, Markus T
2018-11-07  9:12       ` Jan Beulich
2018-11-07 13:18         ` Metzger, Markus T
2018-11-07 13:25           ` Jan Beulich
2018-11-07 14:18             ` Simon Marchi
2018-11-08 11:16               ` Jan Beulich
2018-11-08 16:24                 ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5BA0FFB102000078001E97B0@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tim.wiederhake@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).