From patchwork Sat May 20 16:26:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 684296 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp447639wrt; Sat, 20 May 2023 09:27:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xHuQYLBFP4Hxg355X7uXJ2puib5D966jc9S61TS3g6FBYNin+1DjJOL1Da1l+F02kf/iq X-Received: by 2002:ac8:59cd:0:b0:3f5:29b8:7846 with SMTP id f13-20020ac859cd000000b003f529b87846mr9211252qtf.65.1684600077186; Sat, 20 May 2023 09:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684600077; cv=none; d=google.com; s=arc-20160816; b=xjF7jtMYUBzgRDZN0vPXghclvRODjcIRD5GmAv/6nlLyglvvL8yybQaDgz+TUMcpDa /uHYG4pIg1TKF9yMkuhrbyzgVHKVZ+ba6XLI3RBV70IZ5LKDtdnst9FQKyAN9HukkGU8 ERExYHb8OjqWu1EBL4TuoJgfoJ6K8HOP+kCrBI0tXOkIoHy4+3UVL3Sf8haHX7ybsTop KISrI2MQDe0etUWdcJTtPE769Px+/Lrodb2kGN/WPGZsWiIaVsj1rBVYjrsi04n42aXN b3viN1h1lyuuy6FBjVQAUSVkoeMdJylqfjMr0a94Fu7KGOzUf+0D87GU5YiQNccIS8in pZZA== 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=8wi2bOWjMyVLEFUf4QBGubplY21YXqeLF4j5hewlIPc=; b=mk0dDz5gmRRTSAPj0jzWEkv1hQDxm/1QwYfm3/sQAKxoy1cRgmvGqEwQAdPbax0oj8 8/zThtTqbZ33PHBr/o1qQbL9xhxtDVAgSyqZqJhkWDGh1h5LRKCPIVHe4Mz4K38mXctR yxH8w8E0IwS+ZkT+RDJNLw7w3nlgRb/Nf8lav/QWcdvUdxIDiFuiu/ZMOYQYRjrNxkbj SUFRwA1u/Lh1NLi+LzWPJdzIIonn93ayyENs44sy3Do3QnaDiNTxuq9aaD5UmMd8klNu /PEMHAEpKIccAf1ovv1urCizmcAwM904ub/aHpILvK9Bpa3Q8QtPHQVkETt9//SgnjVR 1Qxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NlifBBE1; 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 j16-20020a05622a039000b003f391e7d585si1322231qtx.543.2023.05.20.09.27.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 May 2023 09:27:57 -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=NlifBBE1; 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 1q0PPo-0003Yp-LQ; Sat, 20 May 2023 12:26:44 -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 1q0PPn-0003Wr-8G for qemu-devel@nongnu.org; Sat, 20 May 2023 12:26:43 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q0PPk-00034U-77 for qemu-devel@nongnu.org; Sat, 20 May 2023 12:26:42 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1ae4c5e1388so43575155ad.1 for ; Sat, 20 May 2023 09:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684599999; x=1687191999; 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=8wi2bOWjMyVLEFUf4QBGubplY21YXqeLF4j5hewlIPc=; b=NlifBBE1Sa6pTUAOl4gfdmRW6vLX2I8IGs1+HiFEjYALEjk2ZZ+t2KUXd6lGZ7hQDZ EBknP+1txz5J7xK7VkWQ584fETgPX0yzmEz2hZFq7GDBepVh+tITghv81Bei7o3PhA9W O+C4DJCrcWg+KDdXZn1FUuS1SPiqo/gykqI4P7/UV+s0ud09xP37yPQggAqAb9jm+lH0 KVMUKydJc05VUgNfN2ieVYHbOVoLAZNx8T7t9Z3w0GzthFLLgoweuRflwUI0fK4BbcvD yGy+TU3SusHeH9DiY+fMz3tX4qTsnknrsxj/JcKIkK2sbSAeHg3LVlHiLvzG1LDsqMfR 3ZIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684599999; x=1687191999; 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=8wi2bOWjMyVLEFUf4QBGubplY21YXqeLF4j5hewlIPc=; b=fLHQBXyQ+/thsqQSvT+G2Klai/dOKiHOguJnA5wuO7OL533kdpwGI6t66W9X/0yWBF n/Znv0WCsQh7GahmwgOlD9BenSVaHGA6aSuLl58RkhZieNcXBubVzsSBJXBu42dHSu2D OeZjzWsrI0VqpBNQLZJ8iPdo7OHWjvd+AdfIDZ6Nt3EbJg8g9xJBVLllOt9jVM2PfhLx fAZ4yvZOcBymPsiQ6C204X+NR398Y1xI57AjyE7qSql8Si+nS7RI0KUn48kSZblMr0QT 7gpCyOXTmZ4R67A04ITx9AJ8bNHAvdd2zYyqn0OxwdVAAc7/9H2iQcL6MAuN9O5aATIh Og1Q== X-Gm-Message-State: AC+VfDwrIXfWqeniCJRC1iSu8YiKQPivar5T2mM4E8myX/Hf1NWZcj7E o7OcVBo+CaL1xSq4LNFHXhuYlwNldQ7LzWcVehM= X-Received: by 2002:a17:902:ec90:b0:1ad:e633:ee8f with SMTP id x16-20020a170902ec9000b001ade633ee8fmr7592178plg.32.1684599998981; Sat, 20 May 2023 09:26:38 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:d078:d94e:cb2b:a055]) by smtp.gmail.com with ESMTPSA id d12-20020a170903230c00b001a5260a6e6csm1697104plh.206.2023.05.20.09.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 09:26:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH 03/27] util: Add i386 CPUINFO_ATOMIC_VMOVDQU Date: Sat, 20 May 2023 09:26:10 -0700 Message-Id: <20230520162634.3991009-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230520162634.3991009-1-richard.henderson@linaro.org> References: <20230520162634.3991009-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- host/include/i386/host/cpuinfo.h | 1 + util/cpuinfo-i386.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/host/include/i386/host/cpuinfo.h b/host/include/i386/host/cpuinfo.h index e6f7461378..a6537123cf 100644 --- a/host/include/i386/host/cpuinfo.h +++ b/host/include/i386/host/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 434319aa71..ab6143d9e7 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; } } }