From nobody Sun Nov 2 16:26:21 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; dkim=fail; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527431492850174.61278678726183; Sun, 27 May 2018 07:31:32 -0700 (PDT) Received: from localhost ([::1]:52286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMwho-0004va-56 for importer@patchew.org; Sun, 27 May 2018 10:31:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMwQl-0000FE-Jd for qemu-devel@nongnu.org; Sun, 27 May 2018 10:13:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMwQk-0004Sq-Jo for qemu-devel@nongnu.org; Sun, 27 May 2018 10:13:55 -0400 Received: from mail-pl0-x234.google.com ([2607:f8b0:400e:c01::234]:44017) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMwQk-0004Sg-DY for qemu-devel@nongnu.org; Sun, 27 May 2018 10:13:54 -0400 Received: by mail-pl0-x234.google.com with SMTP id c41-v6so5723075plj.10 for ; Sun, 27 May 2018 07:13:54 -0700 (PDT) Received: from cloudburst.twiddle.net (50-233-235-3-static.hfc.comcastbusiness.net. [50.233.235.3]) by smtp.gmail.com with ESMTPSA id b89-v6sm66680075pfd.85.2018.05.27.07.13.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 May 2018 07:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mVb3t4+y7hnsheVsWbac+TnqOmfOqpORDJrwAHjqGAQ=; b=VoYPgJUmcblCdOW4jllfsklxM6o3B57ZpluMvbeXs7nVpSlpKhdDhCcvrzKgLGP4mn tqP54Q4NuW0QinCpgxAHK0mmT1G0DRwc8scaiXShu6fM3MbvXz0HXyDTA2z1hgxgCTjN W9iWbqyRXwZqEM6Y6MRjdAKFoAuXAhOYqZeLo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mVb3t4+y7hnsheVsWbac+TnqOmfOqpORDJrwAHjqGAQ=; b=Ammv+kO1lQ2JLXYSPG6eleaJ2PffQbD23LHcHCFL2HW0G2qNDd6wcOnM1SjuQjeRKM mHEPVFNeDjLZPJZId7GsOf7pg/HkQ3d68802pA7NJtgwATEVoQ0lI4CJpKl4Wn3tdKsQ en4dY6Slqg/qpSdX4ca+mAZroVaIpat26vXtnqztv9923bv3U1IrLyw0sLfRn4cTDufV D2Wh11fS8nmEJpUVi5Y4QsFnpt3T/WQxD5P6a89tu1sVeAC10yN8f18di0uj95aJvmIN WG+IfvYq5y3ZXHcrbriMhtr6Bg+P4nItsdJzs0bg1uf3c3Wo0FwfwvLXwIQquMUMYkrF JooQ== X-Gm-Message-State: ALKqPwdmLaj2Av/r+anyE1SA+ANuXAJ5oESh26UzMov7gaIrwXUfF7UN SFfpEynSopU/P0+TRZVzP2cmUNlXoIeg2g== X-Google-Smtp-Source: AB8JxZqpHjCXuH8hoFb7qfhLANQUB+qp7OIL2skjbONBCLR/h32aBtb29oZvK+m5ewGcROA7Ik9Kug== X-Received: by 2002:a17:902:8a82:: with SMTP id p2-v6mr10035780plo.244.1527430433164; Sun, 27 May 2018 07:13:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 27 May 2018 09:13:20 -0500 Message-Id: <20180527141324.11937-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180527141324.11937-1-richard.henderson@linaro.org> References: <20180527141324.11937-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::234 Subject: [Qemu-devel] [PATCH 16/20] target/openrisc: Log interrupts 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: Stafford Horne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/openrisc/interrupt.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index e28042856a..138ad17f00 100644 --- a/target/openrisc/interrupt.c +++ b/target/openrisc/interrupt.c @@ -32,6 +32,7 @@ void openrisc_cpu_do_interrupt(CPUState *cs) #ifndef CONFIG_USER_ONLY OpenRISCCPU *cpu =3D OPENRISC_CPU(cs); CPUOpenRISCState *env =3D &cpu->env; + int exception =3D cs->exception_index; =20 env->epcr =3D env->pc; if (env->dflag) { @@ -41,12 +42,12 @@ void openrisc_cpu_do_interrupt(CPUState *cs) } else { env->sr &=3D ~SR_DSX; } - if (cs->exception_index =3D=3D EXCP_SYSCALL) { + if (exception =3D=3D EXCP_SYSCALL) { env->epcr +=3D 4; } /* When we have an illegal instruction the error effective address shall be set to the illegal instruction address. */ - if (cs->exception_index =3D=3D EXCP_ILLEGAL) { + if (exception =3D=3D EXCP_ILLEGAL) { env->eear =3D env->pc; } =20 @@ -60,8 +61,27 @@ void openrisc_cpu_do_interrupt(CPUState *cs) env->pmr &=3D ~PMR_SME; env->lock_addr =3D -1; =20 - if (cs->exception_index > 0 && cs->exception_index < EXCP_NR) { - hwaddr vect_pc =3D cs->exception_index << 8; + if (exception > 0 && exception < EXCP_NR) { + static const char * const int_name[EXCP_NR] =3D { + [EXCP_RESET] =3D "RESET", + [EXCP_BUSERR] =3D "BUSERR (bus error)", + [EXCP_DPF] =3D "DFP (data protection fault)", + [EXCP_IPF] =3D "IPF (code protection fault)", + [EXCP_TICK] =3D "TICK (timer interrupt)", + [EXCP_ALIGN] =3D "ALIGN", + [EXCP_ILLEGAL] =3D "ILLEGAL", + [EXCP_INT] =3D "INT (device interrupt)", + [EXCP_DTLBMISS] =3D "DTLBMISS (data tlb miss)", + [EXCP_ITLBMISS] =3D "ITLBMISS (code tlb miss)", + [EXCP_RANGE] =3D "RANGE", + [EXCP_SYSCALL] =3D "SYSCALL", + [EXCP_FPE] =3D "FPE", + [EXCP_TRAP] =3D "TRAP", + }; + + qemu_log_mask(CPU_LOG_INT, "INT: %s\n", int_name[exception]); + + hwaddr vect_pc =3D exception << 8; if (env->cpucfgr & CPUCFGR_EVBARP) { vect_pc |=3D env->evbar; } @@ -70,7 +90,7 @@ void openrisc_cpu_do_interrupt(CPUState *cs) } env->pc =3D vect_pc; } else { - cpu_abort(cs, "Unhandled exception 0x%x\n", cs->exception_index); + cpu_abort(cs, "Unhandled exception 0x%x\n", exception); } #endif =20 --=20 2.17.0