All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org,  qemu-devel@nongnu.org,  qemu-stable@nongnu.org
Subject: Re: [PATCH v3 5/9] target/arm: Refactor handling of timer offset for direct register accesses
Date: Wed, 26 Feb 2025 09:07:16 +0000	[thread overview]
Message-ID: <87cyf53whn.fsf@draig.linaro.org> (raw)
In-Reply-To: <20250204125009.2281315-6-peter.maydell@linaro.org> (Peter Maydell's message of "Tue, 4 Feb 2025 12:50:05 +0000")

Peter Maydell <peter.maydell@linaro.org> writes:

> When reading or writing the timer registers, sometimes we need to
> apply one of the timer offsets.  Specifically, this happens for
> direct reads of the counter registers CNTPCT_EL0 and CNTVCT_EL0 (and
> their self-synchronized variants CNTVCTSS_EL0 and CNTPCTSS_EL0).  It
> also applies for direct reads and writes of the CNT*_TVAL_EL*
> registers that provide the 32-bit downcounting view of each timer.
>
> We currently do this with duplicated code in gt_tval_read() and
> gt_tval_write() and a special-case in gt_virt_cnt_read() and
> gt_cnt_read().  Refactor this so that we handle it all in a single
> function gt_direct_access_timer_offset(), to parallel how we handle
> the offset for indirect accesses.
>
> The call in the WFIT helper previously to gt_virt_cnt_offset() is
> now to gt_direct_access_timer_offset(); this is the correct
> behaviour, but it's not immediately obvious that it shouldn't be
> considered an indirect access, so we add an explanatory comment.
>
> This commit should make no behavioural changes.
>
> (Cc to stable because the following bugfix commit will
> depend on this one.)
>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

  reply	other threads:[~2025-02-26  9:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 12:50 [PATCH v3 0/9] target/arm: Implement SEL2 physical and virtual timers Peter Maydell
2025-02-04 12:50 ` [PATCH v3 1/9] target/arm: Apply correct timer offset when calculating deadlines Peter Maydell
2025-02-26  9:04   ` Alex Bennée
2025-02-04 12:50 ` [PATCH v3 2/9] target/arm: Don't apply CNTVOFF_EL2 for EL2_VIRT timer Peter Maydell
2025-02-26  9:05   ` Alex Bennée
2025-02-04 12:50 ` [PATCH v3 3/9] target/arm: Make CNTPS_* UNDEF from Secure EL1 when Secure EL2 is enabled Peter Maydell
2025-02-21 18:02   ` Alex Bennée
2025-02-21 18:25     ` Peter Maydell
2025-02-04 12:50 ` [PATCH v3 4/9] target/arm: Always apply CNTVOFF_EL2 for CNTV_TVAL_EL02 accesses Peter Maydell
2025-02-26  9:06   ` Alex Bennée
2025-02-04 12:50 ` [PATCH v3 5/9] target/arm: Refactor handling of timer offset for direct register accesses Peter Maydell
2025-02-26  9:07   ` Alex Bennée [this message]
2025-02-04 12:50 ` [PATCH v3 6/9] target/arm: Implement SEL2 physical and virtual timers Peter Maydell
2025-02-04 12:50 ` [PATCH v3 7/9] target/arm: document the architectural names of our GTIMERs Peter Maydell
2025-02-04 12:50 ` [PATCH v3 8/9] hw/arm: enable secure EL2 timers for virt machine Peter Maydell
2025-02-04 12:50 ` [PATCH v3 9/9] hw/arm: enable secure EL2 timers for sbsa machine Peter Maydell
2025-02-21 11:06 ` [PATCH v3 0/9] target/arm: Implement SEL2 physical and virtual timers Peter Maydell
2025-03-09  5:24 ` Michael Tokarev
2025-03-09 12:05   ` Alex Bennée

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=87cyf53whn.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.