From: Sergey Fedorov <sergey.fedorov@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Sergey Fedorov" <serge.fdrv@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
"Richard Henderson" <rth@twiddle.net>,
"Sergey Fedorov" <sergey.fedorov@linaro.org>
Subject: [Qemu-devel] [PATCH v6 3/6] cpu-exec: elide more icount code if CONFIG_USER_ONLY
Date: Fri, 29 Apr 2016 01:10:56 +0300 [thread overview]
Message-ID: <1461881459-14297-4-git-send-email-sergey.fedorov@linaro.org> (raw)
In-Reply-To: <1461881459-14297-1-git-send-email-sergey.fedorov@linaro.org>
From: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Alex Bennée: #ifndef replay code to match elided functions]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
---
cpu-exec.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/cpu-exec.c b/cpu-exec.c
index 02a49070b9dd..bd831b5a12f9 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -192,6 +192,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb)
return next_tb;
}
+#ifndef CONFIG_USER_ONLY
/* Execute the code without caching the generated code. An interpreter
could be used if available. */
static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
@@ -216,6 +217,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
tb_phys_invalidate(tb, -1);
tb_free(tb);
}
+#endif
static TranslationBlock *tb_find_physical(CPUState *cpu,
target_ulong pc,
@@ -430,12 +432,14 @@ int cpu_exec(CPUState *cpu)
}
#endif
}
+#ifndef CONFIG_USER_ONLY
} else if (replay_has_exception()
&& cpu->icount_decr.u16.low + cpu->icount_extra == 0) {
/* try to cause an exception pending in the log */
cpu_exec_nocache(cpu, 1, tb_find_fast(cpu), true);
ret = -1;
break;
+#endif
}
next_tb = 0; /* force lookup of first TB */
@@ -542,6 +546,9 @@ int cpu_exec(CPUState *cpu)
case TB_EXIT_ICOUNT_EXPIRED:
{
/* Instruction counter expired. */
+#ifdef CONFIG_USER_ONLY
+ abort();
+#else
int insns_left = cpu->icount_decr.u32;
if (cpu->icount_extra && insns_left >= 0) {
/* Refill decrementer and continue execution. */
@@ -561,6 +568,7 @@ int cpu_exec(CPUState *cpu)
cpu_loop_exit(cpu);
}
break;
+#endif
}
default:
break;
--
2.8.1
next prev parent reply other threads:[~2016-04-28 22:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 22:10 [Qemu-devel] [PATCH v6 0/6] tcg: Misc clean-up patches Sergey Fedorov
2016-04-28 22:10 ` [Qemu-devel] [PATCH v6 1/6] tcg: code_bitmap is not used by user-mode emulation Sergey Fedorov
2016-04-28 22:10 ` [Qemu-devel] [PATCH v6 2/6] tcg: reorganize tb_find_physical loop Sergey Fedorov
2016-04-28 22:10 ` Sergey Fedorov [this message]
2016-04-28 22:10 ` [Qemu-devel] [PATCH v6 4/6] tcg: Clean up from 'next_tb' Sergey Fedorov
2016-04-28 22:10 ` [Qemu-devel] [PATCH v6 5/6] tcg: Rework tb_invalidated_flag Sergey Fedorov
2016-04-28 22:10 ` [Qemu-devel] [PATCH v6 6/6] cpu-exec: Move TB chaining into tb_find_fast() Sergey Fedorov
2016-04-29 13:54 ` Alex Bennée
2016-04-29 13:58 ` Sergey Fedorov
2016-04-29 16:32 ` Richard Henderson
2016-04-29 19:05 ` Sergey Fedorov
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=1461881459-14297-4-git-send-email-sergey.fedorov@linaro.org \
--to=sergey.fedorov@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=serge.fdrv@gmail.com \
/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).