Re: [PATCH v2 6/7] target: rename all *_cpu_exec_interrupt functions to *_cpu_exec_interrupt_locked

2020-08-31 Thread Richard Henderson
On 8/19/20 11:28 AM, Robert Foley wrote:
> The rename of all *_cpu_exec_interrupt functions to
> *_cpu_exec_interrupt_locked is preparation for pushing the BQL lock
> around these functions down into the per-arch implementation of
> *_cpu_exec_interrupt.  In a later patch, which pushes down the lock,
> we will add a new *_cpu_exec_interrupt function, which grabs the BQL
> and calls to *_cpu_exec_interrupt_locked.
> 
> This patch is part of a series of transitions to move the
> BQL down into the cpu_exec_interrupt per arch functions.  This set of
> transitions is needed to maintain bisectability.
> 
> The purpose of this set of changes is to set the groundwork
> so that an arch could move towards removing
> the BQL from the cpu_handle_interrupt/exception paths.
> 
> This approach was suggested by Paolo Bonzini.
> For reference, here are 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 
> ---

Reviewed-by: Richard Henderson 


r~




[PATCH v2 6/7] target: rename all *_cpu_exec_interrupt functions to *_cpu_exec_interrupt_locked

2020-08-19 Thread Robert Foley
The rename of all *_cpu_exec_interrupt functions to
*_cpu_exec_interrupt_locked is preparation for pushing the BQL lock
around these functions down into the per-arch implementation of
*_cpu_exec_interrupt.  In a later patch, which pushes down the lock,
we will add a new *_cpu_exec_interrupt function, which grabs the BQL
and calls to *_cpu_exec_interrupt_locked.

This patch is part of a series of transitions to move the
BQL down into the cpu_exec_interrupt per arch functions.  This set of
transitions is needed to maintain bisectability.

The purpose of this set of changes is to set the groundwork
so that an arch could move towards removing
the BQL from the cpu_handle_interrupt/exception paths.

This approach was suggested by Paolo Bonzini.
For reference, here are 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 
---
 target/alpha/cpu.c  | 2 +-
 target/alpha/cpu.h  | 2 +-
 target/alpha/helper.c   | 2 +-
 target/arm/cpu.c| 4 ++--
 target/arm/cpu.h| 2 +-
 target/arm/cpu64.c  | 2 +-
 target/arm/cpu_tcg.c| 5 +++--
 target/avr/cpu.c| 2 +-
 target/avr/cpu.h| 2 +-
 target/avr/helper.c | 2 +-
 target/cris/cpu.c   | 2 +-
 target/cris/cpu.h   | 2 +-
 target/cris/helper.c| 2 +-
 target/hppa/cpu.c   | 2 +-
 target/hppa/cpu.h   | 2 +-
 target/hppa/int_helper.c| 2 +-
 target/i386/cpu.c   | 2 +-
 target/i386/cpu.h   | 2 +-
 target/i386/seg_helper.c| 2 +-
 target/lm32/cpu.c   | 2 +-
 target/lm32/cpu.h   | 2 +-
 target/lm32/helper.c| 2 +-
 target/m68k/cpu.c   | 2 +-
 target/m68k/cpu.h   | 2 +-
 target/m68k/op_helper.c | 2 +-
 target/microblaze/cpu.c | 2 +-
 target/microblaze/cpu.h | 2 +-
 target/microblaze/helper.c  | 2 +-
 target/mips/cpu.c   | 2 +-
 target/mips/helper.c| 2 +-
 target/mips/internal.h  | 2 +-
 target/nios2/cpu.c  | 4 ++--
 target/openrisc/cpu.c   | 2 +-
 target/openrisc/cpu.h   | 2 +-
 target/openrisc/interrupt.c | 2 +-
 target/ppc/cpu.h| 2 +-
 target/ppc/excp_helper.c| 2 +-
 target/ppc/translate_init.inc.c | 2 +-
 target/riscv/cpu.c  | 2 +-
 target/riscv/cpu.h  | 2 +-
 target/riscv/cpu_helper.c   | 2 +-
 target/rx/cpu.c | 2 +-
 target/rx/cpu.h | 2 +-
 target/rx/helper.c  | 2 +-
 target/s390x/cpu.c  | 2 +-
 target/s390x/excp_helper.c  | 2 +-
 target/s390x/internal.h | 2 +-
 target/sh4/cpu.c| 2 +-
 target/sh4/cpu.h| 2 +-
 target/sh4/helper.c | 2 +-
 target/sparc/cpu.c  | 4 ++--
 target/tilegx/cpu.c | 5 +++--
 target/unicore32/cpu.c  | 2 +-
 target/unicore32/cpu.h  | 2 +-
 target/unicore32/helper.c   | 2 +-
 target/xtensa/cpu.c | 2 +-
 target/xtensa/cpu.h | 2 +-
 target/xtensa/exc_helper.c  | 2 +-
 58 files changed, 65 insertions(+), 63 deletions(-)

diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 09677c6c44..623ed42e13 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -218,7 +218,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void 
*data)
 cc->class_by_name = alpha_cpu_class_by_name;
 cc->has_work = alpha_cpu_has_work;
 cc->do_interrupt = alpha_cpu_do_interrupt;
-cc->cpu_exec_interrupt = alpha_cpu_exec_interrupt;
+cc->cpu_exec_interrupt = alpha_cpu_exec_interrupt_locked;
 cc->dump_state = alpha_cpu_dump_state;
 cc->set_pc = alpha_cpu_set_pc;
 cc->gdb_read_register = alpha_cpu_gdb_read_register;
diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h
index be29bdd530..9ed82b5785 100644
--- a/target/alpha/cpu.h
+++ b/target/alpha/cpu.h
@@ -277,7 +277,7 @@ extern const VMStateDescription vmstate_alpha_cpu;
 #endif
 
 void alpha_cpu_do_interrupt(CPUState *cpu);
-bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req);
+bool alpha_cpu_exec_interrupt_locked(CPUState *cpu, int int_req);
 void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags);
 hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
 int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index e497dd269e..b5fa849f0f 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -414,7 +414,7 @@ void alpha_cpu_do_interrupt(CPUState *cs)