From patchwork Tue May 23 13:47:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 684943 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1730900wrt; Tue, 23 May 2023 06:53:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6eyoceY5i6AIETLFoey4ccui4zlGtfImHFQ9aQHEn+vIZX9/IILnj79XvgLR2ulx1QLdRZ X-Received: by 2002:a05:620a:2ac5:b0:75b:23a1:451 with SMTP id bn5-20020a05620a2ac500b0075b23a10451mr4290547qkb.23.1684849999010; Tue, 23 May 2023 06:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684849998; cv=none; d=google.com; s=arc-20160816; b=bxYSGsVG109PunTRxuSnkZ60KsCeaad6oChtVheKGpz5hM9MKvEjAkQP2ZOmfM5cbm vizeFEa78hk1OTJGBhAAY/D/M++ZqNH97ttOvnz7p6ELBz0IuHyjmMPJltokhN+aTiXC k4+EV+P5LTozJ/3ai2F72CZmp5DY5S64+3bRcVl7aXP640ZVTLMyKNfqArjhOYG0redE 9KwOF4Sx5yeUx6Rk2UA9xM8irKwzfDTXDG8wODD8CZFwoKxPV+OkKRlWyeIQ5/QcbdLA 7QYRAI/uSgr8m1/wj500LE05WtwbZby0cjfi6TYGhsavIpkFNNgV2ePt8xXJG6qn/2wQ ZcmQ== 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=WJ5nmWQwQthdi0ng7jY3HuhEKVgs1K09sZ5SOaSNt5uY3tQ1t5NWGhMw64RrWecBzO U+eoXv+2tR0zSq4kQISM5tOvR0VzP9Nv6rcv9zBHrFiKsFR2QeU3jaQhG5JV4WyUi+oE t1NCa++AmTMS/WyoB17vkMSTG7OZfB4GWuqnR0QHmw4+E44oYbnvdqLCf0Rt8k2gnbcc ZV04+bEjxosI/G0TpEA9CAAWWWaWDS2G8iBIu8KqVIe5/ApIMBIpM7fNUNY5ygFU8DTh kIEBYyOWv5G5MDmRd+xSgfyXT8C7B+ttpbe+uqfHQc8fzkD7zTfjIr+Beas0YC+vJaAL DeeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fwopV+t7; 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 ow21-20020a05620a821500b007596780d546si4844137qkn.372.2023.05.23.06.53.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 06:53:18 -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=fwopV+t7; 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 1q1SMX-0008BT-Sm; Tue, 23 May 2023 09:47:41 -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 1q1SMW-0008AZ-Mu for qemu-devel@nongnu.org; Tue, 23 May 2023 09:47:40 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1SMV-00013T-1T for qemu-devel@nongnu.org; Tue, 23 May 2023 09:47:40 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-64d18d772bdso6812695b3a.3 for ; Tue, 23 May 2023 06:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684849658; x=1687441658; 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=fwopV+t7jzi1rJqEKM6EzBIXGv9k5IpD8MV5oyf1Ixq0li1aclNEO+UoO0+HeiQrgb jsMJubu2GePR4SoS1u4XLMMFeWMWlBNgAfBaXirNukL5QszQH86F6npKtQdwsyzKYjRH ZMDOcAMf5B52ZNgv6eeB9J4xqAegNgbbTJopeqWNjKwfsiHV8dxKIHand6NVt1RgOQn0 k1dBSVdr5WC+L++dn19HPgobZCfbfSNBCnVArpyya3d2zcNp8gYcU+Y12vmcarSIrBI0 0B/lB+388HZe0y/Gwk4QQ8SOOdTsOjDzizOsLugW53ewt1OoUar0L9NxNRnqP0EfwrOl YLxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684849658; x=1687441658; 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=IZ3jYOmSLpRJZtTQXkzW6nAl3xmxsr7zfaOGIS07brCfB5Ybd65oTpEwrLR2rGkt2r U7Kp9KsCxBm0QtxnLveJ+35YwXMBDy9dqWvB4bVcOzyq29+4U+0I/O7QBRNeT6RBy6uA jcjKJb2QzhuD9memN5JMfuhV1uibJO7+A/cRb5+wBhQdJnjAwiBNvYE66PuJB0tCWiXu 23dzDt+WYVEn1Ru9BYVAg23pBEHV0pfELLJaIJhb4g5HEDnI9VFl2U999Myl5GjkUow0 w9a31evK//fofyXzVCzlNEMFjej/sH7CmS7XAjHAQh7h/6q69A7xU16PKl1N9Zr0W5Vk /FPw== X-Gm-Message-State: AC+VfDzAfv3VdM08kDMbTTot3+fbAIII8MRuby1QbkzETtYjkh/Dpdmx 7LU12+papzAqvuO22lbfDq/T9rlATrOBkb1xrno= X-Received: by 2002:a05:6a21:33aa:b0:10a:ba3a:42dd with SMTP id yy42-20020a056a2133aa00b0010aba3a42ddmr12107134pzb.44.1684849657771; Tue, 23 May 2023 06:47:37 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:c13a:d73:4f88:3654]) by smtp.gmail.com with ESMTPSA id j4-20020aa79284000000b0064d1349dc31sm5737122pfa.199.2023.05.23.06.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 06:47:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH v2 03/27] util: Add i386 CPUINFO_ATOMIC_VMOVDQU Date: Tue, 23 May 2023 06:47:09 -0700 Message-Id: <20230523134733.678646-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230523134733.678646-1-richard.henderson@linaro.org> References: <20230523134733.678646-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 Reviewed-by: Alex Bennée --- 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; } } }