[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 10/15] exec-all: Move cpu_can_do_io() to qom/cpu.
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH v1 10/15] exec-all: Move cpu_can_do_io() to qom/cpu.h |
Date: |
Thu, 10 Sep 2015 22:39:40 -0700 |
This function has no architecture specific dependencies and should be
callable from core code. Move it to qom/cpu.h.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
include/qom/cpu.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 39712ab..7e5f3b0 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -696,6 +696,27 @@ void QEMU_NORETURN cpu_abort(CPUState *cpu, const char
*fmt, ...)
GCC_FMT_ATTR(2, 3);
void cpu_exec_exit(CPUState *cpu);
+/**
+ * cpu_can_do_io:
+ * @cpu: The CPU for which to check IO.
+ *
+ * Deterministic execution requires that IO only be performed on the last
+ * instruction of a TB so that interrupts take effect immediately.
+ *
+ * Returns: %true if memory-mapped IO is safe, %false otherwise.
+ */
+static inline bool cpu_can_do_io(CPUState *cpu)
+{
+ if (!use_icount) {
+ return true;
+ }
+ /* If not executing code then assume we are ok. */
+ if (cpu->current_tb == NULL) {
+ return true;
+ }
+ return cpu->can_do_io != 0;
+}
+
#ifdef CONFIG_SOFTMMU
extern const struct VMStateDescription vmstate_cpu_common;
#else
--
1.9.1
- [Qemu-devel] [PATCH v1 00/15] Multi-Arch Phase 1, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 01/15] cpu-exec: Migrate some generic fns to cpu-exec-common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 02/15] translate: Listify tcg_exec_init(), Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 03/15] translate-all: Move tcg_handle_interrupt() to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 04/15] tcg: split tcg_op_defs to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 06/15] translate: move real_host_page setting to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 05/15] tcg: Move tcg_tb_ptr to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 07/15] cpus: Listify cpu_list() function, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 08/15] translate-common: Listify tcg_enabled(), Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 10/15] exec-all: Move cpu_can_do_io() to qom/cpu.h,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH v1 11/15] cputlb: move CPU_LOOP() for tlb_reset() to exec.c, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 12/15] cputlb: Change tlb_set_dirty() arg to cpu, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 09/15] core: Convert tcg_enabled() uses to any/all variants, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 13/15] include/exec: Move cputlb exec.c defs out, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 14/15] cpu-common: Define tb_page_addr_t for everyone, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 15/15] monitor: uninclude cpu_ldst, Peter Crosthwaite, 2015/09/11
- Re: [Qemu-devel] [PATCH v1 00/15] Multi-Arch Phase 1, Paolo Bonzini, 2015/09/11