From patchwork Sat Feb 6 16:43:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 44713 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F3467B7CFD for ; Sun, 7 Feb 2010 04:05:46 +1100 (EST) Received: from localhost ([127.0.0.1]:57242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ndnwd-0001qI-RT for incoming@patchwork.ozlabs.org; Sat, 06 Feb 2010 11:55:43 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ndnli-000728-F6 for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:26 -0500 Received: from [199.232.76.173] (port=59324 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ndnlg-00071q-Eg for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:24 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ndnlb-00057O-1c for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:24 -0500 Received: from mx20.gnu.org ([199.232.41.8]:39496) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ndnla-00051T-0j for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:18 -0500 Received: from hall.aurel32.net ([88.191.82.174]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NdnlE-0005k7-9U for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:43:56 -0500 Received: from [2002:52e8:2fb:1:21e:8cff:feb0:693b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NdnlB-0007r7-V6; Sat, 06 Feb 2010 17:43:54 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.71) (envelope-from ) id 1NdnlA-00065e-LW; Sat, 06 Feb 2010 17:43:52 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 6 Feb 2010 17:43:38 +0100 Message-Id: <1265474623-23367-4-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1265474623-23367-1-git-send-email-aurelien@aurel32.net> References: <1265474623-23367-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 3/8] target-sh4: MMU: simplify call to tlb_set_page() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org tlb_set_page() doesn't need addresses with offset, but simply the page aligned addresses. Signed-off-by: Aurelien Jarno --- target-sh4/helper.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/target-sh4/helper.c b/target-sh4/helper.c index e7c494f..f9bf5e2 100644 --- a/target-sh4/helper.c +++ b/target-sh4/helper.c @@ -464,7 +464,7 @@ static int get_physical_address(CPUState * env, target_ulong * physical, int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw, int mmu_idx, int is_softmmu) { - target_ulong physical, page_offset, page_size; + target_ulong physical; int prot, ret, access_type; access_type = ACCESS_INT; @@ -511,11 +511,8 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw, return 1; } - page_size = TARGET_PAGE_SIZE; - page_offset = - (address - (address & TARGET_PAGE_MASK)) & ~(page_size - 1); - address = (address & TARGET_PAGE_MASK) + page_offset; - physical = (physical & TARGET_PAGE_MASK) + page_offset; + address &= TARGET_PAGE_MASK; + physical &= TARGET_PAGE_MASK; return tlb_set_page(env, address, physical, prot, mmu_idx, is_softmmu); }