qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 5/5] target/arm: Correctly implement Feat_DoubleLock
Date: Sat, 2 Jul 2022 19:49:11 +0530	[thread overview]
Message-ID: <d717bccb-09d1-99e5-f15b-fdecb2b224f6@linaro.org> (raw)
In-Reply-To: <20220630194116.3438513-6-peter.maydell@linaro.org>

On 7/1/22 01:11, Peter Maydell wrote:
> +static inline bool isar_feature_any_doublelock(const ARMISARegisters *id)
> +{
> +    /*
> +     * We can't just OR together the aa32 and aa64 checks, because
> +     * if there is no AArch64 support the aa64 function will default
> +     * to returning true for a zero id_aa64dfr0.
> +     * We use "is id_aa64pfr0 non-zero" as a proxy for "do we have
> +     * the AArch64 ID register values in id", because it's always the
> +     * case that ID_AA64PFR0_EL1.EL0 at least will be non-zero.
> +     */
> +    if (id->id_aa64pfr0) {
> +        return isar_feature_aa64_doublelock(id);
> +    }
> +    return isar_feature_aa32_doublelock(id);
> +}

If you're going to rely on this, you need to clear this register for -cpu aarch64=off. 
It's probably easier to drop this function...

> +static void osdlr_write(CPUARMState *env, const ARMCPRegInfo *ri,
> +                        uint64_t value)
> +{
> +    /*
> +     * Only defined bit is bit 0 (DLK); if Feat_DoubleLock is not
> +     * implemented this is RAZ/WI.
> +     */
> +    if (cpu_isar_feature(any_doublelock, env_archcpu(env))) {

... and use

     if (arm_feature(env, ARM_FEATURE_AARCH64)
         ? cpu_isar_feature(aa64_doublelock, cpu)
         : cpu_isar_feature(aa32_doublelock, cpu)) {

since it's just used once.


r~


  reply	other threads:[~2022-07-02 14:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 19:41 [PATCH 0/5] target/arm: Implement (or don't) OS Lock and DoubleLock properly Peter Maydell
2022-06-30 19:41 ` [PATCH 1/5] target/arm: Fix code style issues in debug helper functions Peter Maydell
2022-07-02 13:47   ` Richard Henderson
2022-06-30 19:41 ` [PATCH 2/5] target/arm: Move define_debug_regs() to debug_helper.c Peter Maydell
2022-07-02 13:57   ` Richard Henderson
2022-06-30 19:41 ` [PATCH 3/5] target/arm: Suppress debug exceptions when OS Lock set Peter Maydell
2022-07-02 14:00   ` Richard Henderson
2022-06-30 19:41 ` [PATCH 4/5] target/arm: Implement AArch32 DBGDEVID, DBGDEVID1, DBGDEVID2 Peter Maydell
2022-07-02 14:06   ` Richard Henderson
2022-06-30 19:41 ` [PATCH 5/5] target/arm: Correctly implement Feat_DoubleLock Peter Maydell
2022-07-02 14:19   ` Richard Henderson [this message]
2022-07-03  8:57     ` Peter Maydell
2022-07-03  9:01       ` Richard Henderson
2022-07-05 15:36     ` Peter Maydell
2022-07-05 17:16       ` Richard Henderson

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=d717bccb-09d1-99e5-f15b-fdecb2b224f6@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@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).