From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpxK-0001x8-R7 for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:49:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjpxH-0002Qw-Iv for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:49:06 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpxH-0002Pr-CG for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:49:03 -0400 Received: by mail-wm0-f65.google.com with SMTP id c131so3582516wmh.2 for ; Tue, 13 Sep 2016 08:49:03 -0700 (PDT) Sender: Paolo Bonzini References: <1472496380-19706-1-git-send-email-rth@twiddle.net> <1472496380-19706-8-git-send-email-rth@twiddle.net> <56a3caa7-d870-dc12-77a8-272443df528c@redhat.com> <3d12326f-61df-e00e-0793-89882962927f@redhat.com> From: Paolo Bonzini Message-ID: Date: Tue, 13 Sep 2016 17:47:59 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 7/9] cutils: Rewrite x86 buffer zero checking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: vijay.kilari@gmail.com On 13/09/2016 16:49, Paolo Bonzini wrote: > > > On 13/09/2016 16:17, Paolo Bonzini wrote: >> >> >> On 13/09/2016 15:26, Paolo Bonzini wrote: >>> I need this on top to fix compilation with older compilers: >>> >>> diff --git a/util/bufferiszero.c b/util/bufferiszero.c >>> index 3b39f82..1ce6b7a 100644 >>> --- a/util/bufferiszero.c >>> +++ b/util/bufferiszero.c >>> @@ -71,13 +71,13 @@ buffer_zero_int(const void *buf, size_t len) >>> >>> #if defined(CONFIG_AVX2_OPT) || defined(__SSE2__) >>> #include >>> -#include >>> >>> /* Note that we're going to check for LEN >= 64 for all of these. */ >>> >>> #ifdef CONFIG_AVX2_OPT >>> #pragma GCC push_options >>> #pragma GCC target("avx2") >>> +#include >>> >>> static bool >>> buffer_zero_avx2(const void *buf, size_t len) >>> @@ -181,6 +181,8 @@ buffer_zero_sse4(const void *buf, size_t len) >>> #pragma GCC target("sse2") >>> #endif /* CONFIG_AVX2_OPT */ >>> >>> +#include >>> + >>> static bool >>> buffer_zero_sse2(const void *buf, size_t len) >>> { >>> >> >> Nope, not enough on GCC 4.8: >> >> $ nm util/bufferiszero.o >> 0000000000000000 b buffer_accel >> 0000000000000430 T buffer_is_zero >> 0000000000000240 t buffer_zero_avx >> 0000000000000330 t buffer_zero_avx2 >> 0000000000000000 t buffer_zero_int >> 00000000000000b0 t buffer_zero_sse2 >> 0000000000000190 t buffer_zero_sse4 >> 0000000000000008 b cpuid_cache >> U _GLOBAL_OFFSET_TABLE_ >> 0000000000000000 t init_cpuid_cache >> U _mm_cmpeq_epi8 >> U _mm_loadu_si128 >> U _mm_movemask_epi8 >> U _mm_setzero_si128 >> U _mm_testz_si128 >> 00000000000003d0 T test_buffer_is_zero_next_accel >> >> Since I have no idea what's going on, I'm dropping these the last three >> patches. > > I still have no idea what's going on, but dropping this patch is enough. Ok, it's the AVX version, the failure somehow is related to vptest not being in AVX1. Paolo