From patchwork Thu Jul 21 15:16:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsuneo Saito X-Patchwork-Id: 106093 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 29F56B6F75 for ; Fri, 22 Jul 2011 02:13:50 +1000 (EST) Received: from localhost ([::1]:58928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjv36-0002M4-5J for incoming@patchwork.ozlabs.org; Thu, 21 Jul 2011 11:20:28 -0400 Received: from eggs.gnu.org ([140.186.70.92]:51895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjv2c-00018o-IA for qemu-devel@nongnu.org; Thu, 21 Jul 2011 11:19:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qjv00-000335-2h for qemu-devel@nongnu.org; Thu, 21 Jul 2011 11:17:18 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:57574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjuzz-00032g-T6 for qemu-devel@nongnu.org; Thu, 21 Jul 2011 11:17:16 -0400 Received: by mail-pv0-f173.google.com with SMTP id 3so1492015pvg.4 for ; Thu, 21 Jul 2011 08:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=41BpfZ6iLU46B0LOqAgX25W+TEoe1JEIHSRis/4OsF4=; b=VxI29EM+za6N1GFMBv1ZREkiDPZK5IEr54omzqEUgaNnzSrJt4bGeE0CahyTNY4SLS Pd0cNRQOKvib1WdPRrV+VZyIIrGP3www19lXwbg0U+VGkBTdem+ced+aefLbovdml6Jj kC36RuATTfeV4adWABnJ5x7j72RBmNESc2CB0= Received: by 10.68.54.225 with SMTP id m1mr471803pbp.111.1311261435539; Thu, 21 Jul 2011 08:17:15 -0700 (PDT) Received: from localhost.localdomain (tetkyo149119.tkyo.te.ftth2.ppp.infoweb.ne.jp [202.219.195.119]) by mx.google.com with ESMTPS id g4sm948229pbj.73.2011.07.21.08.17.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jul 2011 08:17:15 -0700 (PDT) From: Tsuneo Saito To: qemu-devel@nongnu.org Date: Fri, 22 Jul 2011 00:16:31 +0900 Message-Id: <1311261393-47400-6-git-send-email-tsnsaito@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1311261393-47400-1-git-send-email-tsnsaito@gmail.com> References: <1311261393-47400-1-git-send-email-tsnsaito@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.173 Cc: Tsuneo Saito Subject: [Qemu-devel] [PATCH 5/7] SPARC64: fix fault status overwritten on nonfaulting load 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 cpu_get_phys_page_nofault() calls get_physical_address() twice, that results in overwriting the fault status in the SFSR. We need this change in order for nonfaulting loads to raising MMU faults as normal loads do. Also removed the call to cpu_get_physical_page_desc() since we are going to modify nonfaulting loads raising MMU faults. Signed-off-by: Tsuneo Saito --- target-sparc/helper.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/target-sparc/helper.c b/target-sparc/helper.c index cb8d706..b6e62a7 100644 --- a/target-sparc/helper.c +++ b/target-sparc/helper.c @@ -752,13 +752,9 @@ target_phys_addr_t cpu_get_phys_page_nofault(CPUState *env, target_ulong addr, { target_phys_addr_t phys_addr; - if (cpu_sparc_get_phys_page(env, &phys_addr, addr, 2, mmu_idx) != 0) { - if (cpu_sparc_get_phys_page(env, &phys_addr, addr, 0, mmu_idx) != 0) { - return -1; - } - } - if (cpu_get_physical_page_desc(phys_addr) == IO_MEM_UNASSIGNED) + if (cpu_sparc_get_phys_page(env, &phys_addr, addr, 0, mmu_idx) != 0) { return -1; + } return phys_addr; } #endif