From nobody Wed Apr 16 02:30:46 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550171306813548.5363456857298; Thu, 14 Feb 2019 11:08:26 -0800 (PST) Received: from localhost ([127.0.0.1]:53528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guMMx-0000Tu-OG for importer@patchew.org; Thu, 14 Feb 2019 14:08:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guMKv-0007kR-Hk for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guMKu-0004hg-94 for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:17 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:37972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guMKu-0004gr-1q for qemu-devel@nongnu.org; Thu, 14 Feb 2019 14:06:16 -0500 Received: by mail-wm1-x32e.google.com with SMTP id v26so7192853wmh.3 for ; Thu, 14 Feb 2019 11:06:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n184sm7798471wmf.5.2019.02.14.11.06.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 11:06:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=wu8o6K6bGJE93plhMQqvd5UtFuzltGhLBZkX4kxwg8M=; b=xZOePMmrbBYYnK4JFn6eyHVN1tgNnjAVEZjf7K8FHCFejT5Suo6M9DqVU4jKxAvhtD ex4D0YbpmEt4iGqyHlBzW6Vr8GTNUIs3lOB+CJLHQk/d08WgtVVopUd3LjNJw5GK6cph ixP2DZZhSX9ACkgjirfty14/Xiigqa5vH3rJGfIlK6HXqQod0EsiwIbwr19HkyBVdCGY 0Kstwm/vnVEe65yKEp/bukZFwdisKXfNlLQiZc3PFjGfrknDD5tPuVoeJAK+km/nIt27 GZoNUAoWyjnY8MAyWrgScD7IQdSKxT2THzFuDu9tNCm7JHtwQYLfW0W6aZS7vZZRN47O r4NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wu8o6K6bGJE93plhMQqvd5UtFuzltGhLBZkX4kxwg8M=; b=Dz7OX20uw5KAtz7ML0szbdsTDTVkwQ/gpB7lHec5WyoO45DuLSTTksvGZWpiqExFFJ Ry8+yO7S60sPflCmJ09w70QiliCw778mDNmUb7V3mv5u1Fz4HmWaO157AEAXBwJI4kTu noGRU1uxCkO9/zknyZjLJZUzieYcQWShPMuCu8L7zv88mh6qzIEc6lj0OXVpdsDahBI9 LcvfJs+5i6KWjXwxarWdqg9BPUD6e5mb0nfPHIadJ9Kgcl55BGOhDKjbvMN5GBt3hvqv lZJMPbKid865pCFvE44yfcuCPCL8MnyI0GxZuKbTfk9Mp6yxIllhfRlmr0xFgIfojuYl RruA== X-Gm-Message-State: AHQUAuZkzxan1tFv1XNlkrnJIZzppP8+K5xPqhP9hkSMsYdvx5aX6YMs +oIO6930Ke+/Wb1931gCrQkPmBxVxrvbSQ== X-Google-Smtp-Source: AHgI3IZldtDTmYHwMshWLuvZ18i0vcNBBpObRdVoevkJ6iKGhLZ/0NLeCi4g/MahUpkCoOEvwi8Bfw== X-Received: by 2002:a1c:2d4c:: with SMTP id t73mr3835471wmt.142.1550171174706; Thu, 14 Feb 2019 11:06:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 19:05:44 +0000 Message-Id: <20190214190603.25030-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214190603.25030-1-peter.maydell@linaro.org> References: <20190214190603.25030-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e Subject: [Qemu-devel] [PULL 08/27] target/arm: expose MPIDR_EL1 to userspace X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Alex Benn=C3=A9e As this is a single register we could expose it with a simple ifdef but we use the existing modify_arm_cp_regs mechanism for consistency. Signed-off-by: Alex Benn=C3=A9e Message-id: 20190205190224.2198-4-alex.bennee@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/helper.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index b2abaf5b225..77c73056948 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -3657,13 +3657,6 @@ static uint64_t mpidr_read(CPUARMState *env, const A= RMCPRegInfo *ri) return mpidr_read_val(env); } =20 -static const ARMCPRegInfo mpidr_cp_reginfo[] =3D { - { .name =3D "MPIDR", .state =3D ARM_CP_STATE_BOTH, - .opc0 =3D 3, .crn =3D 0, .crm =3D 0, .opc1 =3D 0, .opc2 =3D 5, - .access =3D PL1_R, .readfn =3D mpidr_read, .type =3D ARM_CP_NO_RAW }, - REGINFO_SENTINEL -}; - static const ARMCPRegInfo lpae_cp_reginfo[] =3D { /* NOP AMAIR0/1 */ { .name =3D "AMAIR0", .state =3D ARM_CP_STATE_BOTH, @@ -6451,6 +6444,20 @@ void register_cp_regs_for_features(ARMCPU *cpu) } =20 if (arm_feature(env, ARM_FEATURE_MPIDR)) { + ARMCPRegInfo mpidr_cp_reginfo[] =3D { + { .name =3D "MPIDR_EL1", .state =3D ARM_CP_STATE_BOTH, + .opc0 =3D 3, .crn =3D 0, .crm =3D 0, .opc1 =3D 0, .opc2 =3D = 5, + .access =3D PL1_R, .readfn =3D mpidr_read, .type =3D ARM_CP_= NO_RAW }, + REGINFO_SENTINEL + }; +#ifdef CONFIG_USER_ONLY + ARMCPRegUserSpaceInfo mpidr_user_cp_reginfo[] =3D { + { .name =3D "MPIDR_EL1", + .fixed_bits =3D 0x0000000080000000 }, + REGUSERINFO_SENTINEL + }; + modify_arm_cp_regs(mpidr_cp_reginfo, mpidr_user_cp_reginfo); +#endif define_arm_cp_regs(cpu, mpidr_cp_reginfo); } =20 --=20 2.20.1