]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Explain why x86_64 fat initialization doesn't need any memory barrier.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 13 Jan 2015 16:43:07 +0000 (17:43 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 13 Jan 2015 16:43:07 +0000 (17:43 +0100)
x86_64/fat/fat.c

index 7deb45aeb60f2ebf47dcd72fced108c51969ca44..fc022b9ef30ef6dad5f21d11b6e1a71f6c363c8d 100644 (file)
@@ -150,10 +150,10 @@ fat_init (void)
       _aes_encrypt_vec = _nettle_aes_encrypt_x86_64;
       _aes_decrypt_vec = _nettle_aes_decrypt_x86_64;
     }
-  /* FIXME: We ought to use some thread-aware memory barrier before
-     setting the initialized flag. For now, just do another cpuinfo
-     call to get some synchronization. */
-  _nettle_cpuid (1, cpuid_data);
+
+  /* The x86_64 architecture should always make stores visible in the
+     right order to other processors (except for non-temporal stores
+     and the like). So we don't need any memory barrier. */
   initialized = 1;
 }