From patchwork Wed Feb 22 02:33:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655677 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp457014wrb; Tue, 21 Feb 2023 18:38:22 -0800 (PST) X-Google-Smtp-Source: AK7set8WY9533Cqb6AbF1+UmuFCbL3/ze7oJ40wNqiBJWjYqqmwMkcbFLSLhEjgQUk5WR9fFuq1w X-Received: by 2002:ad4:5bc5:0:b0:56e:a6f1:8db with SMTP id t5-20020ad45bc5000000b0056ea6f108dbmr10016504qvt.20.1677033501971; Tue, 21 Feb 2023 18:38:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677033501; cv=none; d=google.com; s=arc-20160816; b=ESjROLXqOSVUbgzJ14pGg0Bak+mMkWcAq/QCpAEawPaQep1ESIc67IDvZUOTt/7pHk w3xz883NzR7wZWDD/ZKHsqfjWq7dwUliM0/aQ0E34TiyjQPiVCgFTtej/nXGz5WQX/Vc e7JWNxZmrnkaAOMc9kVIlVcC8V5aEiDGBqwLJrNmmFc8jdjnlqZsFETqmgEvU8/H5y6R JZnVLded8zCUlFke2VXuMDaNkBwlwk9t9SfG33/prPVoBO3UD0ILf0V7M9MQuZ95rCdy pkEMMAXo1pQEJISoIeqYm6z7/JPUFAU3w9l8uGvi49mcRLUJGTcHGc5ne8JwHpSnWY+I ZvyQ== 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=/Ut/aS2oezKic9UZ9DAK+e9x8VNxmPUkA0viJdZ3AGc=; b=yP9dl/vi0B1iExjL00nrFkE62xxuduoZPfZElO9t+ZvdIY88qXrak06QFTbOp7DtU6 7YgmauAC7rb3KbSwB/K+1r28HK8b9SOpUbX8PVMexysWbgWGtVtc5QvPv+59JM0gGRFQ g825qtym5fLncihnoLzGs0jxZdkv6imjUHYxvs5WVP9W+LOWcfk4KszmaLEHDx7uBIQC +RQ6H0/QDF01CLfJUh9gcLhHMecOBNr8GQYSZJwXdmo3E7EIn03FOlfSk7yw1FBdEItc zoM/eOPo0NEJ+yu6vqIfn3bNX3d5MMDm+ChzUZyBgAimze/Cp/f+D7GB2zC3k5K2wutr Z+aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="D/KwGTIS"; 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 bp15-20020a05620a458f00b006fa57ff8d78si14396748qkb.67.2023.02.21.18.38.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 18:38:21 -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="D/KwGTIS"; 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 1pUexX-0007jo-48; Tue, 21 Feb 2023 21:34:19 -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 1pUexU-0007hU-1Z for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:34:16 -0500 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUexS-0001kY-Ep for qemu-devel@nongnu.org; Tue, 21 Feb 2023 21:34:15 -0500 Received: by mail-pj1-x1041.google.com with SMTP id i1-20020a17090ad34100b00234463de251so6994226pjx.3 for ; Tue, 21 Feb 2023 18:34:14 -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=/Ut/aS2oezKic9UZ9DAK+e9x8VNxmPUkA0viJdZ3AGc=; b=D/KwGTISZqqO7gR78XhTb4eOCbAoyguUE3dZK/gmYFTyFmSaupf90u95syivnLb8Qa i7+I1UIujJRs0ruYu5ovbgPTXGU4WPDBp7hRxO8AbRhXoWJliZmpt75ZgXtc1z6vm93J ouhqxE7VVpbzc9Xdbjpc8Aj/KNgWx8hKUWW8sn0J+vzbGpe2pUDR6eWGOC8N5/wYfTjr 6v5VLNvSpHhfPhXvo02DsWLUwkrt+AU1Q+/+Y9ChSI/JbWu/sSJzM3U7hpjOqBAcGWLl DcrrH3+UB3EQTCKmOM3CfvshNWGraEQv/7+7F89z3kzjhn8zqZHHE1LtCmhwslGmhZHF LceA== 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=/Ut/aS2oezKic9UZ9DAK+e9x8VNxmPUkA0viJdZ3AGc=; b=NyhDfbPx3UoploZLgGoC4JOrUbWgWK96VFErsxU714ki1LOVgZ7YtMPObMLDpOFuok UZ25h15fAV5j2xCCiFjQ0wsfT1C2OmGw4Stw7JdqbzMaXtVgh2qsOPcxfsZfVtjOGYUL JotGRWL2X7EFHVuOyaJz2iquLqipForvmkrWqS0AvoQnC7ZHopm5AzSwsEtO7ppw9jek UX9q8G18OXMNaj+Exmkwi4+164xtKJ0UTWbnNC0z+2pSOg7iAymWH/xaRE1khJXm3hX3 pvnMG6tWoZer4io0160S6+TnLngdYLVfh7BLpQQJRkeX546wsM5uOhqZ63C1blxpH7aL +fIw== X-Gm-Message-State: AO0yUKVww8wx31M48Cj12KhuxPaT2oTjam0ZC85UzZXBYBfqlOHO1WXq a1IQFDq2+QMkMYLJj2VufO4WJGqdUsHtHRNoFuNplw== X-Received: by 2002:a17:902:e545:b0:198:ec2c:d4e6 with SMTP id n5-20020a170902e54500b00198ec2cd4e6mr9378851plf.38.1677033252978; Tue, 21 Feb 2023 18:34:12 -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 k3-20020a170902e90300b00198fde9178csm10520112pld.197.2023.02.21.18.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 18:34:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH NOTFORMERGE v3 24/25] target/arm: Enable RME for -cpu max Date: Tue, 21 Feb 2023 16:33:35 -1000 Message-Id: <20230222023336.915045-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222023336.915045-1-richard.henderson@linaro.org> References: <20230222023336.915045-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1041.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+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 4066950da1..70c173ee3d 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; @@ -1301,6 +1336,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[] = {