diff options
author | Robert Hoo <robert.hu@linux.intel.com> | 2020-03-25 14:50:20 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-04-01 14:24:03 -0400 |
commit | b87c99d0731fa30f1f455b211cbcf385b0fe427c (patch) | |
tree | 5c851b01a4f2181e3938330d7a740a075fe4f7d3 /util/bufferiszero.c | |
parent | 674fc21ff6200148675d8f13c192a4cf94d187c2 (diff) |
util/bufferiszero: assign length_to_accel value for each accelerator case
Because in unit test, init_accel() will be called several times, each with
different accelerator type.
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Message-Id: <1585119021-46593-1-git-send-email-robert.hu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util/bufferiszero.c')
-rw-r--r-- | util/bufferiszero.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/bufferiszero.c b/util/bufferiszero.c index 663903553a..b8012532e4 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -254,13 +254,16 @@ static void init_accel(unsigned cache) bool (*fn)(const void *, size_t) = buffer_zero_int; if (cache & CACHE_SSE2) { fn = buffer_zero_sse2; + length_to_accel = 64; } #ifdef CONFIG_AVX2_OPT if (cache & CACHE_SSE4) { fn = buffer_zero_sse4; + length_to_accel = 64; } if (cache & CACHE_AVX2) { fn = buffer_zero_avx2; + length_to_accel = 64; } #endif #ifdef CONFIG_AVX512F_OPT |