From patchwork Thu May 18 04:40:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 683345 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp181729wrt; Wed, 17 May 2023 21:42:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fZlRbx7LJNZ/BmqcRyngyTLkmWRvxCd2tdophAAuvfZe1RDQq+nOIZWmJ0CJt+jPgWhMZ X-Received: by 2002:a05:622a:1a95:b0:3f5:17dc:ba58 with SMTP id s21-20020a05622a1a9500b003f517dcba58mr3965256qtc.54.1684384949057; Wed, 17 May 2023 21:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684384949; cv=none; d=google.com; s=arc-20160816; b=IotnbmPOKA03UwkHXqxX4L/k8U6BY62r9ThLFXC8YdvrCzsFCgz7xcIEA46xa+Lrh7 CnP0htx4AdG4qIGh2IBpQW/ZKCs+PGxUsOw35mJYZl+vZdtXW5/kbIZ1x4aTrYfzFH8z s2EHmqmXtTu65Wwud8Nm5BhsQvrhi7aYCVDylg10BCv3a9xDR3yGMVqKlpm/HbgQ14X7 kNarZIMbGPnwAMa/7j2TuAVbSnpoeGkKorFzshY7gpsB2gslrumha31s2tK4Qb176Cfk 78kKJcmrrcWGtH6fYniFh4aFtzMtJF3xySjAFgnCkPIlKENEVKM2VW0Ca9A2Ibw1u6O9 PdpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GeLfr1x/hpOvqEFLAFvBSjcAQ68yDAXj5gO5I/OdT1g=; b=y8jf+NITtGtu4Iwli0wZQi6sboYcAa3X2V/k4ZXwTgw9JjnM0pqbEAcUvzI/DKX9G1 7JJ902PWAUlTCFgzdEFYbL/QqQXfTbvVyXKQfRPc62CAmIbZB737D9yKweaolOQ7c56g xgrBnt1H45lksvG+ZwY4S8a+euxEbsyVDDWXbQXporVmPTdF7pMRHmmhKHpjZ5+V1wat 8ufzsmu0Hf8a7CI09M7TNcSfJvhv5HDziTam1lAQp+4gUdU9e6DIO5W8tpfZLfHoW7O5 AiOF/UAn54kS5rZ+i1K5dFeuShXGiqO/ami4doQpwwVgKBOWK0gqdxOrvaZSvePXVt54 C7pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oe547tRI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z15-20020ac87f8f000000b003ef3c9d5aa1si438665qtj.66.2023.05.17.21.42.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 May 2023 21:42:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oe547tRI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzVRu-00067T-TL; Thu, 18 May 2023 00:41:10 -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 1pzVRt-00066l-4M for qemu-devel@nongnu.org; Thu, 18 May 2023 00:41:09 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pzVRr-00077T-CU for qemu-devel@nongnu.org; Thu, 18 May 2023 00:41:08 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1ae4c5e12edso12879145ad.3 for ; Wed, 17 May 2023 21:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684384863; x=1686976863; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GeLfr1x/hpOvqEFLAFvBSjcAQ68yDAXj5gO5I/OdT1g=; b=oe547tRIKHQD0ZJghgulV9NAl+VuChR174VYYFbqAPAMilpJRQYIHtUyR6CDWE/E76 LxkXBBXn971der8EKRX59Mp+IPPmkXb6mvd/OUaHw8u5GVQL68HjSPb1xG1XKZmszjhv 1/dBAOc569mpMSH/dgqMI5UWvU713dafd++p9y7HffAp7Q8d7wRwCd6wmWRQhvghSJAQ Du3Nkq2orVgAtEkHZrECMS3doLg+oL8nWYqUZT7mE5EBju1yYrYR2ims3JdjUk9aQRA3 20neayq+7dKMExBJpMygx+uK6Py9s2ou8QBSH0onjqwfoeS9dK0QM2m0jg/rcBQckPjl DIzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684384863; x=1686976863; 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=GeLfr1x/hpOvqEFLAFvBSjcAQ68yDAXj5gO5I/OdT1g=; b=c8JKSwDRoe7TWjiFvGSTgmIG2/2qxcrufvVYKs8O6ywcBU3sACXwMXFNFtWZCSgS6Q dg2JXNgMA485jETNQGf67NhcG7B51LqNWCPUb6fk6yDOywag0ZfiLlkJHE73lD9rbpLe qlab+Wp34pa1kVXRcQQC4nhEOk3yymM5zWOKBGQHjXJ93TFyBChuc9O22hsVSmI6EefR ebk1RO8rZbOynEoY6K9Y8+/ZX9XEVYil/H22xl+b7yDflei0fb8CUpJgWMD0n7Y/Jttx aUp2XCMUgFJnMJkCzaR4LmzhzKoWOuqoe2ORe4mJh3xYmxYSkCCwIgmeYceC0pciACsB kq8Q== X-Gm-Message-State: AC+VfDyi1hApK7yt+/n/dRhYNIe+l6M1WBEb5unsGDAcglSj5TumREyd uM7/r/ksEh3vshTUmUlivXLgsHIXMlCGEcGTrOM= X-Received: by 2002:a17:902:ead4:b0:1ac:b52e:f3e5 with SMTP id p20-20020a170902ead400b001acb52ef3e5mr1338000pld.43.1684384863345; Wed, 17 May 2023 21:41:03 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:17a4:1aa0:c49d:e8f7]) by smtp.gmail.com with ESMTPSA id t9-20020a170902e84900b001ab1d23bf5dsm225592plg.258.2023.05.17.21.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 21:41:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH 3/9] util: Add i386 CPUINFO_ATOMIC_VMOVDQU Date: Wed, 17 May 2023 21:40:52 -0700 Message-Id: <20230518044058.2777467-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230518044058.2777467-1-richard.henderson@linaro.org> References: <20230518044058.2777467-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Add a bit to indicate when VMOVDQU is also atomic if aligned. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- include/host/i386/cpuinfo.h | 1 + util/cpuinfo-i386.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/host/i386/cpuinfo.h b/include/host/i386/cpuinfo.h index e6f7461378..a6537123cf 100644 --- a/include/host/i386/cpuinfo.h +++ b/include/host/i386/cpuinfo.h @@ -25,6 +25,7 @@ #define CPUINFO_AVX512DQ (1u << 14) #define CPUINFO_AVX512VBMI2 (1u << 15) #define CPUINFO_ATOMIC_VMOVDQA (1u << 16) +#define CPUINFO_ATOMIC_VMOVDQU (1u << 17) /* Initialized with a constructor. */ extern unsigned cpuinfo; diff --git a/util/cpuinfo-i386.c b/util/cpuinfo-i386.c index cb9475c688..b72374362f 100644 --- a/util/cpuinfo-i386.c +++ b/util/cpuinfo-i386.c @@ -77,8 +77,10 @@ unsigned __attribute__((constructor)) cpuinfo_init(void) * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688 */ __cpuid(0, a, b, c, d); - if (c == signature_INTEL_ecx || c == signature_AMD_ecx) { + if (c == signature_INTEL_ecx) { info |= CPUINFO_ATOMIC_VMOVDQA; + } else if (c == signature_AMD_ecx) { + info |= CPUINFO_ATOMIC_VMOVDQA | CPUINFO_ATOMIC_VMOVDQU; } } }