From nobody Tue Oct 14 10:34:44 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1588828044; cv=none; d=zohomail.com; s=zohoarc; b=TYOQq4QeRS/jdI8wUG4Z9jhqFE3scxyiGF6/RbupS5AO5mVCgqO3efXYbBL+nqee8iKolc6WYnUglWmgnyMShh/QQEh3oRolq+XsODYDVZx4tPxJHyn4QoZiSScjsv6KwamScDC3sSysAbCgdKzyIVJz2WC6JgOIwNad8g2swHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588828044; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yWUlRjunMOV8mW8jUPrc0n8wZtuV3wm2TswOflHhE0w=; b=jvQmrA4UL4EESla6ewNY681FjqI5/dwBPTbV5sW/JPzCCrO8nsQj7wc4s4lneO+3syk4daKU6FwrTIBayi2Rd7u0jmMcvFNrL0mS2p2RTgLFjxynemCEd8N0dLGGWNEhyvfxu2rrALO9mjKUKrAzqbcaYO/+18zUx76b1WnZpkc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588828044835837.0730963643887; Wed, 6 May 2020 22:07:24 -0700 (PDT) Received: from localhost ([::1]:49508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWYkl-0004gr-HD for importer@patchew.org; Thu, 07 May 2020 01:07:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWYht-0007V7-N8; Thu, 07 May 2020 01:04:25 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:52449 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWYhr-00070N-G7; Thu, 07 May 2020 01:04:25 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 49HhFn268fz9sRY; Thu, 7 May 2020 15:04:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1588827853; bh=m9jI1TLvGlY1glLjzeD6ysxs6fYmaEobrj3tLK7VEls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dbq1S3e+PaYw53mw8bYwG6V87MhTcRKmvGEAbKQU7+jSApL8kmSLt2VRgxOBwa5EC HQ5CY2UtvwBr3azlVVjvh/lrgaKJajYrFed7DNwiBBntpfS4VQ42x/BeyHalIjwRZ9 8V2XGnX4BB8HV4Tn2u+u7Kq5h1E5T6UPZBjnVRO0= From: David Gibson To: peter.maydell@linaro.org Subject: [PULL 01/18] target/ppc: Improve syscall exception logging Date: Thu, 7 May 2020 15:02:11 +1000 Message-Id: <20200507050228.802395-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200507050228.802395-1-david@gibson.dropbear.id.au> References: <20200507050228.802395-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=203.11.71.1; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 01:04:14 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aik@ozlabs.ru, qemu-devel@nongnu.org, npiggin@gmail.com, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin system calls (at least in Linux) use registers r3-r8 for inputs, so include those registers in the dump. This also adds a mode for PAPR hcalls, which have a different calling convention. Signed-off-by: Nicholas Piggin Message-Id: <20200317054918.199161-1-npiggin@gmail.com> Signed-off-by: David Gibson --- target/ppc/excp_helper.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 08bc885ca6..81ee19ebae 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -57,12 +57,29 @@ static void ppc_hw_interrupt(CPUPPCState *env) #else /* defined(CONFIG_USER_ONLY) */ static inline void dump_syscall(CPUPPCState *env) { - qemu_log_mask(CPU_LOG_INT, "syscall r0=3D%016" PRIx64 " r3=3D%016" PRI= x64 - " r4=3D%016" PRIx64 " r5=3D%016" PRIx64 " r6=3D%016" PRI= x64 + qemu_log_mask(CPU_LOG_INT, "syscall r0=3D%016" PRIx64 + " r3=3D%016" PRIx64 " r4=3D%016" PRIx64 " r5=3D%016" PRI= x64 + " r6=3D%016" PRIx64 " r7=3D%016" PRIx64 " r8=3D%016" PRI= x64 " nip=3D" TARGET_FMT_lx "\n", ppc_dump_gpr(env, 0), ppc_dump_gpr(env, 3), ppc_dump_gpr(env, 4), ppc_dump_gpr(env, 5), - ppc_dump_gpr(env, 6), env->nip); + ppc_dump_gpr(env, 6), ppc_dump_gpr(env, 7), + ppc_dump_gpr(env, 8), env->nip); +} + +static inline void dump_hcall(CPUPPCState *env) +{ + qemu_log_mask(CPU_LOG_INT, "hypercall r3=3D%016" PRIx64 + " r4=3D%016" PRIx64 " r5=3D%016" PRIx64 " r6=3D%016" PRIx64 + " r7=3D%016" PRIx64 " r8=3D%016" PRIx64 " r9=3D%016" PRIx64 + " r10=3D%016" PRIx64 " r11=3D%016" PRIx64 " r12=3D%016" PRIx64 + " nip=3D" TARGET_FMT_lx "\n", + ppc_dump_gpr(env, 3), ppc_dump_gpr(env, 4), + ppc_dump_gpr(env, 5), ppc_dump_gpr(env, 6), + ppc_dump_gpr(env, 7), ppc_dump_gpr(env, 8), + ppc_dump_gpr(env, 9), ppc_dump_gpr(env, 10), + ppc_dump_gpr(env, 11), ppc_dump_gpr(env, 12), + env->nip); } =20 static int powerpc_reset_wakeup(CPUState *cs, CPUPPCState *env, int excp, @@ -379,9 +396,14 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int e= xcp_model, int excp) } break; case POWERPC_EXCP_SYSCALL: /* System call exception = */ - dump_syscall(env); lev =3D env->error_code; =20 + if ((lev =3D=3D 1) && cpu->vhyp) { + dump_hcall(env); + } else { + dump_syscall(env); + } + /* * We need to correct the NIP which in this case is supposed * to point to the next instruction --=20 2.26.2