From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-ppc@nongnu.org, qemu-s390x@nongnu.org,
Richard Henderson <richard.henderson@linaro.org>,
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
qemu-riscv@nongnu.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v3 04/11] accel/tcg: Document cpu_exec_interrupt() callback contract
Date: Fri, 2 Oct 2026 17:07:41 +0200 [thread overview]
Message-ID: <ba7ed9e4-e53e-411b-8bd3-e4258fa23fb4@oss.qualcomm.com> (raw)
In-Reply-To: <CAFEAcA-7DDa1u4OsH05EuD6xt0rCVwTVeQE+ppRX3tdCqg9kxQ@mail.gmail.com>
On 2026-10-02 16:46, Peter Maydell wrote:
> On Fri, 2 Oct 2026 at 15:37, Philippe Mathieu-Daudé
> <philmd@oss.qualcomm.com> wrote:
>> Does that update sound good to you?
>>
>> * Called from cpu_handle_interrupt() with the BQL held. Identify which,
>> * if any, of the possibly multiple pending interrupts specified by
>> * @interrupt_request should be taken, using the target architecture's
>> * prioritization and masking rules. If an interrupt can be taken, update
>> * the emulated CPU state for interrupt entry.
>
> Looks good to me.
>
>> With the update desc I wonder if we should rename the
>> helper as cpu_take_interrupt()...
>
> Mmm. the "exec" in the current method name is "because it's
> called by cpu_exec", I think (compare cpu_exec_reset,
> cpu_exec_halt), which is not necessarily a very useful thing
> to encode in the method name.
(also IIRC they were first defined in cpu-exec.c but got
moved around)
>
> I guess my opinions are:
> * don't bother renaming unless we think we have a clearly
> better name/set of names
> * if we rename one of the cpu_exec_foo then we should probably
> rename all of them in some consistent way
OK.
> * a new set of names would ideally make it clearer what the
> difference is between do_interrupt and cpu_exec_interrupt
> (I can't remember myself why we need both or what the difference
> is offhand...)
/* main execution loop */
cpu_exec_loop(CPUState *cpu, SyncClocks *sc)
{
/* if an exception is pending, we execute it here */
// examine async requests
// per-target mask / prioritization
// select (accept) intr
while (!cpu_handle_exception(cpu, &excp)) {
// target consume selected intr
while (!cpu_handle_interrupt(cpu, &last_tb)) {
So an option:
- cpu_handle_exception() -> cpu_select_interrupt()
(examines pending interrupt_request bitmask)
- cpu_handle_interrupt() -> cpu_enter_exception()
(intr / synchronous exception)
next prev parent reply other threads:[~2026-10-02 15:08 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 15:20 [PATCH v3 00/11] accel/tcg: Push BQL down into per-target do_interrupt handlers Philippe Mathieu-Daudé
2026-09-02 15:20 ` [PATCH v3 01/11] target/arm: Call arm*_cpu_do_interrupt directly instead of via TCGCPUOps Philippe Mathieu-Daudé
2026-09-02 19:52 ` Pierrick Bouvier
2026-09-08 16:09 ` Peter Maydell
2026-10-01 12:03 ` Philippe Mathieu-Daudé
2026-09-13 2:42 ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 03/11] target/i386: Rename fake_do_interrupt to fake_user_exception Philippe Mathieu-Daudé
2026-09-13 2:44 ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 04/11] accel/tcg: Document cpu_exec_interrupt() callback contract Philippe Mathieu-Daudé
2026-09-08 16:25 ` Peter Maydell
2026-10-02 14:37 ` Philippe Mathieu-Daudé
2026-10-02 14:46 ` Peter Maydell
2026-10-02 15:07 ` Philippe Mathieu-Daudé [this message]
2026-09-02 15:20 ` [PATCH v3 05/11] accel/tcg: Document do_interrupt() " Philippe Mathieu-Daudé
2026-09-02 19:54 ` Pierrick Bouvier
2026-09-02 20:48 ` Philippe Mathieu-Daudé
2026-09-13 3:30 ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 06/11] accel/tcg: Rename do_interrupt() to do_interrupt_locked() Philippe Mathieu-Daudé
2026-09-13 3:31 ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 07/11] accel/tcg: Add do_interrupt() wrapper for targets to manage BQL Philippe Mathieu-Daudé
2026-09-13 3:50 ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 08/11] target/hexagon: Move to do_interrupt() (BQL acquired internally) Philippe Mathieu-Daudé
2026-09-03 0:15 ` Brian Cain
2026-09-13 3:55 ` Richard Henderson
2026-10-01 13:40 ` Philippe Mathieu-Daudé
2026-09-02 15:20 ` [RFC PATCH v3 09/11] targets: Move interrupt handlers to do_interrupt() Philippe Mathieu-Daudé
2026-09-13 4:00 ` Richard Henderson
2026-10-02 14:50 ` Philippe Mathieu-Daudé
2026-09-02 15:20 ` [RFC PATCH v3 10/11] targets: Move BQL locking into do_interrupt() handlers Philippe Mathieu-Daudé
2026-09-02 15:20 ` [PATCH v3 11/11] accel/tcg: Remove do_interrupt_locked() callback Philippe Mathieu-Daudé
2026-09-13 4:00 ` Richard Henderson
2026-09-02 15:33 ` [PATCH v3 00/11] accel/tcg: Push BQL down into per-target do_interrupt handlers Philippe Mathieu-Daudé
[not found] ` <20260902152044.31291-3-philmd@oss.qualcomm.com>
2026-09-02 19:52 ` [PATCH v3 02/11] target/s390x: Restrict interrupt handlers to system mode Pierrick Bouvier
2026-09-13 2:43 ` 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=ba7ed9e4-e53e-411b-8bd3-e4258fa23fb4@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@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 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.