[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] hw/core: Add bql_interrupt flag to CPUClass
From: |
Robert Foley |
Subject: |
[PATCH 1/2] hw/core: Add bql_interrupt flag to CPUClass |
Date: |
Fri, 31 Jul 2020 08:51:26 -0400 |
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;
+}
+
/**
* qemu_tcg_mttcg_enabled:
* Check whether we are running MultiThread TCG or not.
--
2.17.1