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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 8 Aug 2009 13:21:13 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	linux-kernel@...r.kernel.org, x86@...nel.org
Cc:	Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] x86: Simplify calls to cpuid by using + for in/out
 constraints

Signed-off-by: Josh Triplett <josh@...htriplett.org>
---

Build-tested only.

 arch/x86/include/asm/processor.h |    7 +++----
 arch/x86/xen/enlighten.c         |    7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index c776826..dfa947e 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -180,11 +180,10 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
 {
 	/* ecx is often an input as well as an output. */
 	asm("cpuid"
-	    : "=a" (*eax),
+	    : "+a" (*eax),
 	      "=b" (*ebx),
-	      "=c" (*ecx),
-	      "=d" (*edx)
-	    : "0" (*eax), "2" (*ecx));
+	      "+c" (*ecx),
+	      "=d" (*edx));
 }
 
 static inline void load_cr3(pgd_t *pgdir)
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 6ee2ef8..6eab164 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -190,11 +190,10 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
 	}
 
 	asm(XEN_EMULATE_PREFIX "cpuid"
-		: "=a" (*ax),
+		: "+a" (*ax),
 		  "=b" (*bx),
-		  "=c" (*cx),
-		  "=d" (*dx)
-		: "0" (*ax), "2" (*cx));
+		  "+c" (*cx),
+		  "=d" (*dx));
 
 	*cx &= maskecx;
 	*dx &= maskedx;
-- 
1.5.6.5

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