From patchwork Mon Feb 6 12:17:07 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: 650935 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2238056pva; Mon, 6 Feb 2023 04:18:03 -0800 (PST) X-Google-Smtp-Source: AK7set8MM9Aw0SPCD/iim3bXkvKwNZ/uXbPT/Q5u/OPHuX97FlUCZqIBU09pWfN8AwkfGkO6dRoj X-Received: by 2002:ac8:5750:0:b0:3b8:6b23:4fc1 with SMTP id 16-20020ac85750000000b003b86b234fc1mr36555216qtx.2.1675685883829; Mon, 06 Feb 2023 04:18:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675685883; cv=none; d=google.com; s=arc-20160816; b=rU92ZMixZMuIfNBLMjQWzuLNIvwc2XIyPG6ci/VITRfINXtEXXI3UdCZYuFnm/g+gn FJtJY0TTbGGkV/AuLjMf/rj2zDQrVQVFDMWjsEw7hZkzVF440muF5XUt4/TteG0oLWNR 1crw33VYZiqv3dj98UQvNqNV8aFj+gwKgz0DD5v9bhFFpANNSERXSDJorzGvEAbK7Yqw rAm5VTOCrEcnMnwmgnUxO140T0ZF0oXwDmAZkfc/u3ddBYbpLdWjJORxb04H0+lJdO7e 42ltqFIURF7rKtXOKingUEMw70yfCTbv8fHotUSFAvE2PDdloTKgWb8F7YnClvOW2HUP DUuw== 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=cnLR1uIdaRx63uyaDPgEE9PMokr2C9C9/vY4stomlB8=; b=U0FWMgZRPdSZ9DF+25SmeBpFX3toX8f5KG/z79xoyxywuGjZxvNEtq2RCYFjoN0IRg c/5A2JPHaAHf11xf1wm7gQj0xQIzHFQXXBYmes9a4wo3YuazuNL5TJUT5hf5JsEXhhqV vfj3xjQTWOYPLC141mC2ZXi/Wg33au1rv40YAlMUMblBVQxQ9J595VBvVqKd2BvXDC/T ylaz67QIPcYBIlK6VfTcYWeUN89mLV2rl7V/v6yKYCJtocqosVwbLxjj5XucxHtboltO TRpns6+Y4Ys3Pr+U4/e1PnbGK19fIpEisRxUVUBtRXSgAg5PT3ZazRVf90g52cK4nhFx Vxbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pCIc1SWu; 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 p19-20020a05622a00d300b003b9bc411938si8531863qtw.422.2023.02.06.04.18.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Feb 2023 04:18:03 -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=pCIc1SWu; 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 1pP0RF-0007cv-C9; Mon, 06 Feb 2023 07:17:37 -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 1pP0RC-0007c2-LM for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:34 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0R6-0005nn-Q2 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:31 -0500 Received: by mail-wm1-x332.google.com with SMTP id o36so8532014wms.1 for ; Mon, 06 Feb 2023 04:17: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=cnLR1uIdaRx63uyaDPgEE9PMokr2C9C9/vY4stomlB8=; b=pCIc1SWuqEqCCrureSTt61msuerP/ylniPzZ4d74S7kpjWDtNaay9Czimws319Fx5h ykMXm40WA3ywED/ohntCF2H8P0hs1LDfCyUDb3AHOa5OocIyQfeFBeTH6ivzgPxRw4v+ iFf5VIKxVXjxMgkse1xVbNmwHRfQenTLzjOxnbXj2sdclXKJ7Zfg+/ICYkgQKkhTdgxo gz4C2J0Mk0ygVmc0He3rNJnBP6dvKtJgFPS928KFt9YOyoKb6ODJdzyGw4dDs06EwU3A 02vqBtsrNUqoenShWpwZGFKVQQlahFsR3QaLtITvC45O0/MBMvKjg6Vu3ja+HMt5x0Q8 +F0A== 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=cnLR1uIdaRx63uyaDPgEE9PMokr2C9C9/vY4stomlB8=; b=U3jxk8xZ/V4AvjNxIRzZ5uzeOr7P8LfBqXCcIxsVLOWENj+Ds8/uuNDunnFdYFQsvC NEuo52uHCXIEb8kZEO+kR+zK4d1lgHwsy7tkPNk2ntk2cTXtQo5xlcvNr/bJNQM1MNJe h1xt6TgSAJok2jSQ17VDP79kmkqSCiJb6bTsJUJYSllPy769A2+OPTdo9kltv6eTcmf/ rIdh3WyZBfJU7EXEAGvFSPC/XcjzCNinKe+gfsEk3O9rNe8Kg/ai3pnQSpfRtSP/tm8L 7cSLiFOQ6c0dQSkb9HnmBSmDwfbLv+NjqgvC8YNJ3giRE8zRmLcuA51wWJO0aHzhYxqV r7/Q== X-Gm-Message-State: AO0yUKWahQIS+1Dt3hke7jERHg7ZZyyKvOPZxjn4xRU0u/rTHmEobRIk 3C5y6AViLVeVY0PIFJ0gT0vCI9DcwVI8WHKi X-Received: by 2002:a05:600c:3795:b0:3c6:e61e:ae71 with SMTP id o21-20020a05600c379500b003c6e61eae71mr21104626wmr.1.1675685847107; Mon, 06 Feb 2023 04:17:27 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id 14-20020a05600c228e00b003dd9232f036sm12708711wmf.23.2023.02.06.04.17.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/9] target/arm: Constify ID_PFR1 on user emulation Date: Mon, 6 Feb 2023 13:17:07 +0100 Message-Id: <20230206121714.85084-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- 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 5dbeade787..b58800a1a5 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,