From 8312e99657641893e704ffa4c6b59fe3898446c4 Mon Sep 17 00:00:00 2001 From: Guinevere Larsen Date: Mon, 26 May 2025 09:25:46 -0300 Subject: [PATCH] Backport "s390: Add support for z17 as CPU name" Since this is a trivial backport, no z-stream clone was created and this is being sent along with the rebase bug. The customer issue can be found at RHEL-50069 Relates: RHEL-92896 --- _gdb.spec.Patch.include | 4 ++ _gdb.spec.patch.include | 1 + _patch_order | 1 + gdb-rhel-50069-support-z17.patch | 85 ++++++++++++++++++++++++++++++++ gdb.spec | 4 ++ 5 files changed, 95 insertions(+) create mode 100644 gdb-rhel-50069-support-z17.patch diff --git a/_gdb.spec.Patch.include b/_gdb.spec.Patch.include index f6e9160..b18fc10 100644 --- a/_gdb.spec.Patch.include +++ b/_gdb.spec.Patch.include @@ -57,3 +57,7 @@ Patch011: gdb-add-index.patch # RPMs to install when GDB finds an objfile with no debug info. Patch012: gdb-add-rpm-suggestion-script.patch +# Backport "s390: Add support for z17 as CPU name" +# (Jens Remus, RHEL-50069) +Patch013: gdb-rhel-50069-support-z17.patch + diff --git a/_gdb.spec.patch.include b/_gdb.spec.patch.include index dad4d0a..cb13330 100644 --- a/_gdb.spec.patch.include +++ b/_gdb.spec.patch.include @@ -10,3 +10,4 @@ %patch -p1 -P010 %patch -p1 -P011 %patch -p1 -P012 +%patch -p1 -P013 diff --git a/_patch_order b/_patch_order index 047f472..bf9dc18 100644 --- a/_patch_order +++ b/_patch_order @@ -10,3 +10,4 @@ gdb-rhbz1149205-catch-syscall-after-fork-test.patch gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch gdb-add-index.patch gdb-add-rpm-suggestion-script.patch +gdb-rhel-50069-support-z17.patch diff --git a/gdb-rhel-50069-support-z17.patch b/gdb-rhel-50069-support-z17.patch new file mode 100644 index 0000000..3e76d23 --- /dev/null +++ b/gdb-rhel-50069-support-z17.patch @@ -0,0 +1,85 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jens Remus +Date: Wed, 9 Apr 2025 08:59:24 +0200 +Subject: gdb-rhel-50069-support-z17.patch + +;; Backport "s390: Add support for z17 as CPU name" +;; (Jens Remus, RHEL-50069) + +So far IBM z17 was identified as arch15. Add the real name, as it has +been announced. [1] + +[1]: IBM z17 announcement letter, AD25-0015, + https://www.ibm.com/docs/en/announcements/z17-makes-more-possible + +gas/ + * config/tc-s390.c (s390_parse_cpu): Add z17 as alternate CPU + name for arch15. + * doc/c-s390.texi: Likewise. + * doc/as.texi: Likewise. + +opcodes/ + * s390-mkopc.c (main): Add z17 as alternate CPU name for arch15. + +Signed-off-by: Jens Remus + +diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c +--- a/gas/config/tc-s390.c ++++ b/gas/config/tc-s390.c +@@ -343,7 +343,7 @@ s390_parse_cpu (const char *arg, + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, + { STRING_COMMA_LEN ("z16"), STRING_COMMA_LEN ("arch14"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX }, +- { STRING_COMMA_LEN (""), STRING_COMMA_LEN ("arch15"), ++ { STRING_COMMA_LEN ("z17"), STRING_COMMA_LEN ("arch15"), + S390_INSTR_FLAG_HTM | S390_INSTR_FLAG_VX } + }; + static struct +diff --git a/gas/doc/as.texi b/gas/doc/as.texi +--- a/gas/doc/as.texi ++++ b/gas/doc/as.texi +@@ -1944,7 +1944,8 @@ Specify which s390 processor variant is the target, @samp{g5} (or + @samp{arch6}), @samp{z9-109}, @samp{z9-ec} (or @samp{arch7}), @samp{z10} (or + @samp{arch8}), @samp{z196} (or @samp{arch9}), @samp{zEC12} (or @samp{arch10}), + @samp{z13} (or @samp{arch11}), @samp{z14} (or @samp{arch12}), @samp{z15} +-(or @samp{arch13}), @samp{z16} (or @samp{arch14}), or @samp{arch15}. ++(or @samp{arch13}), @samp{z16} (or @samp{arch14}), or @samp{z17} (or ++@samp{arch15}). + @item -mregnames + @itemx -mno-regnames + Allow or disallow symbolic names for registers. +diff --git a/gas/doc/c-s390.texi b/gas/doc/c-s390.texi +--- a/gas/doc/c-s390.texi ++++ b/gas/doc/c-s390.texi +@@ -18,7 +18,8 @@ and eleven chip levels. The architecture modes are the Enterprise System + Architecture (ESA) and the newer z/Architecture mode. The chip levels + are g5 (or arch3), g6, z900 (or arch5), z990 (or arch6), z9-109, z9-ec + (or arch7), z10 (or arch8), z196 (or arch9), zEC12 (or arch10), z13 +-(or arch11), z14 (or arch12), z15 (or arch13), z16 (or arch14), or arch15. ++(or arch11), z14 (or arch12), z15 (or arch13), z16 (or arch14), or ++z17 (arch15). + + @menu + * s390 Options:: Command-line Options. +@@ -73,7 +74,7 @@ are recognized: + @code{z14} (or @code{arch12}), + @code{z15} (or @code{arch13}), + @code{z16} (or @code{arch14}), and +-@code{arch15}. ++@code{z17} (or @code{arch15}). + + Assembling an instruction that is not supported on the target + processor results in an error message. +diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c +--- a/opcodes/s390-mkopc.c ++++ b/opcodes/s390-mkopc.c +@@ -443,7 +443,8 @@ main (void) + else if (strcmp (cpu_string, "z16") == 0 + || strcmp (cpu_string, "arch14") == 0) + min_cpu = S390_OPCODE_ARCH14; +- else if (strcmp (cpu_string, "arch15") == 0) ++ else if (strcmp (cpu_string, "z17") == 0 ++ || strcmp (cpu_string, "arch15") == 0) + min_cpu = S390_OPCODE_ARCH15; + else { + print_error ("Mnemonic \"%s\": Couldn't parse CPU string: %s\n", diff --git a/gdb.spec b/gdb.spec index eee23d3..83e6bbc 100644 --- a/gdb.spec +++ b/gdb.spec @@ -938,6 +938,10 @@ fi # endif scl %changelog +* Mon May 26 2025 Guinevere Larsen +- Backport "s390: Add support for z17 as CPU name + (Jen Remus, RHEL-50069) + * Tue May 13 2025 Alexandra Hájková - 16.3-1 - Rebase to FSF GDB 16.3. Deleted: gdb-rhbz2354997-gstack-drop-readnever.patch