From nobody Wed Nov 5 16:35:42 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1535733635458646.0504881492469; Fri, 31 Aug 2018 09:40:35 -0700 (PDT) Received: from localhost ([::1]:55003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvmTG-0006Fo-Ez for importer@patchew.org; Fri, 31 Aug 2018 12:40:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvmOO-0000zg-S4 for qemu-devel@nongnu.org; Fri, 31 Aug 2018 12:35:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvmOL-0005CS-O4 for qemu-devel@nongnu.org; Fri, 31 Aug 2018 12:35:27 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:39744) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fvmOH-00053K-TS for qemu-devel@nongnu.org; Fri, 31 Aug 2018 12:35:23 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7VGZ29J140701 for ; Fri, 31 Aug 2018 16:35:16 GMT Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2m2yrqvb93-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 31 Aug 2018 16:35:15 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7VGZALd019790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 31 Aug 2018 16:35:10 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w7VGZA7D017616 for ; Fri, 31 Aug 2018 16:35:10 GMT Received: from ol7.nl.oracle.com (/10.175.61.138) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 31 Aug 2018 09:35:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=eDhTNATvwz0R/eran1+RhIzM6VNSevCzSAtvdr4AQ90=; b=mNZN6NchNIgWBFeRx8anM0HIGeFyIPElI4y2MRrx54MOACw6Xpl2be0HPrVEEHwzACYH STy7A4zX/D604tWN8zkjn59ms+Z7zZ0YK8jAfl/92cqyFd57o5eyV8MfTV+a9cbbnrF5 pykyjbgCM+Vk+l+1IjmJLhYOo2D1Pfwi2Gvbh5WMwAroBwMoW2XrxCQTlUv6rxqk+2LJ Ab2c+vLJSbK6bdJYK9CEeFdc7p0hlsiOEDP3RPDYP1SR+4C6wEDeRj/6/ozC5S9gHHlE DBw+seFWYY8rE8cCjtZ4hdC2PR0WNAJqD4T+LbEiZfJ8bzvYV8dVNXTdUvjv0RhVfANO kQ== From: Liam Merwick To: qemu-devel@nongnu.org Date: Fri, 31 Aug 2018 17:36:47 +0100 Message-Id: <1535733414-6812-2-git-send-email-Liam.Merwick@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1535733414-6812-1-git-send-email-Liam.Merwick@oracle.com> References: <1535733414-6812-1-git-send-email-Liam.Merwick@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9001 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=734 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808310170 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [PATCH v2 1/8] configure: Provide option to explicitly disable AVX2 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The configure script detects if the compiler has AVX2 support and automatically sets avx2_opt=3D"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 Reviewed-by: Darren Kenny Reviewed-by: Mark Kanda --- 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=3D"" opengl=3D"" opengl_dmabuf=3D"no" cpuid_h=3D"no" -avx2_opt=3D"no" +avx2_opt=3D"" zlib=3D"yes" capstone=3D"" lzo=3D"" @@ -1332,6 +1332,10 @@ for opt do ;; --disable-glusterfs) glusterfs=3D"no" ;; + --disable-avx2) avx2_opt=3D"no" + ;; + --enable-avx2) avx2_opt=3D"yes" + ;; --enable-glusterfs) glusterfs=3D"yes" ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) @@ -1709,6 +1713,7 @@ disabled with --disable-FEATURE, default is enabled i= f 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. =20 -if test $cpuid_h =3D yes; then +if test "$cpuid_h" =3D "yes" -a "$avx2_opt" !=3D "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=3D"yes" + else + avx2_opt=3D"no" fi fi =20 --=20 1.8.3.1