From patchwork Sun May 31 06:11:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 478563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9996C140F90 for ; Sun, 31 May 2015 16:18:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=X3/ENqux; dkim-atps=neutral Received: from localhost ([::1]:41252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YywaC-0007I0-2R for incoming@patchwork.ozlabs.org; Sun, 31 May 2015 02:18:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YywUJ-0002CG-0H for qemu-devel@nongnu.org; Sun, 31 May 2015 02:12:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YywUI-0000Zx-3v for qemu-devel@nongnu.org; Sun, 31 May 2015 02:12:46 -0400 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:34132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YywUH-0000Zp-Tr for qemu-devel@nongnu.org; Sun, 31 May 2015 02:12:46 -0400 Received: by payr10 with SMTP id r10so4205526pay.1 for ; Sat, 30 May 2015 23:12:45 -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:in-reply-to:references :in-reply-to:references; bh=pKI6IB9d9vkmG4ARrMuXfKVIk7dxpkCAYve6OYdgDtI=; b=X3/ENquxtWG7lmaTHACstAnYBUx4UYC2+npdiMXZ7KBBTqxr2nFZvSEXRqqmRc78Al E3vEW4x3jnnAqCOYBF8kWS/Kh5CJbdZ0vlQQhxqljLew/ePgKS/Zx99JvxMPKPuaPqX7 /Il/1XtElRIVtiotKtTm5EcnmljlbQ9Fx8prQpBOXoQRqyMFf/1e3ZZMLgS9DciTD3a1 z5XDW73+crQmnHkl2Ta0PkMP7LLNrvBW7OVIqAnObDxeEZUY/BnksvfK6TMa3REWuqE+ tGHZjn2oUVtBYK6owI2U2HFw7V46DhmA996pWmLjk+7To7DMQKWq5cQ+letZ2saMdTTd UkoA== X-Received: by 10.66.148.34 with SMTP id tp2mr29376735pab.65.1433052765358; Sat, 30 May 2015 23:12:45 -0700 (PDT) Received: from pcrost-laptop.hsd1.ca.comcast.net (c-24-5-157-48.hsd1.ca.comcast.net. [24.5.157.48]) by mx.google.com with ESMTPSA id de2sm10407396pdb.15.2015.05.30.23.12.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 May 2015 23:12:44 -0700 (PDT) From: Peter Crosthwaite X-Google-Original-From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Sat, 30 May 2015 23:11:46 -0700 Message-Id: <43ceca65a3fa240efac49aa0bf604ad0442e1710.1433052532.git.crosthwaite.peter@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::235 Cc: peter.maydell@linaro.org, Peter Crosthwaite , pbonzini@redhat.com, edgar.iglesias@gmail.com, afaerber@suse.de, rth@twiddle.net Subject: [Qemu-devel] [RFC v2 13/34] cpu-defs: Move out TB_JMP defines 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 These are not Architecture specific in any way so move them out of cpu-defs.h. tb-hash.h is an appropriate place as a leading user and their strong relationship to TB hashing and caching. Signed-off-by: Peter Crosthwaite Reviewed-by: Richard Henderson --- include/exec/cpu-defs.h | 8 -------- include/exec/tb-hash.h | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 1c52d2a..a1c418f 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -34,14 +34,6 @@ #include "exec/target-long.h" -/* Only the bottom TB_JMP_PAGE_BITS of the jump cache hash bits vary for - addresses on the same page. The top bits are the same. This allows - TLB invalidation to quickly clear a subset of the hash table. */ -#define TB_JMP_PAGE_BITS (TB_JMP_CACHE_BITS / 2) -#define TB_JMP_PAGE_SIZE (1 << TB_JMP_PAGE_BITS) -#define TB_JMP_ADDR_MASK (TB_JMP_PAGE_SIZE - 1) -#define TB_JMP_PAGE_MASK (TB_JMP_CACHE_SIZE - TB_JMP_PAGE_SIZE) - #if !defined(CONFIG_USER_ONLY) #define CPU_TLB_BITS 8 #define CPU_TLB_SIZE (1 << CPU_TLB_BITS) diff --git a/include/exec/tb-hash.h b/include/exec/tb-hash.h index e0bd786..0f4e8a0 100644 --- a/include/exec/tb-hash.h +++ b/include/exec/tb-hash.h @@ -20,6 +20,14 @@ #ifndef EXEC_TB_HASH #define EXEC_TB_HASH +/* Only the bottom TB_JMP_PAGE_BITS of the jump cache hash bits vary for + addresses on the same page. The top bits are the same. This allows + TLB invalidation to quickly clear a subset of the hash table. */ +#define TB_JMP_PAGE_BITS (TB_JMP_CACHE_BITS / 2) +#define TB_JMP_PAGE_SIZE (1 << TB_JMP_PAGE_BITS) +#define TB_JMP_ADDR_MASK (TB_JMP_PAGE_SIZE - 1) +#define TB_JMP_PAGE_MASK (TB_JMP_CACHE_SIZE - TB_JMP_PAGE_SIZE) + static inline unsigned int tb_jmp_cache_hash_page(target_ulong pc) { target_ulong tmp;