From patchwork Thu Jun 2 11:53:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 98385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B1CC0B6F9C for ; Thu, 2 Jun 2011 22:41:12 +1000 (EST) Received: from localhost ([::1]:53737 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS7D2-0008U2-Gl for incoming@patchwork.ozlabs.org; Thu, 02 Jun 2011 08:41:08 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS6UE-0005o4-80 for qemu-devel@nongnu.org; Thu, 02 Jun 2011 07:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QS6UC-0005lC-Dr for qemu-devel@nongnu.org; Thu, 02 Jun 2011 07:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS6UB-0005kr-Mn for qemu-devel@nongnu.org; Thu, 02 Jun 2011 07:54:48 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p52BskDM020867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Jun 2011 07:54:46 -0400 Received: from neno.mitica (vpn1-5-74.ams2.redhat.com [10.36.5.74]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p52BsYdR015781; Thu, 2 Jun 2011 07:54:45 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 2 Jun 2011 13:53:44 +0200 Message-Id: <4d014871a007ddf2a7da0fe1b1a1647b6ad887cf.1307014902.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 09/14] exec: last_first_tb was only used in !ONLY_USER case 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 Once there, use a better variable name. Signed-off-by: Juan Quintela Reviewed-by: Peter Maydell --- exec.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/exec.c b/exec.c index 8529390..4b1afec 100644 --- a/exec.c +++ b/exec.c @@ -1208,12 +1208,16 @@ static inline void tb_alloc_page(TranslationBlock *tb, unsigned int n, tb_page_addr_t page_addr) { PageDesc *p; - TranslationBlock *last_first_tb; +#ifndef CONFIG_USER_ONLY + bool page_already_protected; +#endif tb->page_addr[n] = page_addr; p = page_find_alloc(page_addr >> TARGET_PAGE_BITS, 1); tb->page_next[n] = p->first_tb; - last_first_tb = p->first_tb; +#ifndef CONFIG_USER_ONLY + page_already_protected = p->first_tb != NULL; +#endif p->first_tb = (TranslationBlock *)((long)tb | n); invalidate_page_bitmap(p); @@ -1249,7 +1253,7 @@ static inline void tb_alloc_page(TranslationBlock *tb, /* if some code is already present, then the pages are already protected. So we handle the case where only the first TB is allocated in a physical page */ - if (!last_first_tb) { + if (!page_already_protected) { tlb_protect_code(page_addr); } #endif