qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [RFC PATCH 4/4] hw/timer: convert mptimer access to attrs to derive cpu index
Date: Thu, 15 Sep 2022 09:17:36 +0100	[thread overview]
Message-ID: <91b4f280-abab-1227-35e7-7d3189f14cbf@linaro.org> (raw)
In-Reply-To: <20220914160955.812151-5-alex.bennee@linaro.org>

On 9/14/22 17:09, Alex Bennée wrote:
> This removes the hacks to deal with empty current_cpu.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   hw/timer/arm_mptimer.c | 25 ++++++++++++++-----------
>   1 file changed, 14 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c
> index cdfca3000b..a7fe6ddc0d 100644
> --- a/hw/timer/arm_mptimer.c
> +++ b/hw/timer/arm_mptimer.c
> @@ -41,9 +41,10 @@
>    * which is used in both the ARM11MPCore and Cortex-A9MP.
>    */
>   
> -static inline int get_current_cpu(ARMMPTimerState *s)
> +static inline int get_current_cpu(ARMMPTimerState *s, MemTxAttrs attrs)
>   {
> -    int cpu_id = current_cpu ? current_cpu->cpu_index : 0;
> +    int cpu_id = attrs.requester_id;
> +    g_assert(attrs.requester_cpu == 1);

Again, drop the "== 1".

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


      reply	other threads:[~2022-09-15  8:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 16:09 [RFC PATCH 0/4] use MemTxAttrs to signal cpu index Alex Bennée
2022-09-14 16:09 ` [RFC PATCH 1/4] hw: encode accessing CPU index in MemTxAttrs Alex Bennée
2022-09-15  8:05   ` Richard Henderson
2022-09-16 15:19   ` Peter Maydell
2022-09-14 16:09 ` [RFC PATCH 2/4] qtest: make read/write operation appear to be from CPU Alex Bennée
2022-09-15  8:08   ` Richard Henderson
2022-09-16 14:40     ` Philippe Mathieu-Daudé via
2022-09-14 16:09 ` [RFC PATCH 3/4] hw/intc/gic: use MxTxAttrs to divine accessing CPU Alex Bennée
2022-09-15  8:16   ` Richard Henderson
2022-09-16 14:49     ` Philippe Mathieu-Daudé via
2022-09-16 15:28       ` Alex Bennée
2022-09-17  8:33         ` Richard Henderson
2022-09-14 16:09 ` [RFC PATCH 4/4] hw/timer: convert mptimer access to attrs to derive cpu index Alex Bennée
2022-09-15  8:17   ` Richard Henderson [this message]

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=91b4f280-abab-1227-35e7-7d3189f14cbf@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@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).