public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH -tip tracing/kprobes 2/2] x86: Remove unused config macros  from instruction decoder selftest
       [not found] <20090827163533.GA30268@elte.hu>
@ 2009-08-28 22:12 ` Masami Hiramatsu
  2009-08-28 22:12 ` [PATCH -tip tracing/kprobes 1/2] x86: Allow x86-32 instruction decoder selftest on x86-64 Masami Hiramatsu
  1 sibling, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2009-08-28 22:12 UTC (permalink / raw)
  To: Frederic Weisbecker, Ingo Molnar, lkml
  Cc: systemtap, DLE, Steven Rostedt, Li Zefan, Masami Hiramatsu,
	Frederic Weisbecker, Jim Keniston, Ingo Molnar

Remove dummy definitions of CONFIG_X86_64 and CONFIG_X86_32 because those
macros are not used in the instruction decoder anymore.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
---

 arch/x86/tools/test_get_len.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/x86/tools/test_get_len.c b/arch/x86/tools/test_get_len.c
index a3273f4..376d338 100644
--- a/arch/x86/tools/test_get_len.c
+++ b/arch/x86/tools/test_get_len.c
@@ -21,11 +21,6 @@
 #include <string.h>
 #include <assert.h>
 
-#ifdef __x86_64__
-#define CONFIG_X86_64
-#else
-#define CONFIG_X86_32
-#endif
 #define unlikely(cond) (cond)
 
 #include <asm/insn.h>


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

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

* [PATCH -tip tracing/kprobes 1/2] x86: Allow x86-32 instruction  decoder selftest on x86-64
       [not found] <20090827163533.GA30268@elte.hu>
  2009-08-28 22:12 ` [PATCH -tip tracing/kprobes 2/2] x86: Remove unused config macros from instruction decoder selftest Masami Hiramatsu
@ 2009-08-28 22:12 ` Masami Hiramatsu
  2009-08-30  1:36   ` Frederic Weisbecker
  1 sibling, 1 reply; 3+ messages in thread
From: Masami Hiramatsu @ 2009-08-28 22:12 UTC (permalink / raw)
  To: Frederic Weisbecker, Ingo Molnar, lkml
  Cc: systemtap, DLE, Steven Rostedt, Li Zefan, Masami Hiramatsu,
	Frederic Weisbecker, Jim Keniston, Ingo Molnar

Pass $(CONFIG_64BIT) to the x86 insn decoder selftest for decoding 32bit code
on x86-64, which will happen when building kernel with ARCH=i386 on x86-64.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
---

 arch/x86/tools/Makefile       |    2 +-
 arch/x86/tools/test_get_len.c |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
index 95e9cc4..1bd006c 100644
--- a/arch/x86/tools/Makefile
+++ b/arch/x86/tools/Makefile
@@ -1,6 +1,6 @@
 PHONY += posttest
 quiet_cmd_posttest = TEST    $@
-      cmd_posttest = $(OBJDUMP) -d -j .text $(objtree)/vmlinux | awk -f $(srctree)/arch/x86/tools/distill.awk | $(obj)/test_get_len
+      cmd_posttest = $(OBJDUMP) -d -j .text $(objtree)/vmlinux | awk -f $(srctree)/arch/x86/tools/distill.awk | $(obj)/test_get_len $(CONFIG_64BIT)
 
 posttest: $(obj)/test_get_len vmlinux
 	$(call cmd,posttest)
diff --git a/arch/x86/tools/test_get_len.c b/arch/x86/tools/test_get_len.c
index 1e81adb..a3273f4 100644
--- a/arch/x86/tools/test_get_len.c
+++ b/arch/x86/tools/test_get_len.c
@@ -45,7 +45,7 @@ const char *prog;
 static void usage(void)
 {
 	fprintf(stderr, "Usage: objdump -d a.out | awk -f distill.awk |"
-		" ./test_get_len\n");
+		" %s [y|n](64bit flag)\n", prog);
 	exit(1);
 }
 
@@ -63,11 +63,15 @@ int main(int argc, char **argv)
 	unsigned char insn_buf[16];
 	struct insn insn;
 	int insns = 0;
+	int x86_64 = 0;
 
 	prog = argv[0];
-	if (argc > 1)
+	if (argc > 2)
 		usage();
 
+	if (argc == 2 && argv[1][0] == 'y')
+		x86_64 = 1;
+
 	while (fgets(line, BUFSIZE, stdin)) {
 		char copy[BUFSIZE], *s, *tab1, *tab2;
 		int nb = 0;
@@ -93,11 +97,7 @@ int main(int argc, char **argv)
 				break;
 		}
 		/* Decode an instruction */
-#ifdef __x86_64__
-		insn_init(&insn, insn_buf, 1);
-#else
-		insn_init(&insn, insn_buf, 0);
-#endif
+		insn_init(&insn, insn_buf, x86_64);
 		insn_get_length(&insn);
 		if (insn.length != nb) {
 			fprintf(stderr, "Error: %s", line);


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

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

* Re: [PATCH -tip tracing/kprobes 1/2] x86: Allow x86-32 instruction  decoder selftest on x86-64
  2009-08-28 22:12 ` [PATCH -tip tracing/kprobes 1/2] x86: Allow x86-32 instruction decoder selftest on x86-64 Masami Hiramatsu
@ 2009-08-30  1:36   ` Frederic Weisbecker
  0 siblings, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2009-08-30  1:36 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Ingo Molnar, lkml, systemtap, DLE, Steven Rostedt, Li Zefan,
	Jim Keniston

On Fri, Aug 28, 2009 at 06:13:19PM -0400, Masami Hiramatsu wrote:
> Pass $(CONFIG_64BIT) to the x86 insn decoder selftest for decoding 32bit code
> on x86-64, which will happen when building kernel with ARCH=i386 on x86-64.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Jim Keniston <jkenisto@us.ibm.com>
> Cc: Ingo Molnar <mingo@elte.hu>



Also applied those two, thanks!

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

end of thread, other threads:[~2009-08-30  1:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090827163533.GA30268@elte.hu>
2009-08-28 22:12 ` [PATCH -tip tracing/kprobes 2/2] x86: Remove unused config macros from instruction decoder selftest Masami Hiramatsu
2009-08-28 22:12 ` [PATCH -tip tracing/kprobes 1/2] x86: Allow x86-32 instruction decoder selftest on x86-64 Masami Hiramatsu
2009-08-30  1:36   ` Frederic Weisbecker

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