On 2026-10-02 16:46, Peter Maydell wrote:
On Fri, 2 Oct 2026 at 15:37, Philippe Mathieu-Daudé
<[email protected]> 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)