[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 1/8] configure: Provide option to explicitly disa
From: |
Liam Merwick |
Subject: |
[Qemu-devel] [PATCH v3 1/8] configure: Provide option to explicitly disable AVX2 |
Date: |
Fri, 31 Aug 2018 19:16:05 +0100 |
The configure script detects if the compiler has AVX2 support and
automatically sets avx2_opt="yes" which in turn defines CONFIG_AVX2_OPT.
There is no way of explicitly overriding this setting so this commit adds
two command-line options: --enable-avx2 and --disable-avx2.
The default behaviour, when no option is specified, is to maintain the
current behaviour and enable AVX2 if the compiler supports it.
Signed-off-by: Liam Merwick <address@hidden>
Reviewed-by: Darren Kenny <address@hidden>
Reviewed-by: Mark Kanda <address@hidden>
---
configure | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 58862d2ae88a..8904a91715b3 100755
--- a/configure
+++ b/configure
@@ -427,7 +427,7 @@ usb_redir=""
opengl=""
opengl_dmabuf="no"
cpuid_h="no"
-avx2_opt="no"
+avx2_opt=""
zlib="yes"
capstone=""
lzo=""
@@ -1332,6 +1332,10 @@ for opt do
;;
--disable-glusterfs) glusterfs="no"
;;
+ --disable-avx2) avx2_opt="no"
+ ;;
+ --enable-avx2) avx2_opt="yes"
+ ;;
--enable-glusterfs) glusterfs="yes"
;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
@@ -1709,6 +1713,7 @@ disabled with --disable-FEATURE, default is enabled if
available:
libxml2 for Parallels image format
tcmalloc tcmalloc support
jemalloc jemalloc support
+ avx2 AVX2 optimization support
replication replication support
vhost-vsock virtio sockets device support
opengl opengl support
@@ -5127,7 +5132,7 @@ fi
# There is no point enabling this if cpuid.h is not usable,
# since we won't be able to select the new routines.
-if test $cpuid_h = yes; then
+if test "$cpuid_h" = "yes" -a "$avx2_opt" != "no"; then
cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx2")
@@ -5141,6 +5146,8 @@ int main(int argc, char *argv[]) { return bar(argv[0]); }
EOF
if compile_object "" ; then
avx2_opt="yes"
+ else
+ avx2_opt="no"
fi
fi
--
1.8.3.1
- [Qemu-devel] [PATCH v3 0/8] off-by-one and NULL pointer accesses detected by static analysis, Liam Merwick, 2018/08/31
- [Qemu-devel] [PATCH v3 2/8] job: Fix off-by-one assert checks for JobSTT and JobVerbTable, Liam Merwick, 2018/08/31
- [Qemu-devel] [PATCH v3 5/8] block: Fix potential Null pointer dereferences in vvfat.c, Liam Merwick, 2018/08/31
- [Qemu-devel] [PATCH v3 1/8] configure: Provide option to explicitly disable AVX2,
Liam Merwick <=
- [Qemu-devel] [PATCH v3 3/8] block: Null pointer dereference in blk_root_get_parent_desc(), Liam Merwick, 2018/08/31
- [Qemu-devel] [PATCH v3 4/8] qemu-img: potential Null pointer deref in img_commit(), Liam Merwick, 2018/08/31
- [Qemu-devel] [PATCH v3 6/8] block: dump_qlist() may dereference a Null pointer, Liam Merwick, 2018/08/31
- [Qemu-devel] [PATCH v3 7/8] io: potential unnecessary check in qio_channel_command_new_spawn(), Liam Merwick, 2018/08/31
- [Qemu-devel] [PATCH v3 8/8] qcow2: Read outside array bounds in qcow2_pre_write_overlap_check(), Liam Merwick, 2018/08/31