From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avu9R-0006Sn-H9 for qemu-devel@nongnu.org; Thu, 28 Apr 2016 18:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avu9O-0006Yt-MT for qemu-devel@nongnu.org; Thu, 28 Apr 2016 18:11:13 -0400 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:33486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avu9O-0006Yg-FG for qemu-devel@nongnu.org; Thu, 28 Apr 2016 18:11:10 -0400 Received: by mail-lf0-x236.google.com with SMTP id y84so99616264lfc.0 for ; Thu, 28 Apr 2016 15:11:10 -0700 (PDT) From: Sergey Fedorov Date: Fri, 29 Apr 2016 01:10:54 +0300 Message-Id: <1461881459-14297-2-git-send-email-sergey.fedorov@linaro.org> In-Reply-To: <1461881459-14297-1-git-send-email-sergey.fedorov@linaro.org> References: <1461881459-14297-1-git-send-email-sergey.fedorov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v6 1/6] tcg: code_bitmap is not used by user-mode emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Sergey Fedorov , Paolo Bonzini , Peter Crosthwaite , Richard Henderson , Sergey Fedorov From: Paolo Bonzini Signed-off-by: Paolo Bonzini [Sergey Fedorov: eliminate the field entirely in user-mode] Signed-off-by: Sergey Fedorov Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- 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 d679ad129e10..74fa1b4d271c 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; @@ -783,8 +784,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; } @@ -1028,6 +1031,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; @@ -1056,6 +1060,7 @@ static void build_page_bitmap(PageDesc *p) tb = tb->page_next[n]; } } +#endif /* add the tb in the target page and protect it if necessary * @@ -1412,6 +1417,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) { @@ -1449,8 +1455,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