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 v3 1/4] tcg: code_bitmap is not used by user-mode emulation
Date: Thu, 14 Apr 2016 23:45:46 +0300 [thread overview]
Message-ID: <1460666749-24452-2-git-send-email-sergey.fedorov@linaro.org> (raw)
In-Reply-To: <1460666749-24452-1-git-send-email-sergey.fedorov@linaro.org>
From: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Sergey Fedorov: eliminate the field entirely in user-mode]
Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
---
Changes in v2:
* The field is eliminated entirely in user-mode
translate-all.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/translate-all.c b/translate-all.c
index 8329ea60eeda..0d5d9449dc6b 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -75,8 +75,9 @@ typedef struct PageDesc {
/* in order to optimize self modifying code, we count the number
of lookups we do to a given page to use a bitmap */
unsigned int code_write_count;
+#ifdef CONFIG_SOFTMMU
unsigned long *code_bitmap;
-#if defined(CONFIG_USER_ONLY)
+#else
unsigned long flags;
#endif
} PageDesc;
@@ -784,8 +785,10 @@ void tb_free(TranslationBlock *tb)
static inline void invalidate_page_bitmap(PageDesc *p)
{
+#ifdef CONFIG_SOFTMMU
g_free(p->code_bitmap);
p->code_bitmap = NULL;
+#endif
p->code_write_count = 0;
}
@@ -1019,6 +1022,7 @@ void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr)
tcg_ctx.tb_ctx.tb_phys_invalidate_count++;
}
+#ifdef CONFIG_SOFTMMU
static void build_page_bitmap(PageDesc *p)
{
int n, tb_start, tb_end;
@@ -1047,6 +1051,7 @@ static void build_page_bitmap(PageDesc *p)
tb = tb->page_next[n];
}
}
+#endif
/* Called with mmap_lock held for user mode emulation. */
TranslationBlock *tb_gen_code(CPUState *cpu,
@@ -1296,6 +1301,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
#endif
}
+#ifdef CONFIG_SOFTMMU
/* len must be <= 8 and start must be a multiple of len */
void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len)
{
@@ -1333,8 +1339,7 @@ void tb_invalidate_phys_page_fast(tb_page_addr_t start, int len)
tb_invalidate_phys_page_range(start, start + len, 1);
}
}
-
-#if !defined(CONFIG_SOFTMMU)
+#else
/* Called with mmap_lock held. */
static void tb_invalidate_phys_page(tb_page_addr_t addr,
uintptr_t pc, void *puc,
--
2.8.1
next prev parent reply other threads:[~2016-04-14 20:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 20:45 [Qemu-devel] [PATCH v3 0/4] tcg: Misc clean-up patches Sergey Fedorov
2016-04-14 20:45 ` Sergey Fedorov [this message]
2016-04-14 20:45 ` [Qemu-devel] [PATCH v3 2/4] tcg: reorganize tb_find_physical loop Sergey Fedorov
2016-04-14 20:45 ` [Qemu-devel] [PATCH v3 3/4] cpu-exec: elide more icount code if CONFIG_USER_ONLY Sergey Fedorov
2016-04-14 20:45 ` [Qemu-devel] [PATCH v3 4/4] tcg: rework tb_invalidated_flag Sergey Fedorov
2016-04-18 14:09 ` Alex Bennée
2016-04-18 15:05 ` Sergey Fedorov
2016-04-18 15:34 ` Peter Maydell
2016-04-18 17:17 ` Alex Bennée
2016-04-18 17:51 ` Sergey Fedorov
2016-04-21 14:35 ` Sergey Fedorov
2016-04-21 15:55 ` Alex Bennée
2016-04-21 16:16 ` Sergey Fedorov
2016-04-21 17:18 ` Sergey Fedorov
2016-04-21 21:54 ` Alex Bennée
2016-04-22 9:49 ` 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=1460666749-24452-2-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.