qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Robert Foley <robert.foley@linaro.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	"open list:ARM TCG CPUs" <qemu-arm@nongnu.org>,
	alex.bennee@linaro.org, pbonzini@redhat.com,
	peter.puhov@linaro.org
Subject: Re: [PATCH v2 2/7] target/arm: add ARMCPUClass->do_interrupt_locked
Date: Mon, 31 Aug 2020 15:02:25 -0700	[thread overview]
Message-ID: <e324f958-8c9e-ebe1-e624-7eec610fe5aa@linaro.org> (raw)
In-Reply-To: <439e8b14-adc1-b7ea-edaa-d11069863007@linaro.org>

On 8/31/20 2:18 PM, Richard Henderson wrote:
> On 8/19/20 11:28 AM, Robert Foley wrote:
>> Adding ->do_interrupt_locked to ARMCPUClass is preparation for
>> pushing the BQL down into the per-arch implementation of ->do_interrupt.
>>
>> This is needed since ARM's *_cpu_exec_interrupt calls to *_do_interrupt.
>> With the push down of the BQL into *_cpu_exec_interrupt and
>> *_do_interrupt, *_cpu_exec_interrupt will call to ->do_interrupt
>> with lock held.  Since ->do_interrupt also has the lock, we need a way
>> to allow cpu_exec_interrupt to call do_interrupt with lock held.
>> This patch solves this issue of *_cpu_exec_interrupt needing
>> to call do_interrupt with lock held.
>>
>> This patch is part of a series of transitions to move the
>> BQL down into the do_interrupt per arch functions.  This set of
>> transitions is needed to maintain bisectability.
>>
>> This approach was suggested by Paolo Bonzini.
>> For reference, here are two key posts in the discussion, explaining
>> the reasoning/benefits of this approach.
>> https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg00784.html
>> https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg01517.html
>> https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg08731.html
>> https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg00044.html
>>
>> Signed-off-by: Robert Foley <robert.foley@linaro.org>
>> ---
>>  target/arm/cpu-qom.h | 3 +++
>>  target/arm/cpu.c     | 5 +++--
>>  target/arm/cpu_tcg.c | 5 +++--
>>  3 files changed, 9 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

I take it back.  These two cc->do_interrupt calls can be replaced with direct
calls.

> #ifndef CONFIG_USER_ONLY
>     cc->do_interrupt = arm_v7m_cpu_do_interrupt;
> #endif
> 
>     cc->cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt;

If we are in arm_v7m_cpu_exec_interrupt we will always call
arm_v7m_cpu_do_interrupt.

I think the mismatch of #ifdef, which implies a different destination is
possible, is a bug -- cc->do_interrupt is not otherwise assigned and in fact
would be NULL.

I suspect that some of these slots themselves should be ifdefed, so that we
cannot assign to them when they are unused.  That would help keep the ifdefs in
the cpu init functions in sync.

This same condition is *not* true for cris -- there is no
crisv10_cpu_exec_interrupt -- so you do need the new do_interrupt_locked field
there.


r~


  reply	other threads:[~2020-08-31 22:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 18:28 [PATCH v2 0/7] accel/tcg: remove implied BQL from cpu_handle_interrupt/exception path Robert Foley
2020-08-19 18:28 ` [PATCH v2 1/7] target: rename all *_do_interupt functions to _do_interrupt_locked Robert Foley
2020-08-31 21:14   ` Richard Henderson
2020-08-19 18:28 ` [PATCH v2 2/7] target/arm: add ARMCPUClass->do_interrupt_locked Robert Foley
2020-08-31 21:18   ` Richard Henderson
2020-08-31 22:02     ` Richard Henderson [this message]
2020-08-31 23:44       ` Philippe Mathieu-Daudé
2020-08-19 18:28 ` [PATCH v2 3/7] target/cris: add CRISCPUClass->do_interrupt_locked Robert Foley
2020-08-31 21:19   ` Richard Henderson
2020-08-19 18:28 ` [PATCH v2 4/7] target: Push BQL on ->do_interrupt down into per-arch implementation Robert Foley
2020-08-31 21:37   ` Richard Henderson
2020-08-19 18:28 ` [PATCH v2 5/7] accel/tcg: Change BQL critical section in cpu_handle_interrupt Robert Foley
2020-08-31 21:44   ` Richard Henderson
2020-08-19 18:28 ` [PATCH v2 6/7] target: rename all *_cpu_exec_interrupt functions to *_cpu_exec_interrupt_locked Robert Foley
2020-08-31 21:46   ` Richard Henderson
2020-08-19 18:28 ` [PATCH v2 7/7] target: Push BQL on ->cpu_exec_interrupt down into per-arch implementation Robert Foley
2020-08-31 22:11   ` Richard Henderson
2020-08-21 10:55 ` [PATCH v2 0/7] accel/tcg: remove implied BQL from cpu_handle_interrupt/exception path Cornelia Huck
2020-08-27 12:38   ` Robert Foley

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=e324f958-8c9e-ebe1-e624-7eec610fe5aa@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peter.puhov@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=robert.foley@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).