From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org
Cc: stefanha@redhat.com, qemu-devel@nongnu.org,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: [Qemu-devel] [PULL 2/3] cpu_common_reset: wrap TCG specific code in tcg_enabled()
Date: Fri, 13 Jan 2017 14:56:32 +0000 [thread overview]
Message-ID: <20170113145633.15384-3-alex.bennee@linaro.org> (raw)
In-Reply-To: <20170113145633.15384-1-alex.bennee@linaro.org>
Both the cpu->tb_jmp_cache and SoftMMU TLB structures are only used
when running TCG code so we might as well skip them for anything else.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
---
qom/cpu.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/qom/cpu.c b/qom/cpu.c
index cc51de2a8c..61ee0cb88c 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -270,13 +270,15 @@ static void cpu_common_reset(CPUState *cpu)
cpu->exception_index = -1;
cpu->crash_occurred = false;
- for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
- atomic_set(&cpu->tb_jmp_cache[i], NULL);
- }
+ if (tcg_enabled()) {
+ for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) {
+ atomic_set(&cpu->tb_jmp_cache[i], NULL);
+ }
#ifdef CONFIG_SOFTMMU
- tlb_flush(cpu, 0);
+ tlb_flush(cpu, 0);
#endif
+ }
}
static bool cpu_common_has_work(CPUState *cs)
--
2.11.0
next prev parent reply other threads:[~2017-01-13 14:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 14:56 [Qemu-devel] [PULL 0/3] Common TLB reset changes Alex Bennée
2017-01-13 14:56 ` [Qemu-devel] [PULL 1/3] qom/cpu: move tlb_flush to cpu_common_reset Alex Bennée
2017-01-13 14:56 ` Alex Bennée [this message]
2017-01-13 14:56 ` [Qemu-devel] [PULL 3/3] cputlb: drop flush_global flag from tlb_flush Alex Bennée
2017-01-17 9:21 ` [Qemu-devel] [PULL 0/3] Common TLB reset changes 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=20170113145633.15384-3-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).