From nobody Fri Dec 19 17:42:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539338767302883.5787038851884; Fri, 12 Oct 2018 03:06:07 -0700 (PDT) Received: from localhost ([::1]:39314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAuKZ-00043f-0C for importer@patchew.org; Fri, 12 Oct 2018 06:06:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAuFw-0000pP-2k for qemu-devel@nongnu.org; Fri, 12 Oct 2018 06:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAuFt-0007RO-KX for qemu-devel@nongnu.org; Fri, 12 Oct 2018 06:01:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gAuFt-0007R6-Ai; Fri, 12 Oct 2018 06:01:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8BD36750DC; Fri, 12 Oct 2018 10:01:12 +0000 (UTC) Received: from localhost (dhcp-192-213.str.redhat.com [10.33.192.213]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A42860476; Fri, 12 Oct 2018 10:01:09 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Fri, 12 Oct 2018 12:00:54 +0200 Message-Id: <20181012100101.29058-2-cohuck@redhat.com> In-Reply-To: <20181012100101.29058-1-cohuck@redhat.com> References: <20181012100101.29058-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 12 Oct 2018 10:01:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/8] target/s390x/excp_helper: Remove DPRINTF() macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Debug macros that are disabled by default should be avoided (since the code bit-rots quite easily). Thus turn these debug prints into proper qemu_log_mask(CPU_LOG_xxx, ...) statements instead. The DPRINTF statements in do_[ext|io|mchk]_interrupt can even be removed completely since we can log the information in a central place, s390_cpu_do_interrupt, instead. Signed-off-by: Thomas Huth Message-Id: <1538751601-7433-1-git-send-email-thuth@redhat.com> Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck --- target/s390x/excp_helper.c | 48 +++++++++++-------------------------------= ---- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index cd76c3163a..2a33222f7e 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -33,23 +33,6 @@ #include "hw/s390x/s390_flic.h" #endif =20 -/* #define DEBUG_S390 */ -/* #define DEBUG_S390_STDOUT */ - -#ifdef DEBUG_S390 -#ifdef DEBUG_S390_STDOUT -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); \ - if (qemu_log_separate()) { qemu_log(fmt, ##__VA_ARGS__); } } whil= e (0) -#else -#define DPRINTF(fmt, ...) \ - do { qemu_log(fmt, ## __VA_ARGS__); } while (0) -#endif -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) -#endif - void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XState *env, uint32_t= code, int ilen, uintptr_t ra) { @@ -128,8 +111,8 @@ int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_= vaddr, int size, uint64_t asc; int prot; =20 - DPRINTF("%s: address 0x%" VADDR_PRIx " rw %d mmu_idx %d\n", - __func__, orig_vaddr, rw, mmu_idx); + qemu_log_mask(CPU_LOG_MMU, "%s: addr 0x%" VADDR_PRIx " rw %d mmu_idx %= d\n", + __func__, orig_vaddr, rw, mmu_idx); =20 vaddr =3D orig_vaddr; =20 @@ -158,8 +141,9 @@ int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_= vaddr, int size, if (!address_space_access_valid(&address_space_memory, raddr, TARGET_PAGE_SIZE, rw, MEMTXATTRS_UNSPECIFIED)) { - DPRINTF("%s: raddr %" PRIx64 " > ram_size %" PRIx64 "\n", __func__, - (uint64_t)raddr, (uint64_t)ram_size); + qemu_log_mask(CPU_LOG_MMU, + "%s: raddr %" PRIx64 " > ram_size %" PRIx64 "\n", + __func__, (uint64_t)raddr, (uint64_t)ram_size); trigger_pgm_exception(env, PGM_ADDRESSING, ILEN_AUTO); return 1; } @@ -217,8 +201,10 @@ static void do_program_interrupt(CPUS390XState *env) break; } =20 - qemu_log_mask(CPU_LOG_INT, "%s: code=3D0x%x ilen=3D%d\n", - __func__, env->int_pgm_code, ilen); + qemu_log_mask(CPU_LOG_INT, + "%s: code=3D0x%x ilen=3D%d psw: %" PRIx64 " %" PRIx64 "\= n", + __func__, env->int_pgm_code, ilen, env->psw.mask, + env->psw.addr); =20 lowcore =3D cpu_map_lowcore(env); =20 @@ -240,10 +226,6 @@ static void do_program_interrupt(CPUS390XState *env) =20 cpu_unmap_lowcore(lowcore); =20 - DPRINTF("%s: %x %x %" PRIx64 " %" PRIx64 "\n", __func__, - env->int_pgm_code, ilen, env->psw.mask, - env->psw.addr); - load_psw(env, mask, addr); } =20 @@ -334,9 +316,6 @@ static void do_ext_interrupt(CPUS390XState *env) =20 cpu_unmap_lowcore(lowcore); =20 - DPRINTF("%s: %" PRIx64 " %" PRIx64 "\n", __func__, - env->psw.mask, env->psw.addr); - load_psw(env, mask, addr); } =20 @@ -365,8 +344,6 @@ static void do_io_interrupt(CPUS390XState *env) cpu_unmap_lowcore(lowcore); g_free(io); =20 - DPRINTF("%s: %" PRIx64 " %" PRIx64 "\n", __func__, env->psw.mask, - env->psw.addr); load_psw(env, mask, addr); } =20 @@ -408,9 +385,6 @@ static void do_mchk_interrupt(CPUS390XState *env) =20 cpu_unmap_lowcore(lowcore); =20 - DPRINTF("%s: %" PRIx64 " %" PRIx64 "\n", __func__, - env->psw.mask, env->psw.addr); - load_psw(env, mask, addr); } =20 @@ -421,8 +395,8 @@ void s390_cpu_do_interrupt(CPUState *cs) CPUS390XState *env =3D &cpu->env; bool stopped =3D false; =20 - qemu_log_mask(CPU_LOG_INT, "%s: %d at pc=3D%" PRIx64 "\n", - __func__, cs->exception_index, env->psw.addr); + qemu_log_mask(CPU_LOG_INT, "%s: %d at psw=3D%" PRIx64 ":%" PRIx64 "\n", + __func__, cs->exception_index, env->psw.mask, env->psw.a= ddr); =20 try_deliver: /* handle machine checks */ --=20 2.14.4