From patchwork Tue Mar 29 19:48:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: sergey.fedorov@linaro.org X-Patchwork-Id: 8690211 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6F1CBC0553 for ; Tue, 29 Mar 2016 19:48:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B95BB2035B for ; Tue, 29 Mar 2016 19:48:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F888202FF for ; Tue, 29 Mar 2016 19:48:45 +0000 (UTC) Received: from localhost ([::1]:49573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akzd6-0002rx-G9 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 Mar 2016 15:48:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akzcs-0002kz-MG for qemu-devel@nongnu.org; Tue, 29 Mar 2016 15:48:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akzcp-00089H-LR for qemu-devel@nongnu.org; Tue, 29 Mar 2016 15:48:30 -0400 Received: from mail-lb0-x22d.google.com ([2a00:1450:4010:c04::22d]:35670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akzcp-00089A-DQ for qemu-devel@nongnu.org; Tue, 29 Mar 2016 15:48:27 -0400 Received: by mail-lb0-x22d.google.com with SMTP id bc4so17934995lbc.2 for ; Tue, 29 Mar 2016 12:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KNnIED6fiSTGXlsHGxTIHh16Xt3/zhaGUX+b2YR6YCU=; b=LNI8ci0dGOs2GsqEbg1KsDhL7R4wKHPDkeE0kICSgJfIK5OyOae6UgOPJOrWWKsOOX 5Y8AGr8JdLBaHGKVqdDzUcfP/dnCKQ/7fI4CglU7QBSsdSzDQ1lh0mUfDCB/cNP9tdtb ukmW9qIFUyatpRqcnTKUtQMQ+ctJK8fqjDTAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KNnIED6fiSTGXlsHGxTIHh16Xt3/zhaGUX+b2YR6YCU=; b=DmQ0EitigrGIxMSGo6H5OGnH1W1onoBSJTc5t9MY1sjmEDXdvr5h3ZaHo8YTXgJ0TN XEzw7yEKoDEIenMFyhYnsHEVahm6Kc0vLuzKvShhu5ub2T+bZTPVeZ18ew490aljbsuY V09AoM70b5vJgwBFdlHo2syAp1YZ3fmwHNnpedm8QUECfGmt5vA9Flhwph9KLcyngp35 36OCdSvq+mGbAS03XTWHBkf/WaZobleG4Ll9rGJgo3eTuGw38jOSRZS9/vEepbPKOB9R P1PwhetJSzCVBaIvblB2krwm9S96t0hgRkOSwnpjW1SMVCSYgPpGL3QdNb+4bphha61Z Ilvg== X-Gm-Message-State: AD7BkJKjohXz6oy6HomIkkoBgrWgvP58+8mXDL3dU4taqiPXdSre+8wUtfZI0pMtmnrerDwr X-Received: by 10.112.156.106 with SMTP id wd10mr2012604lbb.136.1459280906633; Tue, 29 Mar 2016 12:48:26 -0700 (PDT) Received: from sergey-laptop.Dlink (broadband-46-188-121-115.2com.net. [46.188.121.115]) by smtp.gmail.com with ESMTPSA id e141sm49001lfe.18.2016.03.29.12.48.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Mar 2016 12:48:25 -0700 (PDT) From: Sergey Fedorov To: qemu-devel@nongnu.org Date: Tue, 29 Mar 2016 22:48:10 +0300 Message-Id: <1459280892-8789-2-git-send-email-sergey.fedorov@linaro.org> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1459280892-8789-1-git-send-email-sergey.fedorov@linaro.org> References: <1459280892-8789-1-git-send-email-sergey.fedorov@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::22d Cc: Sergey Fedorov , Peter Crosthwaite , Paolo Bonzini , Sergey Fedorov , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Subject: [Qemu-devel] [PATCH v2 1/3] tcg: code_bitmap is not used by user-mode emulation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Notes: 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 e9f409b762ab..c131ce2f183e 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; } @@ -1018,6 +1021,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; @@ -1046,6 +1050,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, @@ -1294,6 +1299,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) { @@ -1331,8 +1337,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,