public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp
@ 2023-08-29 16:19 Simon Marchi
  2023-08-29 16:58 ` Tom Tromey
  2023-08-29 19:41 ` John Baldwin
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Marchi @ 2023-08-29 16:19 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

When running this test on a processor that supports AVX512 (AMD EPYC
9634) on Debian 12 bookwork (system compiler is gcc 12.2.0), I see:

    continue^M
    Continuing.^M
    Process record does not support instruction bound.^M
    Process record does not support instruction 0x62 at address 0x7ffff7f49b40.^M
    Process record: failed to record execution log.^M
    ^M
    Program stopped.^M
    0x00007ffff7f49b40 in ?? () from /lib/x86_64-linux-gnu/libc.so.6^M
    (gdb) FAIL: gdb.reverse/step-precsave.exp: run to end of main

The instruction at this address is:

   0x00007ffff7f49b40:	62 e2 7d 48 7a c6   vpbroadcastb %esi,%zmm16

This seems like an AVX512 instruction (given the use of zmm16).  Match
this byte value in order to produce a KFAIL.

Change-Id: I1d20357fa538ba60b9c537160acf511a37d751ee
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30807
---
 gdb/testsuite/gdb.reverse/step-precsave.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp
index e2971621c57b..ca0e848c8575 100644
--- a/gdb/testsuite/gdb.reverse/step-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp
@@ -52,6 +52,9 @@ with_timeout_factor 20 {
 	-re -wrap "Process record does not support instruction 0xfae64 at.*" {
 	    kfail "record/25038" $gdb_test_name
 	}
+	-re -wrap "Process record does not support instruction 0x62 at.*" {
+	    kfail "record/30807" $gdb_test_name
+	}
     }
 }
 

base-commit: 8468e03688622f265529699e2efd355a4c122cc6
-- 
2.42.0


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

* Re: [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp
  2023-08-29 16:19 [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp Simon Marchi
@ 2023-08-29 16:58 ` Tom Tromey
  2023-08-29 17:43   ` Simon Marchi
  2023-08-29 19:41 ` John Baldwin
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2023-08-29 16:58 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> The instruction at this address is:
Simon>    0x00007ffff7f49b40:	62 e2 7d 48 7a c6   vpbroadcastb %esi,%zmm16
Simon> This seems like an AVX512 instruction (given the use of zmm16).  Match
Simon> this byte value in order to produce a KFAIL.

Seems fine to me.

I often wonder if this code is maintained and/or useful.

Approved-By: Tom Tromey <tom@tromey.com>

Tom

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

* Re: [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp
  2023-08-29 16:58 ` Tom Tromey
@ 2023-08-29 17:43   ` Simon Marchi
  2023-08-30  7:46     ` Guinevere Larsen
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2023-08-29 17:43 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi via Gdb-patches

On 8/29/23 12:58, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> The instruction at this address is:
> Simon>    0x00007ffff7f49b40:	62 e2 7d 48 7a c6   vpbroadcastb %esi,%zmm16
> Simon> This seems like an AVX512 instruction (given the use of zmm16).  Match
> Simon> this byte value in order to produce a KFAIL.
> 
> Seems fine to me.
> 
> I often wonder if this code is maintained and/or useful.

The built-in reverse code?  I would call it unmaintained.  Whether it is
useful or not for some people, I don't know.  For real world use cases
I try to use rr.

> Approved-By: Tom Tromey <tom@tromey.com>

Thanks, will push.

Simon

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

* Re: [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp
  2023-08-29 16:19 [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp Simon Marchi
  2023-08-29 16:58 ` Tom Tromey
@ 2023-08-29 19:41 ` John Baldwin
  2023-08-30  1:20   ` Simon Marchi
  1 sibling, 1 reply; 6+ messages in thread
From: John Baldwin @ 2023-08-29 19:41 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 8/29/23 9:19 AM, Simon Marchi via Gdb-patches wrote:
> When running this test on a processor that supports AVX512 (AMD EPYC
> 9634) on Debian 12 bookwork (system compiler is gcc 12.2.0), I see:
> 
>      continue^M
>      Continuing.^M
>      Process record does not support instruction bound.^M
>      Process record does not support instruction 0x62 at address 0x7ffff7f49b40.^M
>      Process record: failed to record execution log.^M
>      ^M
>      Program stopped.^M
>      0x00007ffff7f49b40 in ?? () from /lib/x86_64-linux-gnu/libc.so.6^M
>      (gdb) FAIL: gdb.reverse/step-precsave.exp: run to end of main
> 
> The instruction at this address is:
> 
>     0x00007ffff7f49b40:	62 e2 7d 48 7a c6   vpbroadcastb %esi,%zmm16
> 
> This seems like an AVX512 instruction (given the use of zmm16).  Match
> this byte value in order to produce a KFAIL.

Note that 0x62 is the prefix byte for EVEX and is used by all instructions
using EVEX encoding.  (EVEX is used for AVX512 as it expands the register
selector fields in x86 instructions to 5 bits instead of 4, so you have to
use it for zmm16-31.  I think Intel's recent APX or whatever it's called
that adds 16 more GPRs also uses EVEX encoding for existing instructions
like ADD, etc. to support r16 - r31.)

That's just to say that matching on 0x62 is probably a rather broad match
that might match on all sorts of other instructions in the future.

-- 
John Baldwin


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

* Re: [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp
  2023-08-29 19:41 ` John Baldwin
@ 2023-08-30  1:20   ` Simon Marchi
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi @ 2023-08-30  1:20 UTC (permalink / raw)
  To: John Baldwin, gdb-patches

> Note that 0x62 is the prefix byte for EVEX and is used by all instructions
> using EVEX encoding.  (EVEX is used for AVX512 as it expands the register
> selector fields in x86 instructions to 5 bits instead of 4, so you have to
> use it for zmm16-31.  I think Intel's recent APX or whatever it's called
> that adds 16 more GPRs also uses EVEX encoding for existing instructions
> like ADD, etc. to support r16 - r31.)
> 
> That's just to say that matching on 0x62 is probably a rather broad match
> that might match on all sorts of other instructions in the future.

Thanks for the insights!  So just from the message, there wouldn't be a
way to differentiate hitting an AVX512 instruction (like the one I saw)
from hitting another instruction that happens to use that EVEX encoding
(the messages would be the same).  But for this case of emitting a
kfail, I don't think it matters, the result is the same.

Simon


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

* Re: [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp
  2023-08-29 17:43   ` Simon Marchi
@ 2023-08-30  7:46     ` Guinevere Larsen
  0 siblings, 0 replies; 6+ messages in thread
From: Guinevere Larsen @ 2023-08-30  7:46 UTC (permalink / raw)
  To: Simon Marchi, Tom Tromey, Simon Marchi via Gdb-patches

On 29/08/2023 19:43, Simon Marchi via Gdb-patches wrote:
> On 8/29/23 12:58, Tom Tromey wrote:
>>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>> Simon> The instruction at this address is:
>> Simon>    0x00007ffff7f49b40:	62 e2 7d 48 7a c6   vpbroadcastb %esi,%zmm16
>> Simon> This seems like an AVX512 instruction (given the use of zmm16).  Match
>> Simon> this byte value in order to produce a KFAIL.
>>
>> Seems fine to me.
>>
>> I often wonder if this code is maintained and/or useful.
> The built-in reverse code?  I would call it unmaintained.  Whether it is
> useful or not for some people, I don't know.  For real world use cases
> I try to use rr.
>
If I understand rr correctly (which I might not, I just used it a bit, 
never looked at the actual code), the only thing it does is record. RR 
still uses GDB to control inferior execution backwards, so we still need 
to maintain the execution (and tests) part of GDB working, and the best 
way to do that is keeping the ability to record, so our tests can be run 
without external recording packages.

-- 
Cheers,
Guinevere Larsen
She/Her/Hers


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

end of thread, other threads:[~2023-08-30  7:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29 16:19 [PATCH] gdb/testsuite: recognize one more unsupported instruction in gdb.reverse/step-precsave.exp Simon Marchi
2023-08-29 16:58 ` Tom Tromey
2023-08-29 17:43   ` Simon Marchi
2023-08-30  7:46     ` Guinevere Larsen
2023-08-29 19:41 ` John Baldwin
2023-08-30  1:20   ` Simon Marchi

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