From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Eric Auger <eric.auger@redhat.com>,
Aaron Lindsay <aaron@os.amperecomputing.com>
Subject: Re: [PATCH 05/13] target/arm: Add and use FIELD definitions for ID_AA64DFR0_EL1
Date: Wed, 12 Feb 2020 07:44:46 +0100 [thread overview]
Message-ID: <b4390a82-2780-c639-ada3-6d317a7558aa@redhat.com> (raw)
In-Reply-To: <6a75d967-513d-93ef-b983-b8a35f78c2bf@linaro.org>
On 2/11/20 7:34 PM, Richard Henderson wrote:
> On 2/11/20 9:37 AM, Peter Maydell wrote:
>> if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
>> - assert(extract32(cpu->id_aa64dfr0, 12, 4) == brps);
>> - assert(extract32(cpu->id_aa64dfr0, 20, 4) == wrps);
>> - assert(extract32(cpu->id_aa64dfr0, 28, 4) == ctx_cmps);
>> + assert(FIELD_EX32(cpu->id_aa64dfr0, ID_AA64DFR0, BRPS) == brps);
>> + assert(FIELD_EX32(cpu->id_aa64dfr0, ID_AA64DFR0, WRPS) == wrps);
>> + assert(FIELD_EX32(cpu->id_aa64dfr0, ID_AA64DFR0, CTX_CMPS) == ctx_cmps);
>
> Should really be FIELD_EX64. Otherwise,
Similarly to the other previous call, FIELD_DP64:
cpu->id_aa64dfr0 = FIELD_DP32(cpu->id_aa64dfr0, ID_AA64DFR0,
PMUVER, 0);
So far the code is safe because the >31 bits macros aren't used:
FIELD(ID_AA64DFR0, PMSVER, 32, 4)
FIELD(ID_AA64DFR0, DOUBLELOCK, 36, 4)
FIELD(ID_AA64DFR0, TRACEFILT, 40, 4)
But you are right, let's fix it now to avoid copy/pasting 32bit macros
and unpleasant debugging sessions.
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Using 64bit macros:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
next prev parent reply other threads:[~2020-02-12 6:45 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 17:37 [PATCH 00/13] arm: Implement ARMv8.1-PMU and ARMv8.4-PMU Peter Maydell
2020-02-11 17:37 ` [PATCH 01/13] target/arm: Add _aa32_ to isar_feature functions testing 32-bit ID registers Peter Maydell
2020-02-11 18:25 ` Richard Henderson
2020-02-12 6:23 ` Philippe Mathieu-Daudé
2020-02-11 17:37 ` [PATCH 02/13] target/arm: Add isar_feature_any_fp16 and document naming/usage conventions Peter Maydell
2020-02-11 18:28 ` Richard Henderson
2020-02-12 6:24 ` Philippe Mathieu-Daudé
2020-02-12 11:32 ` Peter Maydell
2020-02-11 17:37 ` [PATCH 03/13] target/arm: Define and use any_predinv isar_feature test Peter Maydell
2020-02-11 18:29 ` Richard Henderson
2020-02-12 6:24 ` Philippe Mathieu-Daudé
2020-02-11 17:37 ` [PATCH 04/13] target/arm: Factor out PMU register definitions Peter Maydell
2020-02-11 18:30 ` Richard Henderson
2020-02-12 6:40 ` Philippe Mathieu-Daudé
2020-02-11 17:37 ` [PATCH 05/13] target/arm: Add and use FIELD definitions for ID_AA64DFR0_EL1 Peter Maydell
2020-02-11 18:34 ` Richard Henderson
2020-02-12 6:44 ` Philippe Mathieu-Daudé [this message]
2020-02-11 17:37 ` [PATCH 06/13] target/arm: Use FIELD macros for clearing ID_DFR0 PERFMON field Peter Maydell
2020-02-11 18:34 ` Richard Henderson
2020-02-12 6:48 ` Philippe Mathieu-Daudé
2020-02-11 17:37 ` [PATCH 07/13] target/arm: Define an aa32_pmu_8_1 isar feature test function Peter Maydell
2020-02-11 18:38 ` Richard Henderson
2020-02-11 17:37 ` [PATCH 08/13] target/arm: Add _aa64_ and _any_ versions of pmu_8_1 isar checks Peter Maydell
2020-02-11 18:40 ` Richard Henderson
2020-02-12 6:56 ` Philippe Mathieu-Daudé
2020-02-11 17:37 ` [PATCH 09/13] target/arm: Implement ARMv8.1-PMU extension Peter Maydell
2020-02-11 18:45 ` Richard Henderson
2020-02-11 17:37 ` [PATCH 10/13] target/arm: Implement ARMv8.4-PMU extension Peter Maydell
2020-02-11 18:49 ` Richard Henderson
2020-02-11 17:37 ` [PATCH 11/13] target/arm: Provide ARMv8.4-PMU in '-cpu max' Peter Maydell
2020-02-11 18:50 ` Richard Henderson
2020-02-11 17:37 ` [PATCH 12/13] target/arm: Correct definition of PMCRDP Peter Maydell
2020-02-11 18:52 ` Richard Henderson
2020-02-12 7:00 ` Philippe Mathieu-Daudé
2020-02-11 17:37 ` [PATCH 13/13] target/arm: Correct handling of PMCR_EL0.LC bit Peter Maydell
2020-02-11 18:55 ` Richard Henderson
2020-02-12 7:14 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4390a82-2780-c639-ada3-6d317a7558aa@redhat.com \
--to=philmd@redhat.com \
--cc=aaron@os.amperecomputing.com \
--cc=eric.auger@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).