diff mbox series

[SRU,B,1/1] recordmcount.pl: fix typo in s390 mcount regex

Message ID 41f634519627ef4d2958357533b2626d7e907ca3.1643845456.git.luke.nowakowskikrijger@canonical.com
State New
Headers show
Series Fix typo that breaks ftrace on s390x | expand

Commit Message

Luke Nowakowski-Krijger Feb. 3, 2022, 1:50 a.m. UTC
From: Heiko Carstens <hca@linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1959752

commit 4eb1782eaa9fa1c224ad1fa0d13a9f09c3ab2d80 upstream.

Commit 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well
as bcrl on s390") added a new alternative mnemonic for the existing brcl
instruction. This is required for the combination old gcc version (pre 9.0)
and binutils since version 2.37.
However at the same time this commit introduced a typo, replacing brcl with
bcrl. As a result no mcount locations are detected anymore with old gcc
versions (pre 9.0) and binutils before version 2.37.
Fix this by using the correct mnemonic again.

Reported-by: Miroslav Benes <mbenes@suse.cz>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: <stable@vger.kernel.org>
Fixes: 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well as bcrl on s390")
Link: https://lore.kernel.org/r/alpine.LSU.2.21.2112230949520.19849@pobox.suse.cz
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[cherry picked from commit 200b63a1727ec31735a894b4ce8378de96bdb9b1 stable/linux-4.19.y]
Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
---
 scripts/recordmcount.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kleber Sacilotto de Souza Feb. 3, 2022, 8:15 a.m. UTC | #1
On 2/3/22 02:50, Luke Nowakowski-Krijger wrote:
> From: Heiko Carstens <hca@linux.ibm.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1959752
> 
> commit 4eb1782eaa9fa1c224ad1fa0d13a9f09c3ab2d80 upstream.
> 
> Commit 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well
> as bcrl on s390") added a new alternative mnemonic for the existing brcl
> instruction. This is required for the combination old gcc version (pre 9.0)
> and binutils since version 2.37.
> However at the same time this commit introduced a typo, replacing brcl with
> bcrl. As a result no mcount locations are detected anymore with old gcc
> versions (pre 9.0) and binutils before version 2.37.
> Fix this by using the correct mnemonic again.
> 
> Reported-by: Miroslav Benes <mbenes@suse.cz>
> Cc: Jerome Marchand <jmarchan@redhat.com>
> Cc: <stable@vger.kernel.org>
> Fixes: 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well as bcrl on s390")
> Link: https://lore.kernel.org/r/alpine.LSU.2.21.2112230949520.19849@pobox.suse.cz
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [cherry picked from commit 200b63a1727ec31735a894b4ce8378de96bdb9b1 stable/linux-4.19.y]
> Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks

> ---
>   scripts/recordmcount.pl | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index 037805131edb..6a4cd8df2d97 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -252,7 +252,7 @@ if ($arch eq "x86_64") {
>   
>   } elsif ($arch eq "s390" && $bits == 64) {
>       if ($cc =~ /-DCC_USING_HOTPATCH/) {
> -	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
> +	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
>   	$mcount_adjust = 0;
>       } else {
>   	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
Stefan Bader Feb. 3, 2022, 8:19 a.m. UTC | #2
On 03.02.22 02:50, Luke Nowakowski-Krijger wrote:
> From: Heiko Carstens <hca@linux.ibm.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1959752
> 
> commit 4eb1782eaa9fa1c224ad1fa0d13a9f09c3ab2d80 upstream.
> 
> Commit 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well
> as bcrl on s390") added a new alternative mnemonic for the existing brcl
> instruction. This is required for the combination old gcc version (pre 9.0)
> and binutils since version 2.37.
> However at the same time this commit introduced a typo, replacing brcl with
> bcrl. As a result no mcount locations are detected anymore with old gcc
> versions (pre 9.0) and binutils before version 2.37.
> Fix this by using the correct mnemonic again.
> 
> Reported-by: Miroslav Benes <mbenes@suse.cz>
> Cc: Jerome Marchand <jmarchan@redhat.com>
> Cc: <stable@vger.kernel.org>
> Fixes: 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well as bcrl on s390")
> Link: https://lore.kernel.org/r/alpine.LSU.2.21.2112230949520.19849@pobox.suse.cz
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [cherry picked from commit 200b63a1727ec31735a894b4ce8378de96bdb9b1 stable/linux-4.19.y]
> Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>   scripts/recordmcount.pl | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index 037805131edb..6a4cd8df2d97 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -252,7 +252,7 @@ if ($arch eq "x86_64") {
>   
>   } elsif ($arch eq "s390" && $bits == 64) {
>       if ($cc =~ /-DCC_USING_HOTPATCH/) {
> -	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
> +	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
>   	$mcount_adjust = 0;
>       } else {
>   	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
diff mbox series

Patch

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 037805131edb..6a4cd8df2d97 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -252,7 +252,7 @@  if ($arch eq "x86_64") {
 
 } elsif ($arch eq "s390" && $bits == 64) {
     if ($cc =~ /-DCC_USING_HOTPATCH/) {
-	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
+	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
 	$mcount_adjust = 0;
     } else {
 	$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";