lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1288368098-26121-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
Date:	Sat, 30 Oct 2010 01:01:37 +0900
From:	Hitoshi Mitake <mitake@....info.waseda.ac.jp>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	linux-kernel@...r.kernel.org, mitake@....info.waseda.ac.jp,
	h.mitake@...il.com, "Ma Ling:" <ling.ma@...el.com>,
	Zhao Yakui <yakui.zhao@...el.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Paul Mackerras <paulus@...ba.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: [PATCH 1/2] perf bench: port memcpy_64.S to perf bench

This patch ports arch/x86/lib/memcpy_64.S to "perf bench mem".
When PERF_BENCH is defined at preprocessor level,
memcpy_64.S is preprocessed to includable form from the sources
under tools/perf for benchmarking programs.

Signed-off-by: Hitoshi Mitake <mitake@....info.waseda.ac.jp>
Cc: Ma Ling: <ling.ma@...el.com>
Cc: Zhao Yakui <yakui.zhao@...el.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: H. Peter Anvin <hpa@...or.com>
---
 arch/x86/lib/memcpy_64.S |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
index 75ef61e..72c6dfe 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -1,10 +1,23 @@
 /* Copyright 2002 Andi Kleen */
 
+/*
+ * perf bench adoption by Hitoshi Mitake
+ * PERF_BENCH means that this file is included from
+ * the source files under tools/perf/ for benchmark programs.
+ *
+ * You don't have to care about PERF_BENCH when
+ * you are working on the kernel.
+ */
+
+#ifndef PERF_BENCH
+
 #include <linux/linkage.h>
 
 #include <asm/cpufeature.h>
 #include <asm/dwarf2.h>
 
+#endif /* PERF_BENCH */
+
 /*
  * memcpy - Copy a memory block.
  *
@@ -23,8 +36,13 @@
  * This gets patched over the unrolled variant (below) via the
  * alternative instructions framework:
  */
+#ifndef PERF_BENCH
 	.section .altinstr_replacement, "ax", @progbits
 .Lmemcpy_c:
+#else
+	.globl memcpy_x86_64_rep
+memcpy_x86_64_rep:
+#endif
 	movq %rdi, %rax
 
 	movl %edx, %ecx
@@ -34,12 +52,19 @@
 	movl %edx, %ecx
 	rep movsb
 	ret
+#ifndef PERF_BENCH
 .Lmemcpy_e:
 	.previous
+#endif
 
+#ifndef PERF_BENCH
 ENTRY(__memcpy)
 ENTRY(memcpy)
 	CFI_STARTPROC
+#else
+	.globl	memcpy_x86_64_unrolled
+memcpy_x86_64_unrolled:
+#endif
 	movq %rdi, %rax
 
 	/*
@@ -166,6 +191,9 @@ ENTRY(memcpy)
 
 .Lend:
 	retq
+
+#ifndef PERF_BENCH
+
 	CFI_ENDPROC
 ENDPROC(memcpy)
 ENDPROC(__memcpy)
@@ -189,3 +217,5 @@ ENDPROC(__memcpy)
 	.byte .Lmemcpy_e - .Lmemcpy_c
 	.byte .Lmemcpy_e - .Lmemcpy_c
 	.previous
+
+#endif
-- 
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ