[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] hw/core: Add bql_interrupt flag to CPUClass
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH 1/2] hw/core: Add bql_interrupt flag to CPUClass |
Date: |
Fri, 31 Jul 2020 13:43:53 -0400 |
On Fri, Jul 31, 2020 at 08:51:26AM -0400, Robert Foley wrote:
> The new flag bql_interrupt, allows the CPUClass to
> determine if the BQL should be held during calls to
> cpu_exec_interrupt or do_interrupt.
>
> This is being added in preparation for changes in
> cpu_handle_interrupt, which will use this flag.
>
> Signed-off-by: Robert Foley <robert.foley@linaro.org>
> ---
> hw/core/cpu.c | 1 +
> include/hw/core/cpu.h | 8 ++++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/hw/core/cpu.c b/hw/core/cpu.c
> index 8707ce2c34..7ab88caa97 100644
> --- a/hw/core/cpu.c
> +++ b/hw/core/cpu.c
> @@ -425,6 +425,7 @@ static void cpu_class_init(ObjectClass *klass, void *data)
> k->cpu_exec_exit = cpu_common_noop;
> k->cpu_exec_interrupt = cpu_common_exec_interrupt;
> k->adjust_watchpoint_address = cpu_adjust_watchpoint_address;
> + k->bql_interrupt = true;
> set_bit(DEVICE_CATEGORY_CPU, dc->categories);
> dc->realize = cpu_common_realizefn;
> dc->unrealize = cpu_common_unrealizefn;
> diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> index 6a2c77682f..d2c426ee5d 100644
> --- a/include/hw/core/cpu.h
> +++ b/include/hw/core/cpu.h
> @@ -157,6 +157,8 @@ struct TranslationBlock;
> * @disas_set_info: Setup architecture specific components of disassembly
> info
> * @adjust_watchpoint_address: Perform a target-specific adjustment to an
> * address before attempting to match it against watchpoints.
> + * @bql_interrupt: Hold BQL while performing the cpu_exec_interrupt
> + * or do_interrupt call.
> *
> * Represents a CPU family or model.
> */
> @@ -227,6 +229,7 @@ typedef struct CPUClass {
> /* Keep non-pointer data at the end to minimize holes. */
> int gdb_num_core_regs;
> bool gdb_stop_before_watchpoint;
> + bool bql_interrupt;
> } CPUClass;
>
> /*
> @@ -589,6 +592,11 @@ static inline void cpu_tb_jmp_cache_clear(CPUState *cpu)
> }
> }
>
> +static inline void cpu_class_enable_bql_interrupt(CPUClass *cc)
> +{
> + cc->bql_interrupt = true;
> +}
Class data is not supposed to change outside class_init. Why do
you need this function? I don't see it being used anywhere in
this series.
--
Eduardo