From patchwork Wed May 29 02:11:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pingfan liu X-Patchwork-Id: 247100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 73F292C033F for ; Wed, 29 May 2013 12:14:16 +1000 (EST) Received: from localhost ([::1]:55273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhVu2-0006JE-Ig for incoming@patchwork.ozlabs.org; Tue, 28 May 2013 22:14:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhVrW-0002J6-Jf for qemu-devel@nongnu.org; Tue, 28 May 2013 22:11:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhVrV-0001mS-L4 for qemu-devel@nongnu.org; Tue, 28 May 2013 22:11:38 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:55813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhVrV-0001mO-F8 for qemu-devel@nongnu.org; Tue, 28 May 2013 22:11:37 -0400 Received: by mail-pa0-f41.google.com with SMTP id rl6so8738275pac.28 for ; Tue, 28 May 2013 19:11:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=8kQNJSkyfCsLJtxJrmA3/hWrLRmiPEYhBxFERwQ//6g=; b=hVtu8U0rTF8mNzVD2A4sgM0qLYn0p9OcXzgWcSr+BQT1IOR6TE+K6Di1sFXXf2OgKJ V8DAlErh2+jRuw+510rfRIOSMX5VMmbkDpa9E9k6dreSAA9XoPvnfV14w9lmWaXPREuE YpXjHr4ydgPqpwFYE5+IdnGTDuGuwZ2UFwaBJJqLZvpgdjnTCdIOsNhpmNVehe5HAWDf Wk3RnyU5UZNUiOm8t7nionn0XWWQ5XYkEskeEC7ca3MfxaoZBMBv42f8bQjEFDNL0oTv 0xPuAOPjCaCIC8ai2JDDf+466uuIDY6zNCaDEnUwfxRdBT+Y81lJEy2g+MacNTpdcr4I 3X7Q== X-Received: by 10.66.163.5 with SMTP id ye5mr1144399pab.60.1369793496795; Tue, 28 May 2013 19:11:36 -0700 (PDT) Received: from localhost ([222.128.156.91]) by mx.google.com with ESMTPSA id tq8sm35135802pbc.30.2013.05.28.19.11.33 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 28 May 2013 19:11:35 -0700 (PDT) From: Liu Ping Fan To: qemu-devel@nongnu.org Date: Wed, 29 May 2013 10:11:06 +0800 Message-Id: <1369793469-30883-4-git-send-email-qemulist@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1369793469-30883-1-git-send-email-qemulist@gmail.com> References: <1369793469-30883-1-git-send-email-qemulist@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.41 Cc: Paolo Bonzini , Anthony Liguori Subject: [Qemu-devel] [PATCH v1 3/6] mem: fold tcg listener's logic into core memory listener 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Liu Ping Fan We can do the tcg listener's logic in core memory listener. And this will help us concentrate the rcu updater. Signed-off-by: Liu Ping Fan --- exec.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/exec.c b/exec.c index e5335f5..eb69a98 100644 --- a/exec.c +++ b/exec.c @@ -1761,6 +1761,7 @@ static void release_dispatch_map(AllocInfo *info) */ static void core_commit(MemoryListener *listener) { + CPUArchState *env; AllocInfo *info = cur_alloc_info; info->map = cur_map_nodes; info->sections = cur_phys_sections; @@ -1772,20 +1773,15 @@ static void core_commit(MemoryListener *listener) cur_phys_sections = next_phys_sections; cur_alloc_info = next_alloc_info; - /* Fix me, will changed to call_rcu */ - release_dispatch_map(info); -} - -static void tcg_commit(MemoryListener *listener) -{ - CPUArchState *env; - /* since each CPU stores ram addresses in its TLB cache, we must reset the modified entries */ /* XXX: slow ! */ - for(env = first_cpu; env != NULL; env = env->next_cpu) { + for (env = first_cpu; env != NULL; env = env->next_cpu) { tlb_flush(env, 1); } + + /* Fix me, will changed to call_rcu */ + release_dispatch_map(info); } static void core_log_global_start(MemoryListener *listener) @@ -1830,10 +1826,6 @@ static MemoryListener io_memory_listener = { .priority = 0, }; -static MemoryListener tcg_memory_listener = { - .commit = tcg_commit, -}; - void address_space_init_dispatch(AddressSpace *as) { AddressSpaceDispatch *d = g_new(AddressSpaceDispatch, 1); @@ -1870,7 +1862,6 @@ static void memory_map_init(void) memory_listener_register(&core_memory_listener, &address_space_memory); memory_listener_register(&io_memory_listener, &address_space_io); - memory_listener_register(&tcg_memory_listener, &address_space_memory); } MemoryRegion *get_system_memory(void)