From patchwork Tue Jan 5 23:19:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor V. Kovalenko" X-Patchwork-Id: 42231 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 E4335B6EEF for ; Wed, 6 Jan 2010 11:53:33 +1100 (EST) Received: from localhost ([127.0.0.1]:39111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSK9T-0004KG-4I for incoming@patchwork.ozlabs.org; Tue, 05 Jan 2010 19:53:31 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSIgJ-00070a-02 for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSIgC-0006qf-2L for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:16 -0500 Received: from [199.232.76.173] (port=56589 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSIgB-0006qL-MC for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:11 -0500 Received: from mail-fx0-f222.google.com ([209.85.220.222]:54407) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSIgB-0008JO-AZ for qemu-devel@nongnu.org; Tue, 05 Jan 2010 18:19:11 -0500 Received: by fxm22 with SMTP id 22so19469351fxm.2 for ; Tue, 05 Jan 2010 15:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:subject:to:from:date :message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=1tSeK3Jyjb4EMspiNDACtEEnWsnxhvjeMcJG9LXVD3Y=; b=vGiGy2hn96sp/MUpR3UEEp6AFVwX/8U7A34PwZtNg/qJNmZL8w8cee9JFm//3AGjZY PpfU14a0qtbzGkTMe7NiwGBUFct4zzUn291LM6qmnua+8m5ZNnEWbaX8Gh133mXNoS1v h3uVBCZ8GMVHdIE7Fi7IPUAGqTBK4tbtGEZUk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:to:from:date:message-id:in-reply-to:references:user-agent :mime-version:content-type:content-transfer-encoding; b=R5rSXPrnl+h/GR/t6VWh+xt/+jxc6NCK2v+qJPv1NFoztieIGBbeeQIX8z6SoAnVMJ DozGAAXsOsc3c6cEI/9I43HV0h9+54Dhq9CVYlAM1NnKHwCMJLeSS/Vlgdd0Z8QQgjW2 7+3r8KG3hfz2Lk8hbcmVPWtjRgxfoF3DBFRls= Received: by 10.223.81.82 with SMTP id w18mr14067181fak.70.1262733549200; Tue, 05 Jan 2010 15:19:09 -0800 (PST) Received: from skyserv (host-87-255-14-75.bigtelecom.ru [87.255.14.75]) by mx.google.com with ESMTPS id 14sm6705083fxm.7.2010.01.05.15.19.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Jan 2010 15:19:08 -0800 (PST) Received: from localhost ([127.0.0.1] helo=[192.168.1.2]) by skyserv with esmtp (Exim 4.71) (envelope-from ) id 1NSIg7-0001jx-VW for qemu-devel@nongnu.org; Wed, 06 Jan 2010 02:19:07 +0300 To: qemu-devel@nongnu.org From: "Igor V. Kovalenko" Date: Wed, 06 Jan 2010 02:19:07 +0300 Message-ID: <20100105231907.6526.37249.stgit@skyserv> In-Reply-To: <20100105231558.6526.44483.stgit@skyserv> References: <20100105231558.6526.44483.stgit@skyserv> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 1/9] sparc64: trace pstate and global register set changes 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 From: Igor V. Kovalenko Signed-off-by: Igor V. Kovalenko --- target-sparc/op_helper.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index dab2c25..26092e5 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -11,6 +11,7 @@ //#define DEBUG_UNASSIGNED //#define DEBUG_ASI //#define DEBUG_PCALL +//#define DEBUG_PSTATE #ifdef DEBUG_MMU #define DPRINTF_MMU(fmt, ...) \ @@ -31,6 +32,13 @@ do { printf("ASI: " fmt , ## __VA_ARGS__); } while (0) #endif +#ifdef DEBUG_PSTATE +#define DPRINTF_PSTATE(fmt, ...) \ + do { printf("PSTATE: " fmt , ## __VA_ARGS__); } while (0) +#else +#define DPRINTF_PSTATE(fmt, ...) do {} while (0) +#endif + #ifdef TARGET_SPARC64 #ifndef TARGET_ABI32 #define AM_CHECK(env1) ((env1)->pstate & PS_AM) @@ -3244,6 +3252,12 @@ static inline uint64_t *get_gregset(uint64_t pstate) { switch (pstate) { default: + DPRINTF_PSTATE("ERROR in get_gregset: active pstate bits=%lX %s %s %s", + pstate, + (pstate&PS_IG)?"IG":"", + (pstate&PS_MG)?"MG":"", + (pstate&PS_AG)?"AG":"" ); + /* pass through to normal set of global registers */ case 0: return env->bgregs; case PS_AG: @@ -3269,12 +3283,18 @@ static inline void change_pstate(uint64_t new_pstate) new_pstate_regs = new_pstate & 0xc01; if (new_pstate_regs != pstate_regs) { + DPRINTF_PSTATE("change_pstate: switching regs old=%lX new=%lX\n", + pstate_regs, new_pstate_regs); // Switch global register bank src = get_gregset(new_pstate_regs); dst = get_gregset(pstate_regs); memcpy32(dst, env->gregs); memcpy32(env->gregs, src); } + else { + DPRINTF_PSTATE("change_pstate: regs new=%lX (unchanged)\n", + new_pstate_regs); + } env->pstate = new_pstate; }