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]
Date:	Mon,  6 Jul 2009 12:07:04 -0700
From:	John Gregor <john.gregor@...gic.com>
To:	linux-kernel@...r.kernel.org
Cc:	John Gregor <johng@...mond.mv.qlogic.com>,
	Ralph Campbell <ralph.campbell@...gic.com>,
	John Gregor <john.gregor@...gic.com>
Subject: [PATCH] x86_64/__iowrite32_copy: don't use string move for PIO writes

From: John Gregor <johng@...mond.mv.qlogic.com>

Some processors can write the same word more than once if the movs
instruction is used. This version uses normal memory move instructions
and gets the same performance since the speed is limited by PCIe and
write combining.

Signed-off-by: Ralph Campbell <ralph.campbell@...gic.com>
Signed-off-by: John Gregor <john.gregor@...gic.com>
---
 arch/x86/lib/iomap_copy_64.S |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/iomap_copy_64.S b/arch/x86/lib/iomap_copy_64.S
index 05a95e7..344b00e 100644
--- a/arch/x86/lib/iomap_copy_64.S
+++ b/arch/x86/lib/iomap_copy_64.S
@@ -1,4 +1,5 @@
 /*
+ * Copyright 2009 QLogic Corporation.  All rights reserved.
  * Copyright 2006 PathScale, Inc.  All Rights Reserved.
  *
  * This file is free software; you can redistribute it and/or modify
@@ -23,8 +24,23 @@
  */
 ENTRY(__iowrite32_copy)
 	CFI_STARTPROC
-	movl %edx,%ecx
-	rep movsd
+	movl    %edx, %ecx
+	andl    $-2, %edx
+	je      .L2
+	leaq    (%rsi,%rdx,4), %rdx
+.L1:
+	movq    (%rsi), %rax
+	addq    $8, %rsi
+	movq    %rax, (%rdi)
+	addq    $8, %rdi
+	cmpq    %rsi, %rdx
+	ja      .L1
+.L2:
+	bt      $0, %ecx
+	jae     .L4
+	movl    (%rsi), %eax
+	movl    %eax, (%rdi)
+.L4:
 	ret
 	CFI_ENDPROC
 ENDPROC(__iowrite32_copy)
-- 
1.6.0.6

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