From: Niels Möller Date: Tue, 13 Jan 2015 16:43:07 +0000 (+0100) Subject: Explain why x86_64 fat initialization doesn't need any memory barrier. X-Git-Tag: nettle_3.1rc1~46^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44f2687d2cd8f6d2163a43f7299e2b903f6e4552;p=thirdparty%2Fnettle.git Explain why x86_64 fat initialization doesn't need any memory barrier. --- diff --git a/x86_64/fat/fat.c b/x86_64/fat/fat.c index 7deb45ae..fc022b9e 100644 --- a/x86_64/fat/fat.c +++ b/x86_64/fat/fat.c @@ -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; }