From patchwork Fri Aug 19 11:00:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 598496 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp1303472mae; Fri, 19 Aug 2022 04:20:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qol2B7k1oiET6ON9tspJ35s6sZ8Do/y+KlKF9rK3Sn/3H6iiSasBArxnbR0FWy477VRno X-Received: by 2002:ad4:5e8a:0:b0:496:b694:9ca7 with SMTP id jl10-20020ad45e8a000000b00496b6949ca7mr5917455qvb.80.1660908001958; Fri, 19 Aug 2022 04:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660908001; cv=none; d=google.com; s=arc-20160816; b=CzAwMKgtmVJmxjEN44wdrM5gtZrgJZGApmN8OW7Y6b1KlRolChQngLQD+r13rrEZFj v/djI7pV0jlU73bVy+WnO2q9hoCsZi+6qMjU5Demj6XW+CQPhdLBgpHugzObR9pAtC/C nCCNtPRhKWU2yHlkpAij9mnY0N98bzu6txi+BEE/j9GHmn1n3E7o46NlrvG1iC21YD2E k4rhYJGg66tAgKKNn4aBms9NtntfwePJUlleuP59fHaFfW5GGxmygqb6xX5XH0VitXai +sOx4xo9TYYcqX1wqb1b6K+kpBf8KWbWaI7CYfDj994r1k9f3sE9nAXAt9MoxZrybOXm NiPQ== 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:to:from :dkim-signature; bh=rlB3te70E8fDcNZgIxgUZkmq5hKy8dXzvxbhDulIQgc=; b=J4cgCuEXnLhxcmph7WZkN1+UWV6bVZKae+IoszcQ87YUF5WkxTEPgQmOQprpLYzDIb elVsyRtf9NZ2NMjMTvM61N8wz9j+CwlyiKoye2NoX4+vwguUuYe7O+/wmUYkUbTUz/Us Nk9RKNiATTe8ZCUuFjwSRCbmFO+5O813V2vZjKRblTD99ci0Jo6hGkRJaEzIWWnaZHGN T2ShpGyWFxQLPOUXFHVgs+Ev79mt6fYlX89GspoEi8qHgl8OGGpMz3gc4udaphcE0FMT FFBZJ1OzSwRxGKUTzCTwrdZ+C8jdvZhXZ4bNLZdSyQM3075uJzzdNFZMei2y/0hWckQo Zhig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jQwwI7Zs; 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 dm4-20020a05620a1d4400b006b91dcc5fc4si2217768qkb.29.2022.08.19.04.20.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Aug 2022 04:20:01 -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=jQwwI7Zs; 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]:34236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oP02j-00055Y-Iv for patch@linaro.org; Fri, 19 Aug 2022 07:20:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOzkO-0002DE-I0 for qemu-devel@nongnu.org; Fri, 19 Aug 2022 07:01:07 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:46733) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOzkH-0001QW-Vl for qemu-devel@nongnu.org; Fri, 19 Aug 2022 07:01:03 -0400 Received: by mail-wm1-x336.google.com with SMTP id k6-20020a05600c1c8600b003a54ecc62f6so2299140wms.5 for ; Fri, 19 Aug 2022 04:00:57 -0700 (PDT) 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:to:from:from:to:cc; bh=rlB3te70E8fDcNZgIxgUZkmq5hKy8dXzvxbhDulIQgc=; b=jQwwI7ZsZYyohUGFe1oyhFvha5d7NUCU+ZFyNS549L2JAmwiV7YsSs4LfHPNdE5hpt Gy/QsVKdxnwpdPvpxdxJlzfF667tP6HKwPaNwq4xCuggnWA3mfv1A1bRTOXDHY/m0vAJ sM2GzR0aEeROPjIOG3ipdTDeO7WxJyFrNLsXIQsU6kO9dFcKUiXsr7ic7rZszHh7z3d/ drM+NbY1r6EX/Xs/0iHgAx0aEtC20fUyG3PijnCMi8xMp8ZoM6TD0EOCDKG/6+lR05Od Li1k53zTJ6CR4BbQqaUlRpuLCKRKFG6sZhEYz2uWK7eH135LzGI33FjrUefeFRrjiTir 6TbQ== 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:to:from:x-gm-message-state:from:to:cc; bh=rlB3te70E8fDcNZgIxgUZkmq5hKy8dXzvxbhDulIQgc=; b=x8ZHIco+Kl+23nuA7BjQBlmVem0MMC7iw+lA0Pe7zLuj32UqQKASbqNEAFKPMKSKxg Be69RWyBhcGM23NV1kv7/t6SHeMO1dvXS8aRJ6B+5wMyWlaW1nm9mibCG2IB6dGoZ/zX wo16UpCf6XNRvjBflEk10pk9AQavxigLOPSM8BpE7vb7XzKq79BEQNIqTJXMTZ39isjB MEmzwLeuuGLfdRFOw5wDoez7Y8YA9X05balYRKIZuZXdWvZnDocq6/on+7V3XZJvrKHH +FV8AK8/zwEZihwwb3WqY4Dmp31a2fmcq+1B2NCv5kAAkfYs8/ScHLnqVrtDCKr+Dc2u i1+g== X-Gm-Message-State: ACgBeo0UapYqdPVCPubTosaPzT7zGQW34fGW0YnonoUACKv/QAxdjKHD tN8LSGgp7kYcRAaA35Fx9hIbfAD8ABicYQ== X-Received: by 2002:a1c:f317:0:b0:3a5:e38f:46b with SMTP id q23-20020a1cf317000000b003a5e38f046bmr4357252wmq.98.1660906856620; Fri, 19 Aug 2022 04:00:56 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p22-20020a7bcc96000000b003a52969e89csm8154985wma.4.2022.08.19.04.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 04:00:56 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/6] target/arm: Implement ID_MMFR5 Date: Fri, 19 Aug 2022 12:00:49 +0100 Message-Id: <20220819110052.2942289-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819110052.2942289-1-peter.maydell@linaro.org> References: <20220819110052.2942289-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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=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" In Armv8.6 a new AArch32 ID register ID_MMFR5 is defined. Implement this; we want to be able to use it to report to the guest that we implement FEAT_ETS. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/cpu.h | 1 + target/arm/helper.c | 4 ++-- target/arm/kvm64.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 5168e3d837e..fcc5927587e 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -975,6 +975,7 @@ struct ArchCPU { uint32_t id_mmfr2; uint32_t id_mmfr3; uint32_t id_mmfr4; + uint32_t id_mmfr5; uint32_t id_pfr0; uint32_t id_pfr1; uint32_t id_pfr2; diff --git a/target/arm/helper.c b/target/arm/helper.c index c171770b035..07378519259 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7586,11 +7586,11 @@ void register_cp_regs_for_features(ARMCPU *cpu) .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, .resetvalue = 0 }, - { .name = "RES_0_C0_C3_6", .state = ARM_CP_STATE_BOTH, + { .name = "ID_MMFR5", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 6, .access = PL1_R, .type = ARM_CP_CONST, .accessfn = access_aa64_tid3, - .resetvalue = 0 }, + .resetvalue = cpu->isar.id_mmfr5 }, { .name = "RES_0_C0_C3_7", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 7, .access = PL1_R, .type = ARM_CP_CONST, diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 84c4c85f405..2d737c443eb 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -643,6 +643,8 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) ARM64_SYS_REG(3, 0, 0, 3, 2)); err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_pfr2, ARM64_SYS_REG(3, 0, 0, 3, 4)); + err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_mmfr5, + ARM64_SYS_REG(3, 0, 0, 3, 6)); /* * DBGDIDR is a bit complicated because the kernel doesn't