From patchwork Mon Feb 27 23:01:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 657140 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2615946wrb; Mon, 27 Feb 2023 15:02:11 -0800 (PST) X-Google-Smtp-Source: AK7set+4ZGdi1VKxOVoMw4AG+RPk81JrvqCLeNHu6vaNYPjnvHXUiCcVE83yNt3tQofHmeHQyf1Z X-Received: by 2002:a05:622a:89:b0:3bf:dbd3:a02e with SMTP id o9-20020a05622a008900b003bfdbd3a02emr1833235qtw.45.1677538931232; Mon, 27 Feb 2023 15:02:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677538931; cv=none; d=google.com; s=arc-20160816; b=bTb1Aeji2OkJpTfzJSynsNJIjAuLr3+hCx0hXiRxIfy5Iwae0ymruAWPAm7eAmVqX3 ufB5wtSkEggJcEemD7CL4S0nuAioIZENHESsCVn2TTmjDlAFEthQeJ5+W/6ePyFZI6b5 ahGM6NDzt5JXi+F9kmVAL8BWvZqkVd0cYrXS/ovRYZhMVnmtMexRedOxm7DpSRNc6Lim hT9scNJJNSquG9agqxuXfvfxqgK3yAHU2y9f+AtOzHZwpE3SauSWhQpgk9V23dXyUzTa Yar8MmLBPVjO+gXJsFvceN6PnUAic6Xnucjdrxk8OF7HrK+Te/2G/lpiBGIqtahptlSD V5DQ== 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=YTNMbTWIUFHY2u2ZLT0n2ZG7eWfkLXxJ/1KtgwAcDkA=; b=QspHZSaZNpPhQ3GbhwOYFh9ztFyWrNmlqaf8TLJRXAK0Qa5voUJKHRd/3ARgXOeCKb TS0fJdf8WhMFdgqJEVEsw9bdHOls9KaeK+xMBRn8DV9fnyBM/ibdOe6pIuJDhBDCwxDK Qpvd0Fpqe9GrQPDM6lbxgGjnrYg1nSgKnT4b5nsyNLY8U3/3uCQ43Q0klOGjgFeGAZ6q Vt9wuCgxJop1rfe38qNsQEQg+/lpVwKAI/5ic/YpHVcdFVXCgNEFpPVFZ5sjMWmY0Rws i+JDmEB6KhBItXFYfvqcwvcvxP1GD9jkSM9PsMpDAgDwYAosS0FSrINm0GTQYMhjX4o+ X+kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZuJeYqWb; 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 x19-20020ac85f13000000b003b68d725507si7935431qta.263.2023.02.27.15.02.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 15:02:11 -0800 (PST) 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=ZuJeYqWb; 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 1pWmUu-0007Hr-5Z; Mon, 27 Feb 2023 18:01:32 -0500 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 1pWmUs-0007GU-Hg for qemu-devel@nongnu.org; Mon, 27 Feb 2023 18:01:30 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWmUq-0000x7-Qb for qemu-devel@nongnu.org; Mon, 27 Feb 2023 18:01:30 -0500 Received: by mail-pl1-x644.google.com with SMTP id i5so6806809pla.2 for ; Mon, 27 Feb 2023 15:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=YTNMbTWIUFHY2u2ZLT0n2ZG7eWfkLXxJ/1KtgwAcDkA=; b=ZuJeYqWbal2zL5DnD/CMt8Z35P5rWhp+TxLrguhhMxcRDK2W0z4TAQc7fwp8w4SOth /2JJ30WZ+oGX5F9rXiej4WD8g3U30ZwMvxA7lGdNvUxgEYX7nN8Cm5uXWl5TEqMvWDLm 3yAWUpF6motFC4IT/IjaoqXMNZe40R2bY+06/907K6PhqVIbnqTMaQoTu8UR+ZWZPKJw 0QvaXGFgI9DNAa7q9cu6cyUwvHUu2t3oOQggKZzXj4Qsi1F0JKsD4aWy+MSJQ5n7GGxA Yo6lDW3Rtyc9mQQGnOXeAYc7vdLSmWMGF7P2zUEcBYdJSOTOL+2m5NIU2wIxxfAfHgJM UD4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=YTNMbTWIUFHY2u2ZLT0n2ZG7eWfkLXxJ/1KtgwAcDkA=; b=Wju45FmhJ+Bg9/ZebiK0UI7YUcAXrkcnEcDM9nRXNoXL5OYmin7aT4iYQlmmFGpfVp oI7qcoGlQyvkgOMavV4SpRViY6nBOE6U3lN+RUtJzWh/wg/pikvdzEQuj8YdDethuhw7 3bD9soT/Fa+azvMJn9syW3vL9qYLIP5ZFppsqaAJ7Du9mkU57Uk+tuSsWEyJuuHMhngu mfvbFI/eFVNZo9jcuXQz1sECMpBLonp72KfQZDOa6UQKU/A6o/q/oVom/f8ub5TkCRXM cJdJ57xaSuKOtXf/mLD2m7i6wkBVPxJPotawkmpE9BZpMBROByts/A4ZuQp+aHAlhi9l vHQw== X-Gm-Message-State: AO0yUKW/9YIrZhDl+e8/rrWdmbX52f5PcLarTQ7hEsDz7UoCep9VnI7E xsMF7959HKXcFK8GFY3HJtP7sTbiENY/pjGyx3wsnQ== X-Received: by 2002:a05:6a20:2445:b0:cc:f057:d3e2 with SMTP id t5-20020a056a20244500b000ccf057d3e2mr1161218pzc.9.1677538887548; Mon, 27 Feb 2023 15:01:27 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id u2-20020a637902000000b0050301745a5dsm4406130pgc.50.2023.02.27.15.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 15:01:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH for-8.0 v4 01/21] target/arm: Add isar_feature_aa64_rme Date: Mon, 27 Feb 2023 13:01:02 -1000 Message-Id: <20230227230122.816702-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227230122.816702-1-richard.henderson@linaro.org> References: <20230227230122.816702-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x644.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Add the missing field for ID_AA64PFR0, and the predicate. Disable it if EL3 is forced off by the board or command-line. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 6 ++++++ target/arm/cpu.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index cb4e405f04..b046f96e4e 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2190,6 +2190,7 @@ FIELD(ID_AA64PFR0, SEL2, 36, 4) FIELD(ID_AA64PFR0, MPAM, 40, 4) FIELD(ID_AA64PFR0, AMU, 44, 4) FIELD(ID_AA64PFR0, DIT, 48, 4) +FIELD(ID_AA64PFR0, RME, 52, 4) FIELD(ID_AA64PFR0, CSV2, 56, 4) FIELD(ID_AA64PFR0, CSV3, 60, 4) @@ -3808,6 +3809,11 @@ static inline bool isar_feature_aa64_sel2(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, SEL2) != 0; } +static inline bool isar_feature_aa64_rme(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RME) != 0; +} + static inline bool isar_feature_aa64_vh(const ARMISARegisters *id) { return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, VH) != 0; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0b333a749f..5092450e5b 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1950,6 +1950,10 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) cpu->isar.id_dfr0 = FIELD_DP32(cpu->isar.id_dfr0, ID_DFR0, COPSDBG, 0); cpu->isar.id_aa64pfr0 = FIELD_DP64(cpu->isar.id_aa64pfr0, ID_AA64PFR0, EL3, 0); + + /* Disable the realm management extension, which requires EL3. */ + cpu->isar.id_aa64pfr0 = FIELD_DP64(cpu->isar.id_aa64pfr0, + ID_AA64PFR0, RME, 0); } if (!cpu->has_el2) {