From patchwork Tue Jan 24 00:00:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 645985 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp2471847pvb; Mon, 23 Jan 2023 16:06:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXuWnOm+mgRSQjX81G5qpZJd2GC8oI5cbznT9L26KtPjukEB0IPhx1LOoHD2bM2ob2bgL6qS X-Received: by 2002:a25:bcc6:0:b0:7fd:6007:e964 with SMTP id l6-20020a25bcc6000000b007fd6007e964mr10478542ybm.33.1674518803950; Mon, 23 Jan 2023 16:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674518803; cv=none; d=google.com; s=arc-20160816; b=SvF5lHX0gp4K47pSoX5yfnAs6UGXQvnTqxDMCmZhez2FC5JQLVN8N4dMJx1q9GyGlk oZ0r0YDKAbmT6VPvRexTwy8nytuIwcha61mffwa8sKVDodDtSx2g2/XsDsI7uxnKyytr oQ0y05hMEDHBYPkK02gFfP8qIZGy7sx69zGXN56F8KU5Op1YxqGRPlV7sm2y5q7npCO8 bGn7vAOkcLpHFBfth0JXVqIynMHloiX+WNKbrC0RToDPlGNLC8fRAnvcHadj8LJmKY5h 8JJLaXhStGx/7WVf/1XklWLFih5uC3TXFfIBLxh0csvWQmLA00g5llYvzPFvXEVyqdjw J68w== 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=QK9QlABk5t9+fp8Dy6kIrYtuJQuby0NjdaBqhl+wHuM=; b=Wy7UwbbIzWFFxUruJSTqj9MElzrcom4Amy8dVqXCws/eInQYCYI15GZSQ2BwvWTiRb hy9jrfY8NWyQb/Rcdn7tFGOC124Sam4Lg6Gz66EbNybHQt92X165EhyKa9hnY7mMftqR RSAhSBRIfvV4H8Fho67XgPkoHMnGarYH0t3VvXmrBwnRuGrFa7I3ZzsAPmVuJqgV0V5u BhfmOdbPXVXp8M7SnYVLyDr6/iOC7Qg5/Leivazttb8K52DKmYNksOAyNRwDIs3wo9Ay LKQlQNyf6aukG0IbjEmFSMJ1aCX6VlVAYTlfFrwSAJYlVgz1Pxfmy98DEpoEIHC4pyV9 oYGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WvEXUHsm; 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 g10-20020ae9e10a000000b007054167fb81si472912qkm.555.2023.01.23.16.06.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jan 2023 16:06:43 -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=WvEXUHsm; 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 1pK6kl-0001rd-Aj; Mon, 23 Jan 2023 19:01:31 -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 1pK6kh-0001aa-Lj for qemu-devel@nongnu.org; Mon, 23 Jan 2023 19:01:27 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pK6ke-00020V-O2 for qemu-devel@nongnu.org; Mon, 23 Jan 2023 19:01:27 -0500 Received: by mail-pf1-x436.google.com with SMTP id z3so10123649pfb.2 for ; Mon, 23 Jan 2023 16:01:24 -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=QK9QlABk5t9+fp8Dy6kIrYtuJQuby0NjdaBqhl+wHuM=; b=WvEXUHsm7KLRLg6Ywu9lX/WUlE2AG4kqp9QgslghcrYvDYgmMB7ajJf7QV/5HKmJ3w 0dnNpruT/qhxh/zS4oeJqtYP+livbdPaZE63m2iXQVSFtQ1TOgJ5WXhwC3MlpOjldKKJ MLhzI1olWBa+tG0YkQ1qflRfigwFDQe4FtTG9BCqiHkpDl4mSHC2wE7I+RQoE+uy3iiS ZnQ+YseiXuMEqlxiuLdEavBBNNElPAiPLPhrkNG99tIfOu7HeM+BhF95sMXHxKNbz33f OOJwUTaLWYjUF9JEsfglCIGrtgYB/S0u4PhniGMri9tPrNItQG8lqgrbnOkYjT3vLgRc Lhpw== 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=QK9QlABk5t9+fp8Dy6kIrYtuJQuby0NjdaBqhl+wHuM=; b=xuoW81flxHZHCbM3sQ5Rde3doRCAbJpIw2q6pm6o2osgKG4DaL1fwHi8Rk6sRSL1IU rO2G6dp5RB3gWYkmiomk6GTULJbylh8ttE8sOdlenrm9/OOO7xE6yoMxYmSt2bQg1xSP qs0HRs3kmff9Nu5yhTPVo2wBHO1TlMCzd7kSmtI5i4WbZBdkrDZ4J7lOs77Z8dzsKMb/ 1pRevTGYSbEjma/NaAnMTckZfcizTaUxBVKukiIUU8TvaJrPfnNjNfy/DJouawWBAMSJ x5UuVh/eHmlF/F6rD3spTX/3+a4XHlAYZt3ePkVkAmMtbscqtHfI9A7upBu37TLVgQXX 4i9w== X-Gm-Message-State: AFqh2ko2ZCt1NueAjQceV3aXTMyG77fD75sxW7P54JHhftRE3uCLfGG/ d37hGSSyPXZyUUQHublVFaWtVZRYsw73KmU/ X-Received: by 2002:a05:6a00:1d23:b0:58a:9bef:5cd3 with SMTP id a35-20020a056a001d2300b0058a9bef5cd3mr24725396pfx.17.1674518483396; Mon, 23 Jan 2023 16:01:23 -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 x21-20020a056a00189500b0058bc37f3d13sm174104pfh.43.2023.01.23.16.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 16:01:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, yier.jin@huawei.com, jonathan.cameron@huawei.com, leonardo.garcia@linaro.org Subject: [PATCH 21/22] target/arm: Enable RME for -cpu max Date: Mon, 23 Jan 2023 14:00:26 -1000 Message-Id: <20230124000027.3565716-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230124000027.3565716-1-richard.henderson@linaro.org> References: <20230124000027.3565716-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 a cpu property to set GPCCR_EL3.L0GPTSZ, for testing various possible configurations. Signed-off-by: Richard Henderson --- target/arm/cpu64.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 0e021960fb..b9343004fb 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -672,6 +672,40 @@ void arm_cpu_lpa2_finalize(ARMCPU *cpu, Error **errp) cpu->isar.id_aa64mmfr0 = t; } +static void cpu_max_set_l0gptsz(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + ARMCPU *cpu = ARM_CPU(obj); + uint32_t value; + + if (!visit_type_uint32(v, name, &value, errp)) { + return; + } + + /* Encode the value for the GPCCR_EL3 field. */ + switch (value) { + case 30: + case 34: + case 36: + case 39: + cpu->reset_l0gptsz = value - 30; + break; + default: + error_setg(errp, "invalid value for l0gptsz"); + error_append_hint(errp, "valid values are 30, 34, 36, 39\n"); + break; + } +} + +static void cpu_max_get_l0gptsz(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + ARMCPU *cpu = ARM_CPU(obj); + uint32_t value = cpu->reset_l0gptsz + 30; + + visit_type_uint32(v, name, &value, errp); +} + static void aarch64_a57_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); @@ -1200,6 +1234,7 @@ static void aarch64_max_initfn(Object *obj) t = FIELD_DP64(t, ID_AA64PFR0, SVE, 1); t = FIELD_DP64(t, ID_AA64PFR0, SEL2, 1); /* FEAT_SEL2 */ t = FIELD_DP64(t, ID_AA64PFR0, DIT, 1); /* FEAT_DIT */ + t = FIELD_DP64(t, ID_AA64PFR0, RME, 1); /* FEAT_RME */ t = FIELD_DP64(t, ID_AA64PFR0, CSV2, 2); /* FEAT_CSV2_2 */ t = FIELD_DP64(t, ID_AA64PFR0, CSV3, 1); /* FEAT_CSV3 */ cpu->isar.id_aa64pfr0 = t; @@ -1300,6 +1335,8 @@ static void aarch64_max_initfn(Object *obj) object_property_add(obj, "sve-max-vq", "uint32", cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property); + object_property_add(obj, "l0gptsz", "uint32", cpu_max_get_l0gptsz, + cpu_max_set_l0gptsz, NULL, NULL); } static const ARMCPUInfo aarch64_cpus[] = {