From nobody Fri May 10 10:37:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694440526; cv=none; d=zohomail.com; s=zohoarc; b=LKnxT+6v4aYx7dHRxKWR2GORPfS4hLecydAGAEqE1SjdjmgH+7YG7hMdcjq7Ieq6WXJ859rSqwHsS6KuwMlhLGYFMWiNQ/1QwYOStKZOVy+qtVFzuaIbPEkWxa5fRxteRpKfpzf3pVbLMeXlqU6+AWUrd2Y2trDPxJeCQqupESw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440526; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EhsANPr+s+DzOUAyiokLp6LNqlQRXOf6IY9mVxsXL14=; b=SPryJDyIxn3Hgf6O989MvhoPGti64ck7BPLGMqd77xAfb0F6O52Vlqch00tRh/cy1tMDMFheLtSBDSaOrg+mw401AwMQxPj9+2gYlHJho1Pxe84WWvgBdpk5y4berhxeQ8Ku3t6kb/MCngSzEV0CYy1II7C0RHHLW1onxQeidR8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694440526403227.34533318630008; Mon, 11 Sep 2023 06:55:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMR-0005iF-5w; Mon, 11 Sep 2023 09:53:55 -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 1qfhMP-0005gm-KL for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:53 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMI-00039s-ER for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:53 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31c4d5bd69cso4615220f8f.3 for ; Mon, 11 Sep 2023 06:53:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440423; x=1695045223; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=EhsANPr+s+DzOUAyiokLp6LNqlQRXOf6IY9mVxsXL14=; b=zi40qD8bBOdUYEg2SB2DsPlzO9HoWgOlDL9Z/qr6/8SBNPZ7aY10qa3r5iEyKA4cOk bSBMXbselHh7mxeVZrcg0A/62W3NIrKWHB7qS5rfB1L2YDR8eWPyhfQj+YEaiU2wcQX0 axuwLlIDHOqZ7mBVDIfZwi0n1jes3C1BKpEqNJfjnidzav216Lea96Ghq3eAhgHBI7zo PYOZztYDpdEl8XiMdBTbsxNP2GhsOItW0DEvkXB3600eAYkAoqZ2JORo16VfxNqSlDyj 7AVLJNeN2U/z+KwVwNWzJ1j5a9/3g7RXhZVslfFTUitG0LeurBKrp1J+NXiS/ueANP1z LSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440423; x=1695045223; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EhsANPr+s+DzOUAyiokLp6LNqlQRXOf6IY9mVxsXL14=; b=VOwVLfmA+2funkeNDfIHYTy4OAQ5NnCL7LJnYicBEgHeRrCxpF000yvUyQmnTZK/Me ad5gevCEukx872qzyXo/kU01PqorwhP1/YyYjNVVkk8vjcFdsMd+o2w4sbYT0wXmuj8U RjCdJjPSQngExFwB8JQ5fwz66T7lPNXg2JkdsoQ71gp4o/wsb9EreyzaZyg0MTfseoUj 1piwuVuA7cXt0L/tN4yFyQisbUfXCbY8oF/P13dcop9OgkZQ6rtVtb3NOOu0lTZl0d52 yHz11IMbqegFT/Zx7YoAqK/nyNDqzYuRSjV+ZizZZeX01brvUxy/Q04JPafJI9N91G29 2lGA== X-Gm-Message-State: AOJu0Yw2FnMGYec5wo3Hhrwn/u0CiW9KOVkLb1nVnKA1w1lXkN9foRIe 4ObIyY67w7Ze6tvaym1kASoitA== X-Google-Smtp-Source: AGHT+IHJEwMhrnYlg4W1pshZriYM/JlFh0UfR/DR0I2BZClStH0PUWfzFPhc4P9iea5/HdDYsqzghA== X-Received: by 2002:adf:d082:0:b0:31d:c3d2:4300 with SMTP id y2-20020adfd082000000b0031dc3d24300mr6535375wrh.71.1694440423429; Mon, 11 Sep 2023 06:53:43 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 1/7] target/arm: Add ID_AA64ISAR2_EL1 Date: Mon, 11 Sep 2023 14:53:34 +0100 Message-Id: <20230911135340.1139553-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694440527316100001 Content-Type: text/plain; charset="utf-8" From: Aaron Lindsay Signed-off-by: Aaron Lindsay [PMM: drop the HVF part of the patch and just comment that we need to do something when the register appears in that API] Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/cpu.h | 1 + target/arm/helper.c | 4 ++-- target/arm/hvf/hvf.c | 1 + target/arm/kvm64.c | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index d50cd918580..e637796fd83 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1033,6 +1033,7 @@ struct ArchCPU { uint32_t dbgdevid1; uint64_t id_aa64isar0; uint64_t id_aa64isar1; + uint64_t id_aa64isar2; uint64_t id_aa64pfr0; uint64_t id_aa64pfr1; uint64_t id_aa64mmfr0; diff --git a/target/arm/helper.c b/target/arm/helper.c index e3f5a7d2bdc..f9f7c3c39e9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -8435,11 +8435,11 @@ void register_cp_regs_for_features(ARMCPU *cpu) .access =3D PL1_R, .type =3D ARM_CP_CONST, .accessfn =3D access_aa64_tid3, .resetvalue =3D cpu->isar.id_aa64isar1 }, - { .name =3D "ID_AA64ISAR2_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, + { .name =3D "ID_AA64ISAR2_EL1", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, .accessfn =3D access_aa64_tid3, - .resetvalue =3D 0 }, + .resetvalue =3D cpu->isar.id_aa64isar2 }, { .name =3D "ID_AA64ISAR3_EL1_RESERVED", .state =3D ARM_CP_STA= TE_AA64, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 6, .opc2 =3D = 3, .access =3D PL1_R, .type =3D ARM_CP_CONST, diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 486f90be1d2..546c0e817f4 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -847,6 +847,7 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFea= tures *ahcf) { HV_SYS_REG_ID_AA64DFR1_EL1, &host_isar.id_aa64dfr1 }, { HV_SYS_REG_ID_AA64ISAR0_EL1, &host_isar.id_aa64isar0 }, { HV_SYS_REG_ID_AA64ISAR1_EL1, &host_isar.id_aa64isar1 }, + /* Add ID_AA64ISAR2_EL1 here when HVF supports it */ { HV_SYS_REG_ID_AA64MMFR0_EL1, &host_isar.id_aa64mmfr0 }, { HV_SYS_REG_ID_AA64MMFR1_EL1, &host_isar.id_aa64mmfr1 }, { HV_SYS_REG_ID_AA64MMFR2_EL1, &host_isar.id_aa64mmfr2 }, diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 4d904a1d11b..ac440c33f9a 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -304,6 +304,8 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *= ahcf) ARM64_SYS_REG(3, 0, 0, 6, 0)); err |=3D read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64isar1, ARM64_SYS_REG(3, 0, 0, 6, 1)); + err |=3D read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64isar2, + ARM64_SYS_REG(3, 0, 0, 6, 2)); err |=3D read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr0, ARM64_SYS_REG(3, 0, 0, 7, 0)); err |=3D read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64mmfr1, --=20 2.34.1 From nobody Fri May 10 10:37:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694440527; cv=none; d=zohomail.com; s=zohoarc; b=hSRe/fgbtWljGI1LoUuCltWOzjIGYhcVzF/iLuytT7SkKEOUnolr4CnRhXVzUu/SfwD4FEPbh5VYvVJx6eavPlRX5HBj6ZI64lU5iIAik+/nCxEbo9JBQpWcdlgLn4/FxTbkVAFQ+9XjHogZDp+TCL1EfFeEQM0XKPgLBV0ZtZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440527; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BQa+831csKF+bLc07F+cF6xTN80jpivchM4xDwQv7Wg=; b=ObzGtV/bhkw5a4FmKpApJMG3X45KIoP5/TVE9SYOywT9dvrAAEcLVPkL5wcFZxnbj6j6+Nd1RQTP4KjJfkAJHDRYNzplFdQvfXDFwWpUCqDXcKisKD+Y+CEmYwVqniFh+frMr5P6q40UaKB7jAipAfGwTU9x728HLxSqBhhjV3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694440527161308.8199334238964; Mon, 11 Sep 2023 06:55:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMS-0005kF-Eg; Mon, 11 Sep 2023 09:53:56 -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 1qfhMQ-0005hd-CB for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:54 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMH-00039v-Kj for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:54 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31768ce2e81so4479569f8f.1 for ; Mon, 11 Sep 2023 06:53:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440424; x=1695045224; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=BQa+831csKF+bLc07F+cF6xTN80jpivchM4xDwQv7Wg=; b=i7jN4E+xn3ChVmvTKzK7XyPrWahNIfoD4Wtu2UQCTtR4Oa4x2N6UfCYkoGAp5BArQD bVjcAfAeDxnSIGGUJ8jA6LPjdBaKdU5aLjs4r9QY24Ayxi7VRTKFtg5SP6AJs83aU8we 86pU5I0urg49xgijpiVl9firM3XZ4Hk35ySjuhH7HEfQdzn5By6zbTT93ai4+UKAWSgx J4BX/B71hU+tyyC36RBmCIS0veVl53ZQ/HiLUeC7DYykd5GAWAsfNHKo1PBVvkIpj9xQ TketVJnYfjo1HxWUOH8PrvhRK0nn+/d2DNDgb0iS8fDT46yAJwyaRjvt2ZABHjLwZNtk pq4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440424; x=1695045224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BQa+831csKF+bLc07F+cF6xTN80jpivchM4xDwQv7Wg=; b=cUAvYUdzEIP4Jxj5/eGkMCkhKMNyNATpUFNKZZb9IUmxMMxd0/xgFdiwb+12KDJ/Lz 2lUPc+3SpWizawNvXV5aJyaR4WNDbbe9IBdoLL0/nbgk+m1qii98ifCeQ0QtIcksKvOw kHAIUHRGHTBJ+7FrgLqhnKWBVvNbh7E1e0ZBxkA+87uMB3nck+1+7aGtav/gKx+ByuIG u5bcTKtXv/jlZJe5oAkgeCm29Hgln1m0eWE6koopKupSvYh7zu4SKkdYiwpgzIzGNQHu wAGow/KkKMv3/RARV6glUojKsOQxcFaz7GedmGwFYdBH8py9Hh8QDMCA6UiCBxclvfip yeMw== X-Gm-Message-State: AOJu0YwPi991b8L6++REKTAIvZq1RC9hf4ocJTe+2QODGUpGIMCEZzVe zeuh32zeJNwl4rPHY1MOHgYJEg== X-Google-Smtp-Source: AGHT+IF0vruuZObRlAc9HjoC+jabvKHcimNuOxSVhJZZEtLCMa8hxhzzQm90a/HuQA2ZXGRZ9JDOpg== X-Received: by 2002:adf:e10c:0:b0:319:85e2:6972 with SMTP id t12-20020adfe10c000000b0031985e26972mr7262992wrz.42.1694440423833; Mon, 11 Sep 2023 06:53:43 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/7] linux-user/elfload.c: Correct SME feature names reported in cpuinfo Date: Mon, 11 Sep 2023 14:53:35 +0100 Message-Id: <20230911135340.1139553-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694440529051100016 Content-Type: text/plain; charset="utf-8" Some of the names we use for CPU features in linux-user's dummy /proc/cpuinfo don't match the strings in the real kernel in arch/arm64/kernel/cpuinfo.c. Specifically, the SME related features have an underscore in the HWCAP_FOO define name, but (like the SVE ones) they do not have an underscore in the string in cpuinfo. Correct the errors. Fixes: a55b9e7226708 ("linux-user: Emulate /proc/cpuinfo on aarch64 and arm= ") Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- linux-user/elfload.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a5b28fa3e7a..5ce009d7137 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -844,13 +844,13 @@ const char *elf_hwcap2_str(uint32_t bit) [__builtin_ctz(ARM_HWCAP2_A64_RPRES )] =3D "rpres", [__builtin_ctz(ARM_HWCAP2_A64_MTE3 )] =3D "mte3", [__builtin_ctz(ARM_HWCAP2_A64_SME )] =3D "sme", - [__builtin_ctz(ARM_HWCAP2_A64_SME_I16I64 )] =3D "sme_i16i64", - [__builtin_ctz(ARM_HWCAP2_A64_SME_F64F64 )] =3D "sme_f64f64", - [__builtin_ctz(ARM_HWCAP2_A64_SME_I8I32 )] =3D "sme_i8i32", - [__builtin_ctz(ARM_HWCAP2_A64_SME_F16F32 )] =3D "sme_f16f32", - [__builtin_ctz(ARM_HWCAP2_A64_SME_B16F32 )] =3D "sme_b16f32", - [__builtin_ctz(ARM_HWCAP2_A64_SME_F32F32 )] =3D "sme_f32f32", - [__builtin_ctz(ARM_HWCAP2_A64_SME_FA64 )] =3D "sme_fa64", + [__builtin_ctz(ARM_HWCAP2_A64_SME_I16I64 )] =3D "smei16i64", + [__builtin_ctz(ARM_HWCAP2_A64_SME_F64F64 )] =3D "smef64f64", + [__builtin_ctz(ARM_HWCAP2_A64_SME_I8I32 )] =3D "smei8i32", + [__builtin_ctz(ARM_HWCAP2_A64_SME_F16F32 )] =3D "smef16f32", + [__builtin_ctz(ARM_HWCAP2_A64_SME_B16F32 )] =3D "smeb16f32", + [__builtin_ctz(ARM_HWCAP2_A64_SME_F32F32 )] =3D "smef32f32", + [__builtin_ctz(ARM_HWCAP2_A64_SME_FA64 )] =3D "smefa64", }; =20 return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL; --=20 2.34.1 From nobody Fri May 10 10:37:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694440527; cv=none; d=zohomail.com; s=zohoarc; b=MYIbpnpouUpEuSTIsZUnAjAwsTiS5tQRkX5UQbIl4cnLUmDfgLQ5VuZLJTQf40qmJ71D/Dw36KBPaMvCk+svyTxgGYdz1di4gXDC/bpSWKKtsisvcUbD6b6+i1TOWTSJKlmGUGT2nnSlUqCpTtFcQpyC4bu1/dhnr9+FFQsK4S4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440527; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7uJJG0JUNNn26kxyjZ7e+2zZH+twak0UtrO5PhAiUUE=; b=Hndx9zV5t92Umqg1259/KCn+dBDtwJYvnJBR0FiSoVLawfmIja1bi/y9tHX2gLeibYmnEyAusYohvQcYo8C0Xdnil4bTCgtyeXhsK+cZbD7X7Cw+UhG0upZOnrq0zz9P4GuZm2Calla5NbOJSs9Hbr0KAdwv819UKBlSiUrOSmg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694440527123474.53654704021415; Mon, 11 Sep 2023 06:55:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMT-0005n5-85; Mon, 11 Sep 2023 09:53:57 -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 1qfhMQ-0005i1-UP for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:54 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMI-0003A4-TA for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:54 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31aeef88a55so4127495f8f.2 for ; Mon, 11 Sep 2023 06:53:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440424; x=1695045224; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7uJJG0JUNNn26kxyjZ7e+2zZH+twak0UtrO5PhAiUUE=; b=qM/8VSGr0NSTo9A6n0Z+m0Eb/TecFPWPvVMPHeTDKPz3IR330wSBrUqiu6GHqJWiC5 9WPLYAz5+yTfbGByTFDkQPjB5cgY9qEIinvTijE6LLYhaOnZ/7UpdWRTf0hnf4eDbBcO rqD3HvhMjMjlXfv0I6KGtfSY165RnhWl5GWNcF5WHJyDIYFMx0Ny8XnCKWj79WlKqNQH r6LrBMZ0xfNKz7k+hQV0ku7wncvcJxanKheJ5Z9ag630tHptThX8bCPN6ahsFgLTzTc4 6zuJ6qN9sy80ZGxdLepICXMBg8zUxTbigCm6/MBz1AAb1gHwMOvclx3zWiR3U/rVDxw2 ayqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440424; x=1695045224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7uJJG0JUNNn26kxyjZ7e+2zZH+twak0UtrO5PhAiUUE=; b=wCxImc5r2S4DX4Q40coS3ENga6sywpnlk0zfzf20fR890v5AgAmThm7mmBc6bpx+FI HE71BZir4IUslC6lwJiExT07P8uoj2OUVv1wZnUna1y0AL86xX4OSLY5NShMN7fP9Sig UPPzglNcJikM/pOEPpKe26LSqdyfW6URfsegEx3QT8i7+pOO+/Mo+PXxMigmHepHgR3t NCVLNfQ3xRIjD1XZkhsVG1PX7ZL/V4wyfmpj6bS3LKhoSdm6SkqVRww4omqaYU9Hb95r ftWkb06QK6XqIyopjig6NsgujEjifv/5xs9W8UZR+ql9+r+J9HLW5ij7VHblCDlqCWw8 r/pw== X-Gm-Message-State: AOJu0YzKSDuTVllyEonKFvUsTyT8Z9xuJro0nBa4A1/hGnY2JxL9lLNN 16Lmf+/X/1Y3/ZZTMTcmhUcPAn9fvUGZWurzCYU= X-Google-Smtp-Source: AGHT+IE6M2/ocY/W0aWnaoCJqlzXgqLY3W0bmfZcaU3g3wY6KmUQYiiXYKM4Z0dVBenetrLHGfKm0g== X-Received: by 2002:a5d:684a:0:b0:314:124f:12be with SMTP id o10-20020a5d684a000000b00314124f12bemr7493994wrw.3.1694440424323; Mon, 11 Sep 2023 06:53:44 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/7] linux-user/elfload.c: Add missing arm and arm64 hwcap values Date: Mon, 11 Sep 2023 14:53:36 +0100 Message-Id: <20230911135340.1139553-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.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 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694440529081100017 Content-Type: text/plain; charset="utf-8" Our lists of Arm 32 and 64 bit hwcap values have lagged behind the Linux kernel. Update them to include all the bits defined as of upstream Linux git commit a48fa7efaf1161c1 (in the middle of the kernel 6.6 dev cycle). For 64-bit, we don't yet implement any of the features reported via these hwcap bits. For 32-bit we do in fact already implement them all; we'll add the code to set them in a subsequent commit. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- linux-user/elfload.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5ce009d7137..d51d077998a 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -402,6 +402,12 @@ enum ARM_HWCAP_ARM_VFPD32 =3D 1 << 19, ARM_HWCAP_ARM_LPAE =3D 1 << 20, ARM_HWCAP_ARM_EVTSTRM =3D 1 << 21, + ARM_HWCAP_ARM_FPHP =3D 1 << 22, + ARM_HWCAP_ARM_ASIMDHP =3D 1 << 23, + ARM_HWCAP_ARM_ASIMDDP =3D 1 << 24, + ARM_HWCAP_ARM_ASIMDFHM =3D 1 << 25, + ARM_HWCAP_ARM_ASIMDBF16 =3D 1 << 26, + ARM_HWCAP_ARM_I8MM =3D 1 << 27, }; =20 enum { @@ -410,6 +416,8 @@ enum { ARM_HWCAP2_ARM_SHA1 =3D 1 << 2, ARM_HWCAP2_ARM_SHA2 =3D 1 << 3, ARM_HWCAP2_ARM_CRC32 =3D 1 << 4, + ARM_HWCAP2_ARM_SB =3D 1 << 5, + ARM_HWCAP2_ARM_SSBS =3D 1 << 6, }; =20 /* The commpage only exists for 32 bit kernels */ @@ -540,6 +548,12 @@ const char *elf_hwcap_str(uint32_t bit) [__builtin_ctz(ARM_HWCAP_ARM_VFPD32 )] =3D "vfpd32", [__builtin_ctz(ARM_HWCAP_ARM_LPAE )] =3D "lpae", [__builtin_ctz(ARM_HWCAP_ARM_EVTSTRM )] =3D "evtstrm", + [__builtin_ctz(ARM_HWCAP_ARM_FPHP )] =3D "fphp", + [__builtin_ctz(ARM_HWCAP_ARM_ASIMDHP )] =3D "asimdhp", + [__builtin_ctz(ARM_HWCAP_ARM_ASIMDDP )] =3D "asimddp", + [__builtin_ctz(ARM_HWCAP_ARM_ASIMDFHM )] =3D "asimdfhm", + [__builtin_ctz(ARM_HWCAP_ARM_ASIMDBF16)] =3D "asimdbf16", + [__builtin_ctz(ARM_HWCAP_ARM_I8MM )] =3D "i8mm", }; =20 return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL; @@ -553,6 +567,8 @@ const char *elf_hwcap2_str(uint32_t bit) [__builtin_ctz(ARM_HWCAP2_ARM_SHA1 )] =3D "sha1", [__builtin_ctz(ARM_HWCAP2_ARM_SHA2 )] =3D "sha2", [__builtin_ctz(ARM_HWCAP2_ARM_CRC32)] =3D "crc32", + [__builtin_ctz(ARM_HWCAP2_ARM_SB )] =3D "sb", + [__builtin_ctz(ARM_HWCAP2_ARM_SSBS )] =3D "ssbs", }; =20 return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL; @@ -696,6 +712,20 @@ enum { ARM_HWCAP2_A64_SME_B16F32 =3D 1 << 28, ARM_HWCAP2_A64_SME_F32F32 =3D 1 << 29, ARM_HWCAP2_A64_SME_FA64 =3D 1 << 30, + ARM_HWCAP2_A64_WFXT =3D 1ULL << 31, + ARM_HWCAP2_A64_EBF16 =3D 1ULL << 32, + ARM_HWCAP2_A64_SVE_EBF16 =3D 1ULL << 33, + ARM_HWCAP2_A64_CSSC =3D 1ULL << 34, + ARM_HWCAP2_A64_RPRFM =3D 1ULL << 35, + ARM_HWCAP2_A64_SVE2P1 =3D 1ULL << 36, + ARM_HWCAP2_A64_SME2 =3D 1ULL << 37, + ARM_HWCAP2_A64_SME2P1 =3D 1ULL << 38, + ARM_HWCAP2_A64_SME_I16I32 =3D 1ULL << 39, + ARM_HWCAP2_A64_SME_BI32I32 =3D 1ULL << 40, + ARM_HWCAP2_A64_SME_B16B16 =3D 1ULL << 41, + ARM_HWCAP2_A64_SME_F16F16 =3D 1ULL << 42, + ARM_HWCAP2_A64_MOPS =3D 1ULL << 43, + ARM_HWCAP2_A64_HBC =3D 1ULL << 44, }; =20 #define ELF_HWCAP get_elf_hwcap() @@ -851,6 +881,20 @@ const char *elf_hwcap2_str(uint32_t bit) [__builtin_ctz(ARM_HWCAP2_A64_SME_B16F32 )] =3D "smeb16f32", [__builtin_ctz(ARM_HWCAP2_A64_SME_F32F32 )] =3D "smef32f32", [__builtin_ctz(ARM_HWCAP2_A64_SME_FA64 )] =3D "smefa64", + [__builtin_ctz(ARM_HWCAP2_A64_WFXT )] =3D "wfxt", + [__builtin_ctzll(ARM_HWCAP2_A64_EBF16 )] =3D "ebf16", + [__builtin_ctzll(ARM_HWCAP2_A64_SVE_EBF16 )] =3D "sveebf16", + [__builtin_ctzll(ARM_HWCAP2_A64_CSSC )] =3D "cssc", + [__builtin_ctzll(ARM_HWCAP2_A64_RPRFM )] =3D "rprfm", + [__builtin_ctzll(ARM_HWCAP2_A64_SVE2P1 )] =3D "sve2p1", + [__builtin_ctzll(ARM_HWCAP2_A64_SME2 )] =3D "sme2", + [__builtin_ctzll(ARM_HWCAP2_A64_SME2P1 )] =3D "sme2p1", + [__builtin_ctzll(ARM_HWCAP2_A64_SME_I16I32 )] =3D "smei16i32", + [__builtin_ctzll(ARM_HWCAP2_A64_SME_BI32I32)] =3D "smebi32i32", + [__builtin_ctzll(ARM_HWCAP2_A64_SME_B16B16 )] =3D "smeb16b16", + [__builtin_ctzll(ARM_HWCAP2_A64_SME_F16F16 )] =3D "smef16f16", + [__builtin_ctzll(ARM_HWCAP2_A64_MOPS )] =3D "mops", + [__builtin_ctzll(ARM_HWCAP2_A64_HBC )] =3D "hbc", }; =20 return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL; --=20 2.34.1 From nobody Fri May 10 10:37:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694440527; cv=none; d=zohomail.com; s=zohoarc; b=hDiZCaL+tnIUgMeGTRAAuI2BqCPYa7JqLsVUVV7l8Qz9E/Twtmd+H98l/1Kp+OSODsP0hWEOjn4lHrnMSJiLypy8hsPozjoA5ohIneNEYeIiICeWmNIYBwBLzrt4kigmH2nR3YDkh8yi6XLMkLpmFpjZFWgy98Q+Nnt1d2i5di4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440527; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7xwR18hbzVHxpKvFfeyl3S2ZQU85H+wD13Io+R8gRBg=; b=ClDmXcaE/hUAN9yY70FvUovgD/ErC20Q8789lDLYfh01LhueVV5KBiT9F/ny3R4rZq4BMuqLH0KQXTmsfvjXiwbxXotToHrJOFJbzRMKT18dArYZpSOKGRfp3qFE7HXd2MMzvkuNS0b5KtlyV+er2+BZgAT7P82mFeLo5/ROHG4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694440527414259.5353634932809; Mon, 11 Sep 2023 06:55:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMQ-0005ho-HQ; Mon, 11 Sep 2023 09:53:54 -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 1qfhMO-0005gV-SK for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:52 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMI-0003AF-Dt for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:52 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-31fa666000dso1047293f8f.2 for ; Mon, 11 Sep 2023 06:53:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440425; x=1695045225; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7xwR18hbzVHxpKvFfeyl3S2ZQU85H+wD13Io+R8gRBg=; b=WtplurwcAyq6S4cZXC9uJh0segdLG5IAeNe9OHmj4GRrCML3HKCb+ltNB/yy2lVixK tMZGzRLfFDvCODB8QvPRL6KqaEk0qYCbWkrjjhLSSck/miCJ67VE6uP7SA/mZOXIWjo+ XLiyYujYxVXWxXWVyOQjDff1QgizkBzsmvDTJu0uQOBqhoJ4jLgBYk+mxgIZEJlqBvqY ydscKvCrgIc/rntur/VID4TJQRGu0TzMK2GVWRbQFnaH0tB8+z7rLKq6JGIzR/UyIWGS WjemK9oBPx/z61B3WU/O0SAKX4iycLU/mk5jP25xIgecmSlop2OdasUQN1IjNuhUc7fB QjBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440425; x=1695045225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7xwR18hbzVHxpKvFfeyl3S2ZQU85H+wD13Io+R8gRBg=; b=YqXjUrqyJE02FFNKJnZoth5NyrqMHjGsA9pysjm4MfWvkS9AyFGM+QgIuaCROhlj7S +pP/NT74H1gS4AoT/szOCqwPZHHKphkxDMrs3yqvRa9Vnz9+UmXHmVzY6jErRA54zLKC Jphgcmwld8nAWFIVOUmbnbax/yd2OIWyGDzbndpJCbu38Zol5tXyEBjVSbazp59HTeri /N8ZY7OaUhaTUeFUJ3lsG8jJedmbLHSOdrObtwCiPR04sZjElh1r7c5qwjdXEgokAny4 sLPzT7zcz1muTkeCaobVPsLUoVcl11dMQNHuJDhk5hp8waNtgnHl5jdTXjhHHHEJDaEx bItw== X-Gm-Message-State: AOJu0YyvgB0TuTneVs6ROcYTMjz/1nPsn3HuaFftuZbMxx8PniMcd9sG gUJnYXk1ueFHHdOl3nTWl4wHQw== X-Google-Smtp-Source: AGHT+IGKYIPaoNuLAocktkE8cQ57GZW65jyzddykHIA+HpoF+evfwmBWuchL+tTA88/MP6n98xMwHw== X-Received: by 2002:a5d:4702:0:b0:31a:d9bc:47a2 with SMTP id y2-20020a5d4702000000b0031ad9bc47a2mr6719854wrq.53.1694440424799; Mon, 11 Sep 2023 06:53:44 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 4/7] linux-user/elfload.c: Report previously missing arm32 hwcaps Date: Mon, 11 Sep 2023 14:53:37 +0100 Message-Id: <20230911135340.1139553-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694440529047100015 Content-Type: text/plain; charset="utf-8" Add the code to report the arm32 hwcaps we were previously missing: ss, ssbs, fphp, asimdhp, asimddp, asimdfhm, asimdbf16, i8mm Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- linux-user/elfload.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index d51d077998a..bbb4f08109c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -506,6 +506,16 @@ uint32_t get_elf_hwcap(void) } } GET_FEATURE_ID(aa32_simdfmac, ARM_HWCAP_ARM_VFPv4); + /* + * MVFR1.FPHP and .SIMDHP must be in sync, and QEMU uses the same + * isar_feature function for both. The kernel reports them as two hwca= ps. + */ + GET_FEATURE_ID(aa32_fp16_arith, ARM_HWCAP_ARM_FPHP); + GET_FEATURE_ID(aa32_fp16_arith, ARM_HWCAP_ARM_ASIMDHP); + GET_FEATURE_ID(aa32_dp, ARM_HWCAP_ARM_ASIMDDP); + GET_FEATURE_ID(aa32_fhm, ARM_HWCAP_ARM_ASIMDFHM); + GET_FEATURE_ID(aa32_bf16, ARM_HWCAP_ARM_ASIMDBF16); + GET_FEATURE_ID(aa32_i8mm, ARM_HWCAP_ARM_I8MM); =20 return hwcaps; } @@ -520,6 +530,8 @@ uint32_t get_elf_hwcap2(void) GET_FEATURE_ID(aa32_sha1, ARM_HWCAP2_ARM_SHA1); GET_FEATURE_ID(aa32_sha2, ARM_HWCAP2_ARM_SHA2); GET_FEATURE_ID(aa32_crc32, ARM_HWCAP2_ARM_CRC32); + GET_FEATURE_ID(aa32_sb, ARM_HWCAP2_ARM_SB); + GET_FEATURE_ID(aa32_ssbs, ARM_HWCAP2_ARM_SSBS); return hwcaps; } =20 --=20 2.34.1 From nobody Fri May 10 10:37:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694440569; cv=none; d=zohomail.com; s=zohoarc; b=lJWPiVVjcnLYZ/vSrNtQCN8pC92Lf1P1qM3diJYwCkD2YmFf3ukT2uxgf9fMOL4tbNnBq0S1YaKu/dLQ0AZJRWsmFhvd86DioM2Q2yLssQGQokY8/w4Dm0CXFpTKMkbYG9YrDoWz9EoOIyDLXHpEkNO8mv+UPzi+LNCfn07fRwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440569; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u1Sxay0lp7tBIXUdn25IytxwGH8GR+kgQRzldh5/VB4=; b=HmITqSWz9q86ABtz290q4Gp3td5dbXFlW83jTpYElYob81XzXULPmZlyH8gUDK0dC1TmwNrxPFsfPvIfwsuE9OcYyO2e4XGPcuESYNK8jqsT49WIEvBJsdfuPEffu0QvTpYW/OBZ/1f8USTsQNXLF0xBH9sERgwx84S9qRhMtRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694440569081189.93133726947974; Mon, 11 Sep 2023 06:56:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMV-0005qA-9S; Mon, 11 Sep 2023 09:53:59 -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 1qfhMT-0005oR-Qb for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:57 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMJ-0003AU-Qw for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:57 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31f7400cb74so3635730f8f.2 for ; Mon, 11 Sep 2023 06:53:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440425; x=1695045225; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=u1Sxay0lp7tBIXUdn25IytxwGH8GR+kgQRzldh5/VB4=; b=BCfb8zw9jAvGrNBelKWG1jLTGU/fgpV2Ufd/fsFX5xrNyWAyaySnqpRU5SU0bQqqMC xdoxdDDSqYHlIuKoSvxoupY+zJE0U7POME5QdHUb4edp0I0FoP0fB0Vo8uq+GanNE7+F liFAAreGR9t1okaBuKra5i08V4ldw/YwQMUG7RdnOfDJ88lEDJhpyVXdAtk20TnrnQWM DwZvzgH3pl0tMZfJc+gYDo2cS7kqSsY6eQqIPrgnVpOLhfBy1/sISoTJLD7QceyJUI1o olusJbX/wSBYM9ULWCMRn8CToyVAjjJU507/GdXNYYWHC2qDtNCRm8H3Zw9DztMK/HVo Jb3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440425; x=1695045225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u1Sxay0lp7tBIXUdn25IytxwGH8GR+kgQRzldh5/VB4=; b=SrClPXnzolXnRpPdV+4aFTh10CROAZSiJrwbEuLoOvJpQBWwMndRb2PNyrA55dpFv+ GqsjPHwZfFtkqE13xtRpaKrIZ8Q4XdGIW2hjOP47CruCazAXtUtfqc62mtml6cnFyIRv cVxaDXgdTflwIneaqVLyIy4wfs+Z5aNjdmiHro7puVPmrYxD/CMzQqQbMMow2NHUhuHG fqC3qPES0UkdmXMUOU7L/4xzMSQxfhIOKPnfNvxd4b54qKn2GSTWcew3g8lHcbtJIipI pZzuB9b9w9I4wSvO04nQNeKFTOBYAR3sJHSFDmFLNlGe+BIqjfxJtqdUcqLD6GX2wnCi wQFw== X-Gm-Message-State: AOJu0YwPbni6dRa4Zcb72IOGpgzptmOoTYOzv7L21XwbjUeV2R8n8Ht0 ZKcs15RNPVObqZRm7qm4Rd8qvA== X-Google-Smtp-Source: AGHT+IHFX6oTijBB0X2/hDEkrL9z5/Yn0JT1p86dnC57QDjmUupgyqZ7B5TrJpME9Ze1VuKtJ9YtZA== X-Received: by 2002:adf:fc12:0:b0:31c:e933:9593 with SMTP id i18-20020adffc12000000b0031ce9339593mr8238197wrr.6.1694440425287; Mon, 11 Sep 2023 06:53:45 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 5/7] target/arm: Update AArch64 ID register field definitions Date: Mon, 11 Sep 2023 14:53:38 +0100 Message-Id: <20230911135340.1139553-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.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, UPPERCASE_50_75=0.008 autolearn=no 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694440619531100001 Content-Type: text/plain; charset="utf-8" Update our AArch64 ID register field definitions from the 2023-06 system register XML release: https://developer.arm.com/documentation/ddi0601/2023-06/ Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- This is intended to allow updating the set of ID register fields we expose for user-only mode, so I have only updated the AArch64 ID registers, not AArch32. --- target/arm/cpu.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index e637796fd83..eddf2d3b72c 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2165,6 +2165,7 @@ FIELD(ID_AA64ISAR0, SHA1, 8, 4) FIELD(ID_AA64ISAR0, SHA2, 12, 4) FIELD(ID_AA64ISAR0, CRC32, 16, 4) FIELD(ID_AA64ISAR0, ATOMIC, 20, 4) +FIELD(ID_AA64ISAR0, TME, 24, 4) FIELD(ID_AA64ISAR0, RDM, 28, 4) FIELD(ID_AA64ISAR0, SHA3, 32, 4) FIELD(ID_AA64ISAR0, SM3, 36, 4) @@ -2199,6 +2200,13 @@ FIELD(ID_AA64ISAR2, APA3, 12, 4) FIELD(ID_AA64ISAR2, MOPS, 16, 4) FIELD(ID_AA64ISAR2, BC, 20, 4) FIELD(ID_AA64ISAR2, PAC_FRAC, 24, 4) +FIELD(ID_AA64ISAR2, CLRBHB, 28, 4) +FIELD(ID_AA64ISAR2, SYSREG_128, 32, 4) +FIELD(ID_AA64ISAR2, SYSINSTR_128, 36, 4) +FIELD(ID_AA64ISAR2, PRFMSLC, 40, 4) +FIELD(ID_AA64ISAR2, RPRFM, 48, 4) +FIELD(ID_AA64ISAR2, CSSC, 52, 4) +FIELD(ID_AA64ISAR2, ATS1A, 60, 4) =20 FIELD(ID_AA64PFR0, EL0, 0, 4) FIELD(ID_AA64PFR0, EL1, 4, 4) @@ -2226,6 +2234,12 @@ FIELD(ID_AA64PFR1, SME, 24, 4) FIELD(ID_AA64PFR1, RNDR_TRAP, 28, 4) FIELD(ID_AA64PFR1, CSV2_FRAC, 32, 4) FIELD(ID_AA64PFR1, NMI, 36, 4) +FIELD(ID_AA64PFR1, MTE_FRAC, 40, 4) +FIELD(ID_AA64PFR1, GCS, 44, 4) +FIELD(ID_AA64PFR1, THE, 48, 4) +FIELD(ID_AA64PFR1, MTEX, 52, 4) +FIELD(ID_AA64PFR1, DF2, 56, 4) +FIELD(ID_AA64PFR1, PFAR, 60, 4) =20 FIELD(ID_AA64MMFR0, PARANGE, 0, 4) FIELD(ID_AA64MMFR0, ASIDBITS, 4, 4) @@ -2257,6 +2271,7 @@ FIELD(ID_AA64MMFR1, AFP, 44, 4) FIELD(ID_AA64MMFR1, NTLBPA, 48, 4) FIELD(ID_AA64MMFR1, TIDCP1, 52, 4) FIELD(ID_AA64MMFR1, CMOW, 56, 4) +FIELD(ID_AA64MMFR1, ECBHB, 60, 4) =20 FIELD(ID_AA64MMFR2, CNP, 0, 4) FIELD(ID_AA64MMFR2, UAO, 4, 4) @@ -2278,7 +2293,9 @@ FIELD(ID_AA64DFR0, DEBUGVER, 0, 4) FIELD(ID_AA64DFR0, TRACEVER, 4, 4) FIELD(ID_AA64DFR0, PMUVER, 8, 4) FIELD(ID_AA64DFR0, BRPS, 12, 4) +FIELD(ID_AA64DFR0, PMSS, 16, 4) FIELD(ID_AA64DFR0, WRPS, 20, 4) +FIELD(ID_AA64DFR0, SEBEP, 24, 4) FIELD(ID_AA64DFR0, CTX_CMPS, 28, 4) FIELD(ID_AA64DFR0, PMSVER, 32, 4) FIELD(ID_AA64DFR0, DOUBLELOCK, 36, 4) @@ -2286,6 +2303,7 @@ FIELD(ID_AA64DFR0, TRACEFILT, 40, 4) FIELD(ID_AA64DFR0, TRACEBUFFER, 44, 4) FIELD(ID_AA64DFR0, MTPMU, 48, 4) FIELD(ID_AA64DFR0, BRBE, 52, 4) +FIELD(ID_AA64DFR0, EXTTRCBUFF, 56, 4) FIELD(ID_AA64DFR0, HPMN0, 60, 4) =20 FIELD(ID_AA64ZFR0, SVEVER, 0, 4) @@ -2299,9 +2317,13 @@ FIELD(ID_AA64ZFR0, F32MM, 52, 4) FIELD(ID_AA64ZFR0, F64MM, 56, 4) =20 FIELD(ID_AA64SMFR0, F32F32, 32, 1) +FIELD(ID_AA64SMFR0, BI32I32, 33, 1) FIELD(ID_AA64SMFR0, B16F32, 34, 1) FIELD(ID_AA64SMFR0, F16F32, 35, 1) FIELD(ID_AA64SMFR0, I8I32, 36, 4) +FIELD(ID_AA64SMFR0, F16F16, 42, 1) +FIELD(ID_AA64SMFR0, B16B16, 43, 1) +FIELD(ID_AA64SMFR0, I16I32, 44, 4) FIELD(ID_AA64SMFR0, F64F64, 48, 1) FIELD(ID_AA64SMFR0, I16I64, 52, 4) FIELD(ID_AA64SMFR0, SMEVER, 56, 4) --=20 2.34.1 From nobody Fri May 10 10:37:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694440549; cv=none; d=zohomail.com; s=zohoarc; b=fGszGVMvOnguilf0HwFSuoqmKPLrnJ59lscibelM5pSQlXQVPQVWehxYQlekomo8sNcMZd9im4kxrKkpjhUxheOB/ZyGrP+51/UuMNGBClcx1ZKEGxxDtEOhbbuO+S9P37rgkvN6Gsft7XwkRzhdRz1T0hcHWfKS6LVHBlKWBqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440549; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ELrRVF0tIk1TLgBNd5bg7VAVQK5daGM7tIeCJh5jEMU=; b=N4JvLnoaql8GQek08+a8gv3vLLaZ7dMDxAw7Mww/K1vahjZq/Koo9vjze7T8YzJjViFKo5dBKWTmFf/f+ZhlaT/Xm0yBvrfJqoMferBbU7QlhFZDB/gYyndRXAAO4u3KUFr7M9yFHmW8GsP8HPe+hCPQFpxp5S6+Y3EdEyKRPHE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694440549847699.4553151290853; Mon, 11 Sep 2023 06:55:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMV-0005qp-TV; Mon, 11 Sep 2023 09:53:59 -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 1qfhMS-0005kC-CF for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:56 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMJ-0003Af-Em for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:56 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31f7638be6eso3706259f8f.3 for ; Mon, 11 Sep 2023 06:53:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440426; x=1695045226; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ELrRVF0tIk1TLgBNd5bg7VAVQK5daGM7tIeCJh5jEMU=; b=LTLU7aUnq2AuqEJe0QjTzCJwvXz80xLixsWleczvAvCgRxOFwR1hwezK7vjSxA8ump o+y5C3QHOZardEBVMciNtYDdyZFv3drFq6CGt0uXhQwjglAD+j+W+kusHtH7R/Sr1wu0 G0dRcT7FnifGewY6Oy99OSavUjZ0MnPEPchIQ3L2MjrTuFvKPUQ1NrREZPjhVh53WHQ7 +ysStX6mBbkMisUllcKCzWf1wi4Exb++5oAEjcttJdkhkmphAhp0rQd2PVKt5lQch2I1 6pVQdmWtnzvWNjKbiyaPoHUxavcUP3t508pv7Nm0gHWoxdDOiBDtm9sx50XcCm0uqtqo RS5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440426; x=1695045226; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ELrRVF0tIk1TLgBNd5bg7VAVQK5daGM7tIeCJh5jEMU=; b=dR/wCrr7wbjvk7qd4omks3emapnXAQhQ1tcl6JsUBIEpjVeSvSLoFP49NNn78AML1/ cVV5IhD8vRq2zIocjkvSb4A6vNOY4V7nriTXIi4o9OO4HhJncgLnU+avauqiTKzcPshT DjxjDNDqLPkJSnPIkgxFVqYzbIKQcj+0KPFk5PAhiJjz+ZVUDqFBXUb5+WauWgLmDh+n J7uBb75Dlc3J9iZUmyZq74rCpa7o24yrclewkvtr3mnQcQdVGCU7aH1O2921oTOO4UCH mliTnmeYGv0Xj4HIy94iHg9uL689aPRem8HG6oN8C9ZtAn5yUxxb2rGVdgF/p58UGqeo /yYA== X-Gm-Message-State: AOJu0YzDhvu12ZVuUBPkgVsmFuN2mvm1gAK+A5tXOipGXSjb3pk//vnR P2GhhRFUWEonW1t0WTRZZWo1SlPpNIoUFKkl6Qs= X-Google-Smtp-Source: AGHT+IHYt8eGDXXWuhguUFtq0Yb2mPzUcXa5IBDVKdgIrhzd1FnYde1PVPuMH2pzU7ZSe9+Sl+A4vQ== X-Received: by 2002:adf:fdc2:0:b0:317:5d1c:9719 with SMTP id i2-20020adffdc2000000b003175d1c9719mr8571670wrs.9.1694440425944; Mon, 11 Sep 2023 06:53:45 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 6/7] target/arm: Update user-mode ID reg mask values Date: Mon, 11 Sep 2023 14:53:39 +0100 Message-Id: <20230911135340.1139553-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694440593334100001 Content-Type: text/plain; charset="utf-8" For user-only mode we reveal a subset of the AArch64 ID registers to the guest, to emulate the kernel's trap-and-emulate-ID-regs handling. Update the feature bit masks to match upstream kernel commit a48fa7efaf1161c1c. None of these features are yet implemented by QEMU, so this doesn't yet have a behavioural change, but implementation of FEAT_MOPS and FEAT_HBC is imminent. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/helper.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index f9f7c3c39e9..ad84fcf041d 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -8621,11 +8621,16 @@ void register_cp_regs_for_features(ARMCPU *cpu) R_ID_AA64ZFR0_F64MM_MASK }, { .name =3D "ID_AA64SMFR0_EL1", .exported_bits =3D R_ID_AA64SMFR0_F32F32_MASK | + R_ID_AA64SMFR0_BI32I32_MASK | R_ID_AA64SMFR0_B16F32_MASK | R_ID_AA64SMFR0_F16F32_MASK | R_ID_AA64SMFR0_I8I32_MASK | + R_ID_AA64SMFR0_F16F16_MASK | + R_ID_AA64SMFR0_B16B16_MASK | + R_ID_AA64SMFR0_I16I32_MASK | R_ID_AA64SMFR0_F64F64_MASK | R_ID_AA64SMFR0_I16I64_MASK | + R_ID_AA64SMFR0_SMEVER_MASK | R_ID_AA64SMFR0_FA64_MASK }, { .name =3D "ID_AA64MMFR0_EL1", .exported_bits =3D R_ID_AA64MMFR0_ECV_MASK, @@ -8676,7 +8681,11 @@ void register_cp_regs_for_features(ARMCPU *cpu) .exported_bits =3D R_ID_AA64ISAR2_WFXT_MASK | R_ID_AA64ISAR2_RPRES_MASK | R_ID_AA64ISAR2_GPA3_MASK | - R_ID_AA64ISAR2_APA3_MASK }, + R_ID_AA64ISAR2_APA3_MASK | + R_ID_AA64ISAR2_MOPS_MASK | + R_ID_AA64ISAR2_BC_MASK | + R_ID_AA64ISAR2_RPRFM_MASK | + R_ID_AA64ISAR2_CSSC_MASK }, { .name =3D "ID_AA64ISAR*_EL1_RESERVED", .is_glob =3D true }, }; --=20 2.34.1 From nobody Fri May 10 10:37:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694440551; cv=none; d=zohomail.com; s=zohoarc; b=cSI3U+hNzeBy0dDCzq3v6uU5U0gV2s90tMq/aEvDFoyBxcI3QjgJtOkWgaTgnYiQ4Ydl4Eun+7rvxCGU9ZG9uh22PvygvxNgZIL+vhgVRizx2K7+QF5RdPF59gqoeKjS+EeiD2TrEPI9U58yfbLsSfVF2posw+jUXjGqTvCE9i8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694440551; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1SPaLFJICW9q9gqa6qvPwlUkb8XaROQF8dYUvvHc24Q=; b=D0b+fHbyRZM+b3D/Oy5quM5362fzeAntp7CQqSy2mmU0tUsa+vpVFnmQc7NouanWaMLRbEM6JcTqv4tiia4L8pb5+dhECg8/f2NV5dKkKXzQXbt5vrqLOQc2X91kUYxdVbQkKPyCUdV9LBSjsQxRMVpFxIDc7MXL8zrJOdKnt6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694440551534199.93863170451277; Mon, 11 Sep 2023 06:55:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhMV-0005qJ-B1; Mon, 11 Sep 2023 09:53:59 -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 1qfhMU-0005pU-GO for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:58 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfhMJ-0003Am-Ts for qemu-devel@nongnu.org; Mon, 11 Sep 2023 09:53:58 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31fa666000dso1047326f8f.2 for ; Mon, 11 Sep 2023 06:53:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm10079758wrq.49.2023.09.11.06.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 06:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694440426; x=1695045226; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1SPaLFJICW9q9gqa6qvPwlUkb8XaROQF8dYUvvHc24Q=; b=XvgKZ50R8Dbc3FCeJtRahF+ujCToUeWldnj/USmBXiW4NOsH6Nwor2OO95xjHll+hi YrUaijJSzaIbIagjDVXj3MrJdfvGxxQeCuCjZb1VTYvxqgEBjxyn/9XKXi724OuI3mY2 pufSNFviwK01r+UWVT7DBq6Oq726gHb/hncvlFv25mTGJkFNVilXpLwYkPEgVScLjHju lrkxQVNYJCmk1Q4K8LDwqe1tWkuq3LP6+jG/Nf8wahLACRWvH0J9Kcby7jsW5Z+j84zj 1xe/95lGeEW3UftyI5Wkze5tqF9kEuaO+NUOzoOjlgSEXDFOWwW2bzdxq7NVHSpQSZd1 ndqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694440426; x=1695045226; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1SPaLFJICW9q9gqa6qvPwlUkb8XaROQF8dYUvvHc24Q=; b=PXGLPJmEfNKmROmbsMfkVOOB88uhjvNr/sepA1G5ExVYNww30OqdMyoI+/N+2V/BvG 0kUtIMUV4xUeBNCizCR0bc2FmDMIephgERY5cjbaIzl52x0AIY4iqWoFAL+Zv70+Sxh/ W5f5P6028JvkcQ0EPEqdiy7mXDZkMPK9drSy1aBrOH544VUHz6h7JGFDLYU+6eKprUjG c5nhCuGXWznzidHn4X+1yVGYOQSyDioG3SeIAndWfhQyc8zLhx8ahLLIDkGFIBpWDhm6 lc6Ffx+Lj5ErTcHMJkW/hxXZypXWJs0WHuwRwCz8CbSso/smgV0yhktfqGZo9l3r1D5o NvWQ== X-Gm-Message-State: AOJu0Yw1TfQWIU8eXPdskDP14RL5xSQuJoLDZL9WTmUxeRONSUoBlfNw 4ER9AYzzhhaF+FifoifbXsoO/MFfgC5fZyv+QAc= X-Google-Smtp-Source: AGHT+IH4iUR6QG0LLQ5pPYm11Xtvmh2D7E8OvHkKSnSCUlsFauob0y93CkVzXiP3kcWVLnYm9cQsAA== X-Received: by 2002:a5d:5744:0:b0:31a:e972:3601 with SMTP id q4-20020a5d5744000000b0031ae9723601mr8458561wrw.54.1694440426494; Mon, 11 Sep 2023 06:53:46 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 7/7] target/arm: Implement FEAT_HBC Date: Mon, 11 Sep 2023 14:53:40 +0100 Message-Id: <20230911135340.1139553-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230911135340.1139553-1-peter.maydell@linaro.org> References: <20230911135340.1139553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.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 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694440553242100002 Content-Type: text/plain; charset="utf-8" FEAT_HBC (Hinted conditional branches) provides a new instruction BC.cond, which behaves exactly like the existing B.cond except that it provides a hint to the branch predictor about the likely behaviour of the branch. Since QEMU does not implement branch prediction, we can treat this identically to B.cond. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- docs/system/arm/emulation.rst | 1 + target/arm/cpu.h | 5 +++++ target/arm/tcg/a64.decode | 3 ++- linux-user/elfload.c | 1 + target/arm/tcg/cpu64.c | 4 ++++ target/arm/tcg/translate-a64.c | 4 ++++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index 2e6a7c8961e..34429054a3f 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -39,6 +39,7 @@ the following architecture extensions: - FEAT_FlagM2 (Enhancements to flag manipulation instructions) - FEAT_GTG (Guest translation granule size) - FEAT_HAFDBS (Hardware management of the access flag and dirty bit state) +- FEAT_HBC (Hinted conditional branches) - FEAT_HCX (Support for the HCRX_EL2 register) - FEAT_HPDS (Hierarchical permission disables) - FEAT_HPDS2 (Translation table page-based hardware attributes) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index eddf2d3b72c..fc45f1fb9e2 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -4050,6 +4050,11 @@ static inline bool isar_feature_aa64_i8mm(const ARMI= SARegisters *id) return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, I8MM) !=3D 0; } =20 +static inline bool isar_feature_aa64_hbc(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, BC) !=3D 0; +} + static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id) { return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >=3D 1; diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index ef64a3f9cba..71113173020 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -126,7 +126,8 @@ CBZ sf:1 011010 nz:1 ................... rt= :5 &cbz imm=3D%imm19 =20 TBZ . 011011 nz:1 ..... .............. rt:5 &tbz imm=3D%imm14= bitpos=3D%imm31_19 =20 -B_cond 0101010 0 ................... 0 cond:4 imm=3D%imm19 +# B.cond and BC.cond +B_cond 0101010 0 ................... c:1 cond:4 imm=3D%imm19 =20 BR 1101011 0000 11111 000000 rn:5 00000 &r BLR 1101011 0001 11111 000000 rn:5 00000 &r diff --git a/linux-user/elfload.c b/linux-user/elfload.c index bbb4f08109c..203a2b790d5 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -815,6 +815,7 @@ uint32_t get_elf_hwcap2(void) GET_FEATURE_ID(aa64_sme_f64f64, ARM_HWCAP2_A64_SME_F64F64); GET_FEATURE_ID(aa64_sme_i16i64, ARM_HWCAP2_A64_SME_I16I64); GET_FEATURE_ID(aa64_sme_fa64, ARM_HWCAP2_A64_SME_FA64); + GET_FEATURE_ID(aa64_hbc, ARM_HWCAP2_A64_HBC); =20 return hwcaps; } diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 0f8972950d6..90e033bbc3a 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -814,6 +814,10 @@ void aarch64_max_tcg_initfn(Object *obj) t =3D FIELD_DP64(t, ID_AA64ISAR1, I8MM, 1); /* FEAT_I8MM */ cpu->isar.id_aa64isar1 =3D t; =20 + t =3D cpu->isar.id_aa64isar2; + t =3D FIELD_DP64(t, ID_AA64ISAR2, BC, 1); /* FEAT_HBC */ + cpu->isar.id_aa64isar2 =3D t; + t =3D cpu->isar.id_aa64pfr0; t =3D FIELD_DP64(t, ID_AA64PFR0, FP, 1); /* FEAT_FP16 */ t =3D FIELD_DP64(t, ID_AA64PFR0, ADVSIMD, 1); /* FEAT_FP16 */ diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 0b77c92437f..15eca55fc75 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -1453,6 +1453,10 @@ static bool trans_TBZ(DisasContext *s, arg_tbz *a) =20 static bool trans_B_cond(DisasContext *s, arg_B_cond *a) { + /* BC.cond is only present with FEAT_HBC */ + if (a->c && !dc_isar_feature(aa64_hbc, s)) { + return false; + } reset_btype(s); if (a->cond < 0x0e) { /* genuinely conditional branches */ --=20 2.34.1