All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-arch@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>, H.
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 4/4] s390 mcount offset calculation
Date: Tue, 10 May 2011 10:10:43 +0200	[thread overview]
Message-ID: <20110510081104.229147984@de.ibm.com> (raw)
In-Reply-To: 20110510081039.241831019@de.ibm.com

[-- Attachment #1: 303-mcount-adjust-s390.diff --]
[-- Type: text/plain, Size: 2681 bytes --]

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Do the mcount offset adjustment in the recordmcount.pl/recordmcount.[ch]
at compile time and not in ftrace_call_adjust at run time.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---


 arch/s390/include/asm/ftrace.h |    4 +---
 scripts/recordmcount.c         |    8 ++++++--
 scripts/recordmcount.pl        |    2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)
Index: test-2.6/arch/s390/include/asm/ftrace.h
===================================================================
--- test-2.6.orig/arch/s390/include/asm/ftrace.h	2011-01-10 10:32:42.825504709 +0100
+++ test-2.6/arch/s390/include/asm/ftrace.h	2011-05-03 09:39:07.757500412 +0200
@@ -11,15 +11,13 @@
 
 #ifdef CONFIG_64BIT
 #define MCOUNT_INSN_SIZE  12
-#define MCOUNT_OFFSET	   8
 #else
 #define MCOUNT_INSN_SIZE  20
-#define MCOUNT_OFFSET	   4
 #endif
 
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
-	return addr - MCOUNT_OFFSET;
+	return addr;
 }
 
 #endif /* __ASSEMBLY__ */
Index: test-2.6/scripts/recordmcount.c
===================================================================
--- test-2.6.orig/scripts/recordmcount.c	2011-05-03 09:39:04.929486388 +0200
+++ test-2.6/scripts/recordmcount.c	2011-05-03 09:39:07.757500412 +0200
@@ -338,8 +338,10 @@
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (EM_S390 == w2(ehdr->e_machine))
+		if (EM_S390 == w2(ehdr->e_machine)) {
 			reltype = R_390_32;
+			mcount_adjust_32 = -4;
+		}
 		if (EM_MIPS == w2(ehdr->e_machine)) {
 			reltype = R_MIPS_32;
 			is_fake_mcount32 = MIPS32_is_fake_mcount;
@@ -354,8 +356,10 @@
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (EM_S390 == w2(ghdr->e_machine))
+		if (EM_S390 == w2(ghdr->e_machine)) {
 			reltype = R_390_64;
+			mcount_adjust_64 = -8;
+		}
 		if (EM_MIPS == w2(ghdr->e_machine)) {
 			reltype = R_MIPS_64;
 			Elf64_r_sym = MIPS64_r_sym;
Index: test-2.6/scripts/recordmcount.pl
===================================================================
--- test-2.6.orig/scripts/recordmcount.pl	2011-05-03 09:39:04.929486388 +0200
+++ test-2.6/scripts/recordmcount.pl	2011-05-03 09:39:07.757500412 +0200
@@ -242,12 +242,14 @@
 
 } elsif ($arch eq "s390" && $bits == 32) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
+    $mcount_adjust = -4;
     $alignment = 4;
     $ld .= " -m elf_s390";
     $cc .= " -m31";
 
 } elsif ($arch eq "s390" && $bits == 64) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
+    $mcount_adjust = -8;
     $alignment = 8;
     $type = ".quad";
     $ld .= " -m elf64_s390";

WARNING: multiple messages have this Message-ID (diff)
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-arch@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>, Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Russell King <linux@arm.linux.org.uk>,
	Rabin Vincent <rabin@rab.in>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 4/4] s390 mcount offset calculation
Date: Tue, 10 May 2011 10:10:43 +0200	[thread overview]
Message-ID: <20110510081104.229147984@de.ibm.com> (raw)
Message-ID: <20110510081043.6vwmqpSzbnw2zzUolh9YLS9M856QcMRsaa8ts9FC27w@z> (raw)
In-Reply-To: 20110510081039.241831019@de.ibm.com

[-- Attachment #1: 303-mcount-adjust-s390.diff --]
[-- Type: text/plain, Size: 2682 bytes --]

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Do the mcount offset adjustment in the recordmcount.pl/recordmcount.[ch]
at compile time and not in ftrace_call_adjust at run time.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---


 arch/s390/include/asm/ftrace.h |    4 +---
 scripts/recordmcount.c         |    8 ++++++--
 scripts/recordmcount.pl        |    2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)
Index: test-2.6/arch/s390/include/asm/ftrace.h
===================================================================
--- test-2.6.orig/arch/s390/include/asm/ftrace.h	2011-01-10 10:32:42.825504709 +0100
+++ test-2.6/arch/s390/include/asm/ftrace.h	2011-05-03 09:39:07.757500412 +0200
@@ -11,15 +11,13 @@
 
 #ifdef CONFIG_64BIT
 #define MCOUNT_INSN_SIZE  12
-#define MCOUNT_OFFSET	   8
 #else
 #define MCOUNT_INSN_SIZE  20
-#define MCOUNT_OFFSET	   4
 #endif
 
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
-	return addr - MCOUNT_OFFSET;
+	return addr;
 }
 
 #endif /* __ASSEMBLY__ */
Index: test-2.6/scripts/recordmcount.c
===================================================================
--- test-2.6.orig/scripts/recordmcount.c	2011-05-03 09:39:04.929486388 +0200
+++ test-2.6/scripts/recordmcount.c	2011-05-03 09:39:07.757500412 +0200
@@ -338,8 +338,10 @@
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (EM_S390 == w2(ehdr->e_machine))
+		if (EM_S390 == w2(ehdr->e_machine)) {
 			reltype = R_390_32;
+			mcount_adjust_32 = -4;
+		}
 		if (EM_MIPS == w2(ehdr->e_machine)) {
 			reltype = R_MIPS_32;
 			is_fake_mcount32 = MIPS32_is_fake_mcount;
@@ -354,8 +356,10 @@
 				"unrecognized ET_REL file: %s\n", fname);
 			fail_file();
 		}
-		if (EM_S390 == w2(ghdr->e_machine))
+		if (EM_S390 == w2(ghdr->e_machine)) {
 			reltype = R_390_64;
+			mcount_adjust_64 = -8;
+		}
 		if (EM_MIPS == w2(ghdr->e_machine)) {
 			reltype = R_MIPS_64;
 			Elf64_r_sym = MIPS64_r_sym;
Index: test-2.6/scripts/recordmcount.pl
===================================================================
--- test-2.6.orig/scripts/recordmcount.pl	2011-05-03 09:39:04.929486388 +0200
+++ test-2.6/scripts/recordmcount.pl	2011-05-03 09:39:07.757500412 +0200
@@ -242,12 +242,14 @@
 
 } elsif ($arch eq "s390" && $bits == 32) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
+    $mcount_adjust = -4;
     $alignment = 4;
     $ld .= " -m elf_s390";
     $cc .= " -m31";
 
 } elsif ($arch eq "s390" && $bits == 64) {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
+    $mcount_adjust = -8;
     $alignment = 8;
     $type = ".quad";
     $ld .= " -m elf64_s390";


  parent reply	other threads:[~2011-05-10  8:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10  8:10 [patch 0/4] [RFC] mcount address adjustment Martin Schwidefsky
2011-05-10  8:10 ` Martin Schwidefsky
2011-05-10  8:10 ` [patch 1/4] recordmcount " Martin Schwidefsky
2011-05-10  8:10   ` Martin Schwidefsky
2011-05-10  8:10 ` [patch 2/4] x86 mcount offset calculation Martin Schwidefsky
2011-05-10  8:10   ` Martin Schwidefsky
2011-05-10  8:10 ` [patch 3/4] ia64 " Martin Schwidefsky
2011-05-10  8:10   ` Martin Schwidefsky
2011-05-16 18:58   ` Steven Rostedt
2011-05-16 19:17     ` Luck, Tony
2011-05-16 19:17       ` Luck, Tony
2011-05-16 20:41       ` Steven Rostedt
2011-05-17  8:04       ` Martin Schwidefsky
2011-05-17 11:20         ` Steven Rostedt
2011-05-10  8:10 ` Martin Schwidefsky [this message]
2011-05-10  8:10   ` [patch 4/4] s390 " Martin Schwidefsky
2011-05-11 17:23 ` [patch 0/4] [RFC] mcount address adjustment Rabin Vincent
2011-05-11 17:23   ` Rabin Vincent
2011-05-12  9:24   ` Martin Schwidefsky
2011-05-12  9:24     ` Martin Schwidefsky
2011-05-12 13:30     ` Rabin Vincent
2011-05-12 13:30       ` Rabin Vincent
2011-05-16 12:57       ` Dave Martin
2011-05-16 12:57         ` Dave Martin
2011-05-16 14:28         ` Steven Rostedt
2011-05-16 14:28           ` Steven Rostedt

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=20110510081104.229147984@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.