qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [PULL 15/17] tcg: make CPUClass.cpu_exec_* optional
Date: Thu, 17 Dec 2020 13:46:18 -0500	[thread overview]
Message-ID: <20201217184620.3945917-16-ehabkost@redhat.com> (raw)
In-Reply-To: <20201217184620.3945917-1-ehabkost@redhat.com>

This will let us simplify the code that initializes CPU class
methods, when we move cpu_exec_*() to a separate struct.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20201212155530.23098-11-cfontana@suse.de>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 accel/tcg/cpu-exec.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 58117f175a..36dde32ff9 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -240,14 +240,18 @@ static void cpu_exec_enter(CPUState *cpu)
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
 
-    cc->cpu_exec_enter(cpu);
+    if (cc->cpu_exec_enter) {
+        cc->cpu_exec_enter(cpu);
+    }
 }
 
 static void cpu_exec_exit(CPUState *cpu)
 {
     CPUClass *cc = CPU_GET_CLASS(cpu);
 
-    cc->cpu_exec_exit(cpu);
+    if (cc->cpu_exec_exit) {
+        cc->cpu_exec_exit(cpu);
+    }
 }
 
 void cpu_exec_step_atomic(CPUState *cpu)
@@ -619,7 +623,8 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
            True when it is, and we should restart on a new TB,
            and via longjmp via cpu_loop_exit.  */
         else {
-            if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
+            if (cc->cpu_exec_interrupt &&
+                cc->cpu_exec_interrupt(cpu, interrupt_request)) {
                 if (need_replay_interrupt(interrupt_request)) {
                     replay_interrupt();
                 }
-- 
2.28.0



  parent reply	other threads:[~2020-12-17 18:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 18:46 [PULL 00/17] x86 queue, 2020-12-17 Eduardo Habkost
2020-12-17 18:46 ` [PULL 01/17] i386: move kvm accel files into kvm/ Eduardo Habkost
2020-12-17 18:46 ` [PULL 02/17] i386: move whpx accel files into whpx/ Eduardo Habkost
2020-12-17 18:46 ` [PULL 03/17] i386: move hax accel files into hax/ Eduardo Habkost
2020-12-17 18:46 ` [PULL 04/17] i386: hvf: remove stale MAINTAINERS entry for old hvf stubs Eduardo Habkost
2020-12-17 18:46 ` [PULL 05/17] i386: move TCG accel files into tcg/ Eduardo Habkost
2020-12-17 18:46 ` [PULL 06/17] i386: move cpu dump out of helper.c into cpu-dump.c Eduardo Habkost
2020-12-17 18:46 ` [PULL 07/17] i386: move hyperv_vendor_id initialization to x86_cpu_realizefn() Eduardo Habkost
2020-12-17 22:33   ` Claudio Fontana
2020-12-17 22:53     ` Eduardo Habkost
2020-12-17 23:34       ` Claudio Fontana
2020-12-17 23:47         ` Eduardo Habkost
2020-12-18  0:07           ` Claudio Fontana
2020-12-18  1:05             ` Eduardo Habkost
2020-12-18  8:50               ` Claudio Fontana
2020-12-17 18:46 ` [PULL 08/17] i386: move hyperv_interface_id " Eduardo Habkost
2020-12-17 18:46 ` [PULL 09/17] i386: move hyperv_version_id " Eduardo Habkost
2020-12-17 18:46 ` [PULL 10/17] i386: move hyperv_limits " Eduardo Habkost
2020-12-17 18:46 ` [PULL 11/17] x86/cpu: Add AVX512_FP16 cpu feature Eduardo Habkost
2020-12-17 18:46 ` [PULL 12/17] i386: move TCG cpu class initialization to tcg/ Eduardo Habkost
2020-12-17 18:46 ` [PULL 13/17] i386: tcg: remove inline from cpu_load_eflags Eduardo Habkost
2020-12-17 18:46 ` [PULL 14/17] tcg: cpu_exec_{enter,exit} helpers Eduardo Habkost
2020-12-17 18:46 ` Eduardo Habkost [this message]
2020-12-17 18:46 ` [PULL 16/17] tcg: Make CPUClass.debug_excp_handler optional Eduardo Habkost
2020-12-17 18:46 ` [PULL 17/17] cpu: Remove unnecessary noop methods Eduardo Habkost
2020-12-17 20:48 ` [PULL 00/17] x86 queue, 2020-12-17 Peter Maydell

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=20201217184620.3945917-16-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=alex.bennee@linaro.org \
    --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).