From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-arm@nongnu.org
Subject: Re: [PATCH] target/arm: Replace magic GIC values by proper definitions
Date: Thu, 25 Sep 2025 12:19:45 -0700 [thread overview]
Message-ID: <922f7912-7255-4a36-a5f7-669dffc964e8@linaro.org> (raw)
In-Reply-To: <20250925032151.73250-1-philmd@linaro.org>
On 9/24/25 20:21, Philippe Mathieu-Daudé wrote:
> Prefer the FIELD_DP64() macro and self-describing GIC
> definitions over magic values.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/arm/helper.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index c44294711f8..da8aa7b9d08 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -5184,7 +5184,7 @@ static uint64_t id_pfr1_read(CPUARMState *env, const ARMCPRegInfo *ri)
> uint64_t pfr1 = GET_IDREG(&cpu->isar, ID_PFR1);
>
> if (env->gicv3state) {
> - pfr1 |= 1 << 28;
> + pfr1 = FIELD_DP64(pfr1, ID_PFR1, GIC, 1);
> }
> return pfr1;
> }
> @@ -5195,7 +5195,7 @@ static uint64_t id_aa64pfr0_read(CPUARMState *env, const ARMCPRegInfo *ri)
> uint64_t pfr0 = GET_IDREG(&cpu->isar, ID_AA64PFR0);
>
> if (env->gicv3state) {
> - pfr0 |= 1 << 24;
> + pfr0 = FIELD_DP64(pfr0, ID_AA64PFR0, GIC, 1);
> }
> return pfr0;
> }
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
next prev parent reply other threads:[~2025-09-25 19:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-25 3:21 [PATCH] target/arm: Replace magic GIC values by proper definitions Philippe Mathieu-Daudé
2025-09-25 19:19 ` Richard Henderson [this message]
2025-09-26 10:06 ` Peter Maydell
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=922f7912-7255-4a36-a5f7-669dffc964e8@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).