qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	edgar.iglesias@gmail.com, pbonzini@redhat.com, afaerber@suse.de,
	rth@twiddle.net
Subject: [Qemu-devel] [PATCH v3 03/35] translate-all: Move tcg_handle_interrupt() to -common
Date: Sat, 18 Jul 2015 02:40:13 -0700	[thread overview]
Message-ID: <c3fc5f321b757f75a08c35331b7c1139e8b4a7a8.1437212383.git.crosthwaite.peter@gmail.com> (raw)
In-Reply-To: <cover.1437212383.git.crosthwaite.peter@gmail.com>
In-Reply-To: <cover.1437212383.git.crosthwaite.peter@gmail.com>

Move this function to common code. It has no arch specific
dependencies. Prepares support for multi-arch where the translate-all
interface needs to be virtualised. One less thing to virtualise.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
 translate-all.c    | 30 ------------------------------
 translate-common.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/translate-all.c b/translate-all.c
index 27f5d9c..fdb2aa8 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1456,36 +1456,6 @@ void tb_check_watchpoint(CPUState *cpu)
 }
 
 #ifndef CONFIG_USER_ONLY
-/* mask must never be zero, except for A20 change call */
-static void tcg_handle_interrupt(CPUState *cpu, int mask)
-{
-    int old_mask;
-
-    old_mask = cpu->interrupt_request;
-    cpu->interrupt_request |= mask;
-
-    /*
-     * If called from iothread context, wake the target cpu in
-     * case its halted.
-     */
-    if (!qemu_cpu_is_self(cpu)) {
-        qemu_cpu_kick(cpu);
-        return;
-    }
-
-    if (use_icount) {
-        cpu->icount_decr.u16.high = 0xffff;
-        if (!cpu_can_do_io(cpu)
-            && (mask & ~old_mask) != 0) {
-            cpu_abort(cpu, "Raised interrupt while not in I/O function");
-        }
-    } else {
-        cpu->tcg_exit_req = 1;
-    }
-}
-
-CPUInterruptHandler cpu_interrupt_handler = tcg_handle_interrupt;
-
 /* in deterministic execution mode, instructions doing device I/Os
    must be at the end of the TB */
 void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
diff --git a/translate-common.c b/translate-common.c
index 563ae5a..806b36e 100644
--- a/translate-common.c
+++ b/translate-common.c
@@ -1,6 +1,7 @@
 /*
  *  Host code generation common components
  *
+ *  Copyright (c) 2003 Fabrice Bellard
  *  Copyright (c) 2015 Peter Crosthwaite <crosthwaite.peter@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
@@ -18,6 +19,40 @@
  */
 
 #include "qemu-common.h"
+#include "qom/cpu.h"
+
+#ifndef CONFIG_USER_ONLY
+/* mask must never be zero, except for A20 change call */
+static void tcg_handle_interrupt(CPUState *cpu, int mask)
+{
+    int old_mask;
+
+    old_mask = cpu->interrupt_request;
+    cpu->interrupt_request |= mask;
+
+    /*
+     * If called from iothread context, wake the target cpu in
+     * case its halted.
+     */
+    if (!qemu_cpu_is_self(cpu)) {
+        qemu_cpu_kick(cpu);
+        return;
+    }
+
+    if (use_icount) {
+        cpu->icount_decr.u16.high = 0xffff;
+        if (!cpu_can_do_io(cpu)
+            && (mask & ~old_mask) != 0) {
+            cpu_abort(cpu, "Raised interrupt while not in I/O function");
+        }
+    } else {
+        cpu->tcg_exit_req = 1;
+    }
+}
+
+CPUInterruptHandler cpu_interrupt_handler = tcg_handle_interrupt;
+
+#endif
 
 typedef struct TCGExecInitFn {
     void (*do_tcg_exec_init)(unsigned long tb_size);
-- 
1.9.1

  parent reply	other threads:[~2015-07-18  9:41 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-18  9:40 [Qemu-devel] [PATCH v3 00/35] Multi Architecture System Emulation Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 01/35] cpu-exec: Migrate some generic fns to cpu-exec-common Peter Crosthwaite
2015-07-18 12:44   ` Paolo Bonzini
2015-09-07  5:22     ` Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 02/35] translate: Listify tcg_exec_init() Peter Crosthwaite
2015-09-07  5:24   ` Peter Crosthwaite
2015-07-18  9:40 ` Peter Crosthwaite [this message]
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 04/35] tcg: split tcg_op_defs to -common Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 05/35] tcg: Move tcg_tb_ptr " Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 06/35] translate: move real_host_page setting " Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 07/35] cpus: Listify cpu_list() function Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 08/35] translate-common: Listify tcg_enabled() Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 09/35] core: Convert tcg_enabled() users to tcg_(any|all)_enabled() Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 10/35] exec-all: Move cpu_can_do_io() to qom/cpu.h Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 11/35] cputlb: move CPU_LOOP() for tlb_reset() to exec.c Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 12/35] cputlb: Change tlb_set_dirty() arg to cpu Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 13/35] include/exec: Move cputlb exec.c defs out Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 14/35] cpu-common: Define tb_page_addr_t for everyone Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 15/35] include/exec: Split target_long def to new header Peter Crosthwaite
2015-07-18 12:16   ` Paolo Bonzini
2015-07-18 12:37     ` Paolo Bonzini
2015-07-18 15:37       ` Peter Crosthwaite
2015-07-18 16:01         ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 16/35] cpu-defs: Allow multiple inclusions Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 17/35] monitor: uninclude cpu_ldst Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 18/35] target-*: Don't redefine cpu_exec() Peter Crosthwaite
2016-06-21 11:19   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 19/35] target-*: cpu.h: Undefine core code symbols Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 20/35] Makefile.target: Introduce arch-obj Peter Crosthwaite
2015-07-18 12:23   ` Paolo Bonzini
2015-07-18 12:29   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 21/35] core: virtualise CPU interfaces completely Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 22/35] core: Introduce multi-arch build Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 23/35] arm: cpu: static inline cpu_arm_init() Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 24/35] target-arm: Split cp helper API to new C file Peter Crosthwaite
2015-07-18 12:30   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 25/35] arm: register cpu_list() function Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 26/35] arm: enable multi-arch Peter Crosthwaite
2015-07-18 12:32   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 27/35] hw: arm: Explicitly include cpu.h for consumers Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 28/35] arm: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-07-18 12:33   ` Paolo Bonzini
2015-08-15 23:29     ` Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 29/35] hw: mb: Explicitly include cpu.h for consumers Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 30/35] mb: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 31/35] microblaze: enable multi-arch Peter Crosthwaite
2015-07-18 12:35   ` Paolo Bonzini
2015-07-18 20:04     ` Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 32/35] arm: boot: Don't assume all CPUs are ARM Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 34/35] HACK: mb: boot: Assume using -firmware for mb software Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 35/35] HACK: mb: boot: Disable dtb load in multi-arch Peter Crosthwaite
2015-07-18 12:44 ` [Qemu-devel] [PATCH v3 00/35] Multi Architecture System Emulation Paolo Bonzini
2015-07-18 15:45   ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3fc5f321b757f75a08c35331b7c1139e8b4a7a8.1437212383.git.crosthwaite.peter@gmail.com \
    --to=crosthwaitepeter@gmail.com \
    --cc=afaerber@suse.de \
    --cc=crosthwaite.peter@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).