From patchwork Mon Feb 6 22:34:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 650956 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2530565pva; Mon, 6 Feb 2023 14:36:47 -0800 (PST) X-Google-Smtp-Source: AK7set9tsJZKBPYDh+QvAYIUGxMF86MGcjF2R871oc6xpKU0dpVZHKn3R69ADfS498glzeDoZlkp X-Received: by 2002:a05:6214:5094:b0:567:d3cf:65a6 with SMTP id kk20-20020a056214509400b00567d3cf65a6mr1207925qvb.4.1675723007692; Mon, 06 Feb 2023 14:36:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675723007; cv=none; d=google.com; s=arc-20160816; b=e2R2wjJd5JMlwAJ4O07URZhrqlUJrXailxgZrOmOj9jjih5ae9s3AJVxLTKEOoIIrs Vjtp8gW+reR8jaLyxpZeksR0euleeh43+eKQKaTTbzYtz4U+ZoJdisNkEHD4jED2aJ1z g92pPjG+LCIxy4k8AurVhJHiBc2MB7lFZAwNuyg/hmkUnpaSfJN0kPQePqnq5CDUAUEb 2zA+VQ7Ae7S7qCfWYwrghXPkrVT+z2aAuzTPwGNtZh5wwGYPpIekZHmyBQdq7o00qGWp gYO1eSNcXSNyYdQPXPSZWppZlOjXfTryuwUD6v1OgPD0mH/umAIQ7EBLsNsSJaBDA/Ip 318g== 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=19uwBfdpAT1fRxylT2Hyf84R7eD4Io8guMa3+/7IF5E=; b=n31UjRNLuhq2U8h0XkFcmthx3WjDdsUjtBru1qihwBm1TB/gdfvvs0hvb7wqJ5v6tQ fxWxjC19Vst/Lxq2OQtTXF8CHmlYimNGGOO8ls6aHUtPHt32U7aTHu5xR5P8rcijDpx5 RFFBZ7oL5hcgVf75U35A62CT0LhBR95id6w+DyyQi5YFHTlfAGyXkGAw8/YoWZVVruFG Lbczlcl6j3+AgxUXvUEfls0Vsv4pZaD4WyBnLJL3qU3JmDpg3eJPn5lh8FzavL1TuQJo ehEzF7T/K3doo+eENjkvky9aUHM8WWIrkYjr+mHoxatFZeU4Rfq5HnWrALzloYFKAMCz y58w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CGJ8bxT2; 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 k13-20020a0cc78d000000b0053773334bbasi8546142qvj.360.2023.02.06.14.36.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Feb 2023 14:36:47 -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=CGJ8bxT2; 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 1pPA5K-0001op-UJ; Mon, 06 Feb 2023 17:35:38 -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 1pPA5B-0001kk-MD for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:31 -0500 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 1pPA5A-0004TC-6W for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:29 -0500 Received: by mail-wr1-x429.google.com with SMTP id j25so8350758wrc.4 for ; Mon, 06 Feb 2023 14:35:27 -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=19uwBfdpAT1fRxylT2Hyf84R7eD4Io8guMa3+/7IF5E=; b=CGJ8bxT2P13F5mXwid42JRnMFxipx7ovw7vNTLmbt+wq0xGlmfQ8fwqhsOY/s9PV28 hTbgFnbZytKVDxHEjC14d4u0bLZ56SrMQ5XmEPYACSMTqlqbzJiSzDcLGgZN1iTG5FOs Kemjol8J+ZOfuul+XIierj7z0DQmCiYmMSIg9eHOPIQSF71P0drCMGFNtEU1Z4nb4wFt z/eOSusBITbRaT9MTK/O+pq3miYOQ1sPOsobOqDLje+Xo604BgQiQwW0NvgiwaqTKtbG jTq9twDNIPiyVL098S1fELJtWXmBODyUsd1vMCoezRuaqEltOD6Q1FR3oLMoQfTLYCVV kRlQ== 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=19uwBfdpAT1fRxylT2Hyf84R7eD4Io8guMa3+/7IF5E=; b=tGRTTk7VT5oFA/+X5XIMj45/h7hnqI5VweS8rXM+/ou6eDQw5pn4STq7RV7KW4XGdT YEOJ0x31r6P6a7SIGrjhhpVLJWp6hiwWm4WSsJtReUPJmTZtpNKFBQ8d02gI57M2eVfl m4lr4UvsIgg/8BDyALAhHK9zaR9Y+jkY1wfndPJlQ47t9dCg6rZPkSoc/AuT5fRW/DPj Y0k6hYs+XPnO9GGapjteD7BUhvNIs2X4Jrg9DIv4qROpV2F6KdlCYMcykCUXyz4W0TK2 QH+S27Lqw7VhbR2SJKnLX3s+786KTVJKdljl2DYTLnGx0lHKujECJPqP4zLmj65o6QwZ MatA== X-Gm-Message-State: AO0yUKXgMOyp7N+heW2MXPhgvUA2JdEH0KAHjXVtItfvUU8NcSAgvRAG NL1zcv1ji+kz7POrrqKIkUaw/p5JuBJ1WQA6 X-Received: by 2002:adf:efce:0:b0:2c3:db9e:4afe with SMTP id i14-20020adfefce000000b002c3db9e4afemr384789wrp.60.1675722926561; Mon, 06 Feb 2023 14:35:26 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id e6-20020a5d6d06000000b002be099f78c0sm10224886wrq.69.2023.02.06.14.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 04/11] target/arm: Constify ID_PFR1 on user emulation Date: Mon, 6 Feb 2023 23:34:55 +0100 Message-Id: <20230206223502.25122-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index c62ed05c12..22670c20c0 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7021,6 +7021,7 @@ static void define_pmu_regs(ARMCPU *cpu) } } +#ifndef CONFIG_USER_ONLY /* * We don't know until after realize whether there's a GICv3 * attached, and that is what registers the gicv3 sysregs. @@ -7038,7 +7039,6 @@ static uint64_t id_pfr1_read(CPUARMState *env, const ARMCPRegInfo *ri) return pfr1; } -#ifndef CONFIG_USER_ONLY static uint64_t id_aa64pfr0_read(CPUARMState *env, const ARMCPRegInfo *ri) { ARMCPU *cpu = env_archcpu(env); @@ -7998,8 +7998,16 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 1, .access = PL1_R, .type = ARM_CP_NO_RAW, .accessfn = access_aa32_tid3, +#ifdef CONFIG_USER_ONLY + .type = ARM_CP_CONST, + .resetvalue = cpu->isar.id_pfr1, +#else + .type = ARM_CP_NO_RAW, + .accessfn = access_aa32_tid3, .readfn = id_pfr1_read, - .writefn = arm_cp_write_ignore }, + .writefn = arm_cp_write_ignore +#endif + }, { .name = "ID_DFR0", .state = ARM_CP_STATE_BOTH, .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 2, .access = PL1_R, .type = ARM_CP_CONST,