[PATCH 1/3] Fix hwdetect assembler clobbers

Jussi Kivilinna jussi.kivilinna at mbnet.fi
Wed Nov 14 23:30:07 CET 2012


detect_x86_64_gnuc() and detect_ia32_gnuc() have missing clobbers in
assembler statements. "%ebx" is missing in x86-64, probably because
copy-paste error (i386 code saves and restores %ebx to/from stack).
"%ecx" is missing from PadLock detection.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
---
 src/hwfeatures.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/hwfeatures.c b/src/hwfeatures.c
index cf80fe0..456c07a 100644
--- a/src/hwfeatures.c
+++ b/src/hwfeatures.c
@@ -56,7 +56,7 @@ detect_x86_64_gnuc (void)
      "movl  %%ecx, 8(%0)\n\t"
      :
      : "S" (&vendor_id[0])
-     : "%eax", "%ecx", "%edx", "cc"
+     : "%eax", "%ebx", "%ecx", "%edx", "cc"
      );
   vendor_id[12] = 0;
 
@@ -105,7 +105,7 @@ detect_x86_64_gnuc (void)
          ".Lready%=:\n"
          : "+r" (hw_features)
          :
-         : "%eax", "%edx", "cc"
+         : "%eax", "%ebx", "%ecx", "%edx", "cc"
          );
     }
 #endif /*ENABLE_PADLOCK_SUPPORT*/
@@ -122,7 +122,7 @@ detect_x86_64_gnuc (void)
          ".Lno_aes%=:\n"
          : "+r" (hw_features)
          :
-         : "%eax", "%ecx", "%edx", "cc"
+         : "%eax", "%ebx", "%ecx", "%edx", "cc"
          );
     }
   else if (!strcmp (vendor_id, "AuthenticAMD"))
@@ -230,7 +230,7 @@ detect_ia32_gnuc (void)
          ".Lready%=:\n"
          : "+r" (hw_features)
          :
-         : "%eax", "%edx", "cc"
+         : "%eax", "%ecx", "%edx", "cc"
          );
     }
 #endif /*ENABLE_PADLOCK_SUPPORT*/




More information about the Gcrypt-devel mailing list