From patchwork Thu Jun 20 13:02:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13705453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0420C2BA1A for ; Thu, 20 Jun 2024 13:04:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKHRZ-0001Qv-6E; Thu, 20 Jun 2024 09:03:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRX-0001QX-HU for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRV-0006Wo-Ot for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718888588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LuxMfRanQpqIe+rAUiRiqqmIxZ2Dd4XmJCnCNtxApfk=; b=MhXLm+7FghTej6orLIU9LVeDVkqiL/YNeBda0c/mIlrUPBxxnKhtJyTBA5fSoFMu0+VP+0 sctyiZaiMZ3P3p9wTjQ8ZbxdjnzhjToWGHeuxxwalW553jQ/X/TV603lyY7J7PULCrQ35D bBZZ9FG+EHWt5aPmDRx3AOlHwLLGoKQ= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-126-FBHZiCqUPp2fdx3FT8e4yg-1; Thu, 20 Jun 2024 09:03:03 -0400 X-MC-Unique: FBHZiCqUPp2fdx3FT8e4yg-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-57cdc3f0410so458793a12.2 for ; Thu, 20 Jun 2024 06:03:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718888581; x=1719493381; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LuxMfRanQpqIe+rAUiRiqqmIxZ2Dd4XmJCnCNtxApfk=; b=LSj/bR9I7E3MTPRi2vLF7ihxBCGJ1O5NtQreIdtTzPpCFw/APwvigiL8LVRM+GbzDi 9ZVBscPA06d/5TzdcFEi5xndhG42PKQmeDY12XraGZmkv6Sk3XJRPqBh36V4BeR2RFpB hnvLqhCVZjaVx9WDPjyBOnXzmbUp5/5ZOA+AtGxf6jc3n2DnhC3WPinElFrBaH26ztiM N3eR3AR1W8KWq4J0ReuulS35o1Kj9b67iXVEp206mSXJDLMd1s0qfiZn7aZTROLrmWJW FXdC6ZUiaQ23jMAu2/S50Zsn+q4cEq+eY1xxZWURYl1Ifth3+jvRwUH3ROL6nhuAN5Xe 8W0A== X-Gm-Message-State: AOJu0Yyo85HJI0tIGcUUmi5mhwivTcLH1GtlRD8J/nHD4iGtGyxhzdf9 6RbbRUhK9ji3X6LVq7CMPGMC5nnskmpJEDyGPwlFNYO9Axn4S0XjyeEwm0V4H2G1IgF5fAyMG5D hLvywkQ922Fk8dq9YoIgvMYTdBNiIg1Mh0XMCZ1xqLJAtEsp4LbogU13Np3KiPQ1h4G1k+0ABXN uYd7DzqrzvUio8xiGPlBTQ17Om5fu+XfXuIKNm X-Received: by 2002:a50:d707:0:b0:57c:5fca:ab25 with SMTP id 4fb4d7f45d1cf-57d07e84bf2mr3389304a12.25.1718888581680; Thu, 20 Jun 2024 06:03:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHr6TmoysP21cnHNMxklPhbR8DW1eELX2UPuk1Q/bseUyUSNPxkRMEAAsVIYq+a7NaLoUE5Mg== X-Received: by 2002:a50:d707:0:b0:57c:5fca:ab25 with SMTP id 4fb4d7f45d1cf-57d07e84bf2mr3389285a12.25.1718888581227; Thu, 20 Jun 2024 06:03:01 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d21df986esm860455a12.72.2024.06.20.06.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 06:03:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , amonakov@ispras.ru Subject: [PATCH 1/6] Revert "host/i386: assume presence of POPCNT" Date: Thu, 20 Jun 2024 15:02:49 +0200 Message-ID: <20240620130254.415699-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620130254.415699-1-pbonzini@redhat.com> References: <20240620130254.415699-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This reverts commit 45ccdbcb24baf99667997fac5cf60318e5e7db51. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + tcg/i386/tcg-target.h | 5 +++-- util/cpuinfo-i386.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/cpuinfo.h index c1e94d75ce1..72f6fad61e5 100644 --- a/host/include/i386/host/cpuinfo.h +++ b/host/include/i386/host/cpuinfo.h @@ -11,6 +11,7 @@ #define CPUINFO_ALWAYS (1u << 0) /* so cpuinfo is nonzero */ #define CPUINFO_MOVBE (1u << 2) #define CPUINFO_LZCNT (1u << 3) +#define CPUINFO_POPCNT (1u << 4) #define CPUINFO_BMI1 (1u << 5) #define CPUINFO_BMI2 (1u << 6) #define CPUINFO_AVX1 (1u << 9) diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index ecc69827287..2f67a97e059 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -111,6 +111,7 @@ typedef enum { #endif #define have_bmi1 (cpuinfo & CPUINFO_BMI1) +#define have_popcnt (cpuinfo & CPUINFO_POPCNT) #define have_avx1 (cpuinfo & CPUINFO_AVX1) #define have_avx2 (cpuinfo & CPUINFO_AVX2) #define have_movbe (cpuinfo & CPUINFO_MOVBE) @@ -142,7 +143,7 @@ typedef enum { #define TCG_TARGET_HAS_nor_i32 0 #define TCG_TARGET_HAS_clz_i32 1 #define TCG_TARGET_HAS_ctz_i32 1 -#define TCG_TARGET_HAS_ctpop_i32 1 +#define TCG_TARGET_HAS_ctpop_i32 have_popcnt #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 1 #define TCG_TARGET_HAS_sextract_i32 1 @@ -177,7 +178,7 @@ typedef enum { #define TCG_TARGET_HAS_nor_i64 0 #define TCG_TARGET_HAS_clz_i64 1 #define TCG_TARGET_HAS_ctz_i64 1 -#define TCG_TARGET_HAS_ctpop_i64 1 +#define TCG_TARGET_HAS_ctpop_i64 have_popcnt #define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract_i64 1 #define TCG_TARGET_HAS_sextract_i64 0 diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c index 8f2694d88f2..6d474a6259a 100644 --- a/util/cpuinfo-i386.c +++ b/util/cpuinfo-i386.c @@ -35,6 +35,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) __cpuid(1, a, b, c, d); info |= (c & bit_MOVBE ? CPUINFO_MOVBE : 0); + info |= (c & bit_POPCNT ? CPUINFO_POPCNT : 0); info |= (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0); /* NOTE: our AES support requires SSSE3 (PSHUFB) as well. */ From patchwork Thu Jun 20 13:02:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13705448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B3D7C27C79 for ; Thu, 20 Jun 2024 13:04:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKHRY-0001Qt-5h; Thu, 20 Jun 2024 09:03:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRV-0001QF-Q3 for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRU-0006Wk-1S for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718888587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i1Dd/q0yvFV1Rcm+rk+YwoeGVJGUNMen0d4jeqopdXw=; b=QkhEdI6rCHFBYbj8ZcBmgbNzhY+BH2FpZAReDH/nR/8JS45KWXky8cBO65XvCJnO1eXq+O HPql0YLO8Ui16TLSH+eLqkRdSbdztrQ8+VGwnPJgUH2MOCwsm9m/ruC4k7YbwOVmp6htug tf3sMKaS47XinbNw3REY8yHAZGIErAI= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-rRws4LMSNFqBVquPjpmL8Q-1; Thu, 20 Jun 2024 09:03:05 -0400 X-MC-Unique: rRws4LMSNFqBVquPjpmL8Q-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a6efbb08949so36771166b.0 for ; Thu, 20 Jun 2024 06:03:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718888584; x=1719493384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i1Dd/q0yvFV1Rcm+rk+YwoeGVJGUNMen0d4jeqopdXw=; b=s3wn/Tn+yq4ok/sKwqjoJPtZupUxzmxJFqKDBFGvnPNZEKNJHBRBCeVgfs7S+2z0fO 390Pu6t4dY1Wa6hBgbNHescyCDc92hUkxFkGl80UiTBMu/qZw+dkrGotcKgd/voxVpkD XHxxM3QXnnsdM4XbmSBV5IxGPgeRCA9Ly42JjOjH8odD6RPiDiFCwSqE86NEEcpYEjQA kuz0Y+aiv4m8OGYYpzLirMBUunDOm63quAQoOXpV6buQqvmaERX+i/+peENhoDjfZlxo IgX2Wu8wE2ejX4mS64A8/9WiLZ29KHni7TgZKKjiM9HKZWVgixbM+oh3HvMy/J7r6ydj nfWw== X-Gm-Message-State: AOJu0YyWL1H4lDEZACXtrtcL7lW7JaXKu2AyDrUbOK8Sf6ielH7YiBsl J1+BHaIA2HnccXjNi2CiiDF5lI5xH1Bs4GLsKPG4cJ1NLPhVdGF0ZzsfMYh6qaepD+xT6eYR6AL yqeGQAqcFLD85BsIzMms3CjV+ZUSHt5ReWOPF7vlmyMOP64CYh/b0Ns3q/X5XPIGRoQ60pEVMEf mVY1sJnC8JOQ+fKrv1JvzeYpaDQmVawsoPfGJ0 X-Received: by 2002:a17:907:d30c:b0:a6f:b1fa:aa24 with SMTP id a640c23a62f3a-a6fb1faaa8dmr371966366b.5.1718888584329; Thu, 20 Jun 2024 06:03:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHRVK/lLtA1fciNUQY7dGRTNR3lwYErop8nKJa0PTh/upPFcXV3U1WntbRveVeG1j0iC0pOA== X-Received: by 2002:a17:907:d30c:b0:a6f:b1fa:aa24 with SMTP id a640c23a62f3a-a6fb1faaa8dmr371963766b.5.1718888583928; Thu, 20 Jun 2024 06:03:03 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56fa415dsm772240266b.220.2024.06.20.06.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 06:03:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , amonakov@ispras.ru Subject: [PATCH 2/6] Revert "host/i386: assume presence of SSSE3" Date: Thu, 20 Jun 2024 15:02:50 +0200 Message-ID: <20240620130254.415699-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620130254.415699-1-pbonzini@redhat.com> References: <20240620130254.415699-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This reverts commit 433cd6d94a8256af70a5200f236dc8047c3c1468. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- util/cpuinfo-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c index 6d474a6259a..ca74ef04f54 100644 --- a/util/cpuinfo-i386.c +++ b/util/cpuinfo-i386.c @@ -38,8 +38,8 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) info |= (c & bit_POPCNT ? CPUINFO_POPCNT : 0); info |= (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0); - /* NOTE: our AES support requires SSSE3 (PSHUFB) as well. */ - info |= (c & bit_AES) ? CPUINFO_AES : 0; + /* Our AES support requires PSHUFB as well. */ + info |= ((c & bit_AES) && (c & bit_SSSE3) ? CPUINFO_AES : 0); /* For AVX features, we must check available and usable. */ if ((c & bit_AVX) && (c & bit_OSXSAVE)) { From patchwork Thu Jun 20 13:02:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13705451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99686C27C79 for ; Thu, 20 Jun 2024 13:04:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKHRa-0001SC-Im; Thu, 20 Jun 2024 09:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRY-0001Qw-Rj for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRX-0006X0-3F for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718888590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GlW/705FWiMprOSUKjNiwJlL+EDmg1xNJ9taeoREqJs=; b=MXuYIQWEQuEnk5pGiVj4dSs0n9GIXvWfAaMncDZXx8HdQnLqLhw+4gQqMXdGPQb1gynK/M ITYvIIWvpfxJGRn8wzxWIUuvPFn7kVenMPPK9vrr8L9zc1h3GXZfdq5hGu7sNc6Zh8P9Ij mUkZCJnLd7pP40HxkUaEf9dlt1uHqVM= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-265-oVZwD-QpPWWS4cUbJ3Jheg-1; Thu, 20 Jun 2024 09:03:09 -0400 X-MC-Unique: oVZwD-QpPWWS4cUbJ3Jheg-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-57cad6e94e5so378407a12.3 for ; Thu, 20 Jun 2024 06:03:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718888587; x=1719493387; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GlW/705FWiMprOSUKjNiwJlL+EDmg1xNJ9taeoREqJs=; b=adKpWgdLFATOnJMaJBI8BODrY1I9tWFGX+Z91BbHPvgmVx0Kv7EH7/OV4EGVuXH1Va 8O1JamVjqmehQMHNJJda+sSNVZIErTR1hacnnQDacAGe/3CiLVYC/u6QNWi6zQ9o2AS3 dICpLu+lSqTTgsqqkATg+rcCA/xl5f3xqHk30lRHGPABfZ3G9RzyQVguh0uhCQhCiZt/ TdWMcVlM24yOUG67Ch/IyIhSQoOGcUoAeZ1JVoz/7KvylCySmnwqW8mcWc2deYicKAxH YLJehDkA6mb+hD8lKmbWVMKXSAHlVzGBeq+xbRhqSdhg+en6G3EWynhCIcQsTiSurX/P thYg== X-Gm-Message-State: AOJu0Yw6+ny+/H6yRwSL9RLwz0PCf6mxM/fYlReqy1FZukyy/bKs2Jsz mHhkZ8cxKY7w5SgUg0Kvf2okB7YCPbv/HXw+SzBStrQQWXWc4uPN50DpyK0VcpezLzi6TIRezY4 65vgiWuIdFloXQUhknIptQmhBiij8DhZNFBhKfvtdb5S/CmqLMkSgxBRoN0JcWbm1uzPvwnQq2g kXPVLnMn51x+e71BJmbMHGawiYITB2CRLC5a2S X-Received: by 2002:a50:d504:0:b0:57c:6861:d72b with SMTP id 4fb4d7f45d1cf-57d272db7a2mr437978a12.9.1718888587115; Thu, 20 Jun 2024 06:03:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFR4aHAZ6xt/O21ytBNlhtOAmUXMvL4bQH78obqORQ5BeT0L4sxIm03+Svx1Ww1wtCwUHFd3w== X-Received: by 2002:a50:d504:0:b0:57c:6861:d72b with SMTP id 4fb4d7f45d1cf-57d272db7a2mr437956a12.9.1718888586636; Thu, 20 Jun 2024 06:03:06 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb743ade6sm9648218a12.95.2024.06.20.06.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 06:03:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , amonakov@ispras.ru Subject: [PATCH 3/6] Revert "host/i386: assume presence of SSE2" Date: Thu, 20 Jun 2024 15:02:51 +0200 Message-ID: <20240620130254.415699-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620130254.415699-1-pbonzini@redhat.com> References: <20240620130254.415699-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + util/bufferiszero.c | 4 ++-- util/cpuinfo-i386.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/cpuinfo.h index 72f6fad61e5..81771733eaa 100644 --- a/host/include/i386/host/cpuinfo.h +++ b/host/include/i386/host/cpuinfo.h @@ -14,6 +14,7 @@ #define CPUINFO_POPCNT (1u << 4) #define CPUINFO_BMI1 (1u << 5) #define CPUINFO_BMI2 (1u << 6) +#define CPUINFO_SSE2 (1u << 7) #define CPUINFO_AVX1 (1u << 9) #define CPUINFO_AVX2 (1u << 10) #define CPUINFO_AVX512F (1u << 11) diff --git a/util/bufferiszero.c b/util/bufferiszero.c index 11c080e02cf..74864f7b782 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -188,14 +188,14 @@ static biz_accel_fn const accel_table[] = { static unsigned best_accel(void) { -#ifdef CONFIG_AVX2_OPT unsigned info = cpuinfo_init(); +#ifdef CONFIG_AVX2_OPT if (info & CPUINFO_AVX2) { return 2; } #endif - return 1; + return info & CPUINFO_SSE2 ? 1 : 0; } #elif defined(__aarch64__) && defined(__ARM_NEON) diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c index ca74ef04f54..90f92a42dc8 100644 --- a/util/cpuinfo-i386.c +++ b/util/cpuinfo-i386.c @@ -34,6 +34,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) if (max >= 1) { __cpuid(1, a, b, c, d); + info |= (d & bit_SSE2 ? CPUINFO_SSE2 : 0); info |= (c & bit_MOVBE ? CPUINFO_MOVBE : 0); info |= (c & bit_POPCNT ? CPUINFO_POPCNT : 0); info |= (c & bit_PCLMUL ? CPUINFO_PCLMUL : 0); From patchwork Thu Jun 20 13:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13705450 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4687DC27C79 for ; Thu, 20 Jun 2024 13:04:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKHRh-0001dg-4G; Thu, 20 Jun 2024 09:03:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRf-0001ZN-FF for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRd-0006XX-Nw for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718888596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Iwf7E6c/3J88Z/SA0VCe8inq5N9r0YamgWdaOJEaKjI=; b=L5t2z541jz3njR7hqht4/0R4goSJspAvJg7z4baSikS5tPT58OQrW82cklj/rAxRpx/MN9 k1Qb7jXM7ZEx1L3SrYGRzRFc4WLcG0ZnZWKPQit2U1YfBcgnsMH/+8ATpPkF3AvLp7BVBV vwHwlVgW80dlBjpC5pHaHCI2ODjmhxU= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-HT4FkgtSOBqficcKj9nQlA-1; Thu, 20 Jun 2024 09:03:14 -0400 X-MC-Unique: HT4FkgtSOBqficcKj9nQlA-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a6f381ea95dso95997866b.0 for ; Thu, 20 Jun 2024 06:03:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718888589; x=1719493389; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iwf7E6c/3J88Z/SA0VCe8inq5N9r0YamgWdaOJEaKjI=; b=XCks3BOdljWVWllBsKCwxc8V6E8JiIISLv02whCEcSlxoL+aQ9KHq4jRZlpcR6lqKp DjgeXx0kLRq6C3f7mmY46/894BeeXbLqUU4BCY8FTlfNl9ij5aW7QI58oJum8HvGpDrT +aBrq4giDhV0tyLmTH6TQRqQMrDtq0Yp2tlqSnilPYFNtAfDQAo8jrwaJPZQz6g2YwD8 mJ3ua3hE5LI/NUkuS52DQOgP8hK0z/HEvy9u/MDGrwca7ob1NSicn8E5aFupnLq8sXnK M6GzjLrZOzJ96VyYNbYcjqR5/gFa+5yB3oGs/+py91eai5Z/vS4Hgu0EuM0kZXRfombN jaZQ== X-Gm-Message-State: AOJu0Yx1VhRQtiVWmjor2+0d+XVvdLHmEaDaj0fkpfWixEGMm/4MhWgU Cg+ClMemTRYNREUYlNTe8kfQbp/joGxa93ucSg0IQmYnxJ2KnwcENGL2NKCs2BwXTnFfx0zqjfd 3wnkEQJ3XlVFYcOPJ2aB8az7FmZU/HnP7NSnrMOVgJZSRBTgHGiZXWkkciIwq/lKglmXNRpEObp Baify9TfLtK4ZZjXxAdLAxgJyHK3FooWpDpGOH X-Received: by 2002:a17:907:d406:b0:a6f:b3d3:fed1 with SMTP id a640c23a62f3a-a6fb3d3ff9amr349855966b.10.1718888589526; Thu, 20 Jun 2024 06:03:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiSJLs3cJDkV1a8dXVrEgjyYHTGJQZ9qlBvN3pTMTX7278kHPx4iAieDTnOiF58k34uOGKkA== X-Received: by 2002:a17:907:d406:b0:a6f:b3d3:fed1 with SMTP id a640c23a62f3a-a6fb3d3ff9amr349853266b.10.1718888589199; Thu, 20 Jun 2024 06:03:09 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56ecdd2asm778117266b.141.2024.06.20.06.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 06:03:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , amonakov@ispras.ru Subject: [PATCH 4/6] meson: allow configuring the x86-64 baseline Date: Thu, 20 Jun 2024 15:02:52 +0200 Message-ID: <20240620130254.415699-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620130254.415699-1-pbonzini@redhat.com> References: <20240620130254.415699-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Paolo Bonzini Acked-by: Richard Henderson --- meson.build | 41 ++++++++++++++++++++++++++++------- meson_options.txt | 3 +++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 97e00d6f59b..6e694ecd9fe 100644 --- a/meson.build +++ b/meson.build @@ -336,15 +336,40 @@ if host_arch == 'i386' and not cc.links(''' qemu_common_flags = ['-march=i486'] + qemu_common_flags endif -# Assume x86-64-v2 (minus CMPXCHG16B for 32-bit code) -if host_arch == 'i386' - qemu_common_flags = ['-mfpmath=sse'] + qemu_common_flags -endif +# Pick x86-64 baseline version if host_arch in ['i386', 'x86_64'] - qemu_common_flags = ['-mpopcnt', '-msse4.2'] + qemu_common_flags -endif -if host_arch == 'x86_64' - qemu_common_flags = ['-mcx16'] + qemu_common_flags + if get_option('x86_version') == '0' and host_arch == 'x86_64' + error('x86_64-v1 required for x86-64 hosts') + endif + + # add flags for individual instruction set extensions + if get_option('x86_version') >= '1' + if host_arch == 'i386' + qemu_common_flags = ['-mfpmath=sse'] + qemu_common_flags + else + # present on basically all processors but technically not part of + # x86-64-v1, so only include -mneeded for x86-64 version 2 and above + qemu_common_flags = ['-mcx16'] + qemu_common_flags + endif + endif + if get_option('x86_version') >= '2' + qemu_common_flags = ['-mpopcnt'] + qemu_common_flags + qemu_common_flags = cc.get_supported_arguments('-mneeded') + qemu_common_flags + endif + if get_option('x86_version') >= '3' + qemu_common_flags = ['-mmovbe', '-mabm', '-mbmi1', '-mbmi2', '-mfma', '-mf16c'] + qemu_common_flags + endif + + # add required vector instruction set (each level implies those below) + if get_option('x86_version') == '1' + qemu_common_flags = ['-msse2'] + qemu_common_flags + elif get_option('x86_version') == '2' + qemu_common_flags = ['-msse4.2'] + qemu_common_flags + elif get_option('x86_version') == '3' + qemu_common_flags = ['-mavx2'] + qemu_common_flags + elif get_option('x86_version') == '4' + qemu_common_flags = ['-mavx512f', '-mavx512bw', '-mavx512cd', '-mavx512dq', '-mavx512vl'] + qemu_common_flags + endif endif if get_option('prefer_static') diff --git a/meson_options.txt b/meson_options.txt index 7a79dd89706..6065ed2d352 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -370,3 +370,6 @@ option('qemu_ga_version', type: 'string', value: '', option('hexagon_idef_parser', type : 'boolean', value : true, description: 'use idef-parser to automatically generate TCG code for the Hexagon frontend') + +option('x86_version', type : 'combo', choices : ['0', '1', '2', '3', '4'], value: '1', + description: 'tweak required x86_64 architecture version beyond compiler default') diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 58d49a447d5..62842d47e88 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -82,6 +82,8 @@ meson_options_help() { printf "%s\n" ' --with-suffix=VALUE Suffix for QEMU data/modules/config directories' printf "%s\n" ' (can be empty) [qemu]' printf "%s\n" ' --with-trace-file=VALUE Trace file prefix for simple backend [trace]' + printf "%s\n" ' --x86-version=CHOICE tweak required x86_64 architecture version beyond' + printf "%s\n" ' compiler default [1] (choices: 0/1/2/3)' printf "%s\n" '' printf "%s\n" 'Optional features, enabled with --enable-FEATURE and' printf "%s\n" 'disabled with --disable-FEATURE, default is enabled if available' @@ -552,6 +554,7 @@ _meson_option_parse() { --disable-werror) printf "%s" -Dwerror=false ;; --enable-whpx) printf "%s" -Dwhpx=enabled ;; --disable-whpx) printf "%s" -Dwhpx=disabled ;; + --x86-version=*) quote_sh "-Dx86_version=$2" ;; --enable-xen) printf "%s" -Dxen=enabled ;; --disable-xen) printf "%s" -Dxen=disabled ;; --enable-xen-pci-passthrough) printf "%s" -Dxen_pci_passthrough=enabled ;; From patchwork Thu Jun 20 13:02:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13705449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 034ECC2BA1A for ; Thu, 20 Jun 2024 13:04:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKHRi-0001ha-T4; Thu, 20 Jun 2024 09:03:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRg-0001be-CO for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRe-0006Xd-Pm for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718888597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ggQxI/ZZR6ZKzmd07qXaus7hQHvI+R15IGE2EWs6qMQ=; b=BvySuifaaRRcTusFyJwhtwEo5W7DZkhu0xZhRNRZbQl32k2rSaPgZal+8+/0UQ7mc1kDQS 8Ui37NmiEF6/MXXor4k4jAMb7VLK58xsdhAmzuFxarp9wdM1snAVPC+4DP6heFsFxS3H5e v8yasXi8wDFQyPCFgRVC7n8U+uZL/I8= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-KHoSSO_EPxqDvmxsLgTwcA-1; Thu, 20 Jun 2024 09:03:15 -0400 X-MC-Unique: KHoSSO_EPxqDvmxsLgTwcA-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-52bc1e919deso638387e87.0 for ; Thu, 20 Jun 2024 06:03:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718888592; x=1719493392; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ggQxI/ZZR6ZKzmd07qXaus7hQHvI+R15IGE2EWs6qMQ=; b=V1QCWGbU+Xy8Xij2uG6upmdpLl8ae+IfxRSCqNYlv/Z0A0KWbn1huSAbZMo7A1qpKi K5cEkZrU/Aemq2xfJF8qN+EvI5PsxUFakKJVBZFqqp/whHoCss489UmvtdZPcZXVgiYO XpbAWauPXbGOCPZJ2PVvDVWt86G9YDPkxfecxuLefU9fGkaEM6LgT7D3jEEYJQG+dRy3 xwWuuJRho91LWTnpenA/KdtBEG4nbQ3bUxAFubBbGTGpXL/bYHeCAlrzT0MCWlGXHOQ/ fp8hFsxcOjJyrpGZS9U2IYjrrUAj7GqNPexxotI3MCoxSoHGcuX4+aNuaJTi9T8yYoM1 sTDA== X-Gm-Message-State: AOJu0YwxFKXfEAqRZOT5o6CMsAPU8IYQd/Kt5CPRrqQ/PbR9lvDLiV7P lBtCgmy7wJ4oav59n4njeFoZL7TPJduR9JjoAC2snYqoVE/Q8HmIIhMhL+UqFq1mCFXLF240lD/ ziKmR57z9RtEVk5fw2k4xdw9frvt9q9XkBeQGjo+9/yQOeaFOj91tO2fvqS1K/rP3EweWgAR7E7 VjCiIZS9434NHuWPho9MOZ0IxPj8zbv8UZFqZI X-Received: by 2002:a05:6512:3d04:b0:52b:c262:99b3 with SMTP id 2adb3069b0e04-52ccaa5693emr3925100e87.11.1718888592564; Thu, 20 Jun 2024 06:03:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhv6hS4JyNuePMtR5yTE+SnK7i8YyUretc3E0b4KyrxqA7rxfJPgVzSU6GzYbMyUwE5+zVCg== X-Received: by 2002:a05:6512:3d04:b0:52b:c262:99b3 with SMTP id 2adb3069b0e04-52ccaa5693emr3925070e87.11.1718888592095; Thu, 20 Jun 2024 06:03:12 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56da3f50sm777493166b.14.2024.06.20.06.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 06:03:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , amonakov@ispras.ru Subject: [PATCH 5/6] meson: remove dead optimization option Date: Thu, 20 Jun 2024 15:02:53 +0200 Message-ID: <20240620130254.415699-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620130254.415699-1-pbonzini@redhat.com> References: <20240620130254.415699-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- meson.build | 13 ------------- meson_options.txt | 2 -- 2 files changed, 15 deletions(-) diff --git a/meson.build b/meson.build index 6e694ecd9fe..54e6b09f4fb 100644 --- a/meson.build +++ b/meson.build @@ -2874,18 +2874,6 @@ config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \ int main(int argc, char *argv[]) { return bar(argv[argc - 1]); } '''), error_message: 'AVX2 not available').allowed()) -config_host_data.set('CONFIG_AVX512F_OPT', get_option('avx512f') \ - .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX512F') \ - .require(cc.links(''' - #include - #include - static int __attribute__((target("avx512f"))) bar(void *a) { - __m512i x = *(__m512i *)a; - return _mm512_test_epi64_mask(x, x); - } - int main(int argc, char *argv[]) { return bar(argv[argc - 1]); } - '''), error_message: 'AVX512F not available').allowed()) - config_host_data.set('CONFIG_AVX512BW_OPT', get_option('avx512bw') \ .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX512BW') \ .require(cc.links(''' @@ -4283,7 +4271,6 @@ summary_info += {'mutex debugging': get_option('debug_mutex')} summary_info += {'memory allocator': get_option('malloc')} summary_info += {'avx2 optimization': config_host_data.get('CONFIG_AVX2_OPT')} summary_info += {'avx512bw optimization': config_host_data.get('CONFIG_AVX512BW_OPT')} -summary_info += {'avx512f optimization': config_host_data.get('CONFIG_AVX512F_OPT')} summary_info += {'gcov': get_option('b_coverage')} summary_info += {'thread sanitizer': get_option('tsan')} summary_info += {'CFI support': get_option('cfi')} diff --git a/meson_options.txt b/meson_options.txt index 6065ed2d352..0269fa0f16e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -119,8 +119,6 @@ option('membarrier', type: 'feature', value: 'disabled', option('avx2', type: 'feature', value: 'auto', description: 'AVX2 optimizations') -option('avx512f', type: 'feature', value: 'disabled', - description: 'AVX512F optimizations') option('avx512bw', type: 'feature', value: 'auto', description: 'AVX512BW optimizations') option('keyring', type: 'feature', value: 'auto', From patchwork Thu Jun 20 13:02:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 13705452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 609E4C2BA18 for ; Thu, 20 Jun 2024 13:04:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKHRj-0001jD-GG; Thu, 20 Jun 2024 09:03:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRi-0001fc-3D for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHRg-0006Xt-Lq for qemu-devel@nongnu.org; Thu, 20 Jun 2024 09:03:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718888599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W6tnGmP8UAqa4G+onMQE8JTTdn8pIGx/VV2/Iv84CZc=; b=LYW7HDCMEwWVEVxADfBbITx5yvthyZK1ucg2ndKM9ZwWZhbywQ4sChHFG5g0upw9ExEX+n cIl88fasVtQHb6UHV9Asqzw9IUaRHg7GGo9ZK4otlBTcuR+/mGJdMXyG3ft/dCtws6Nxb9 cbGBELKtctIUdOpkVK0Q4RJJ7Imxadc= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-afH1yldQO9WsZEOkO10R0Q-1; Thu, 20 Jun 2024 09:03:17 -0400 X-MC-Unique: afH1yldQO9WsZEOkO10R0Q-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-52ca8a3448eso649078e87.0 for ; Thu, 20 Jun 2024 06:03:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718888595; x=1719493395; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W6tnGmP8UAqa4G+onMQE8JTTdn8pIGx/VV2/Iv84CZc=; b=BE4JyUpRwvOLCZTs23vqFJe6RT7g1s0Q1Vw25yJOCTL39jOFNG/9u47S1wAVFeET8f tELBphppr1qCTiRxUcEZxRXjVCTk9PjEa0GXx+BIiYIdQf+fJaYf5e8XnlDOk3aKEiHn tcuHQOB098jNwJWi+VTHvGByTXY4L4SjStaJblSrN51+I5hSaEjlT0qmQGU2xFVacea1 w9rIm35El7WcfajRjWKgkUhaePuo1exna/aryxigVD+Me8b91YUxiiV7CoWPNof0vs+B 3gIu3hJIrPPUTCGT2fBxDQGfdcnvVkymkLfJMNPASljO5LkR4OJtviOz1XFnOF3diHzS T7wA== X-Gm-Message-State: AOJu0Yya8WrxgSDq6zl+6heq8Nzl7t0Ee52/mNKxXb4dHtHdYjTTG7VJ KYHziWGOi4gFB1yLIqH2dNiz+UT71yIZSCEeVsmARYcvMQ3Mmk5LomBYXsJKUq+hxDFoSe31Vuv U9GRt4ar/84riFJ2+rzVO2bPVePecs1vp5s9FT+xpsjPXYQ9NHMJfh7cCM7eghZZLhbomREofg5 pB4ACuLIK1LyLH02iDplmcIcaTnFJh6il37g4W X-Received: by 2002:a05:6512:2252:b0:52c:8289:e891 with SMTP id 2adb3069b0e04-52ccaa2a86emr4908286e87.6.1718888595035; Thu, 20 Jun 2024 06:03:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6w9f30q/hsffICkeJ4Q2+BFb7ayRlH0zqxsnrJL2YMk9kd59EDpZqD/RJXcC8nzuwt9gEtg== X-Received: by 2002:a05:6512:2252:b0:52c:8289:e891 with SMTP id 2adb3069b0e04-52ccaa2a86emr4908271e87.6.1718888594749; Thu, 20 Jun 2024 06:03:14 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f939296d8sm248435866b.35.2024.06.20.06.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 06:03:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , amonakov@ispras.ru Subject: [PATCH 6/6] meson: require compiler support for chosen x86-64 instructions Date: Thu, 20 Jun 2024 15:02:54 +0200 Message-ID: <20240620130254.415699-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240620130254.415699-1-pbonzini@redhat.com> References: <20240620130254.415699-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Paolo Bonzini --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 54e6b09f4fb..c5360fbd299 100644 --- a/meson.build +++ b/meson.build @@ -2863,6 +2863,7 @@ have_cpuid_h = cc.links(''' config_host_data.set('CONFIG_CPUID_H', have_cpuid_h) config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \ + .enable_auto_if(get_option('x86_version') >= '3') \ .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX2') \ .require(cc.links(''' #include @@ -2875,6 +2876,7 @@ config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \ '''), error_message: 'AVX2 not available').allowed()) config_host_data.set('CONFIG_AVX512BW_OPT', get_option('avx512bw') \ + .enable_auto_if(get_option('x86_version') >= '4') \ .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX512BW') \ .require(cc.links(''' #include