From nobody Tue Nov 4 18: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; 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15305402007853.9264607392076414; Mon, 2 Jul 2018 07:03:20 -0700 (PDT) Received: from localhost ([::1]:32960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzQG-0005kr-1v for importer@patchew.org; Mon, 02 Jul 2018 10:03:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzLS-0002AA-I8 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzLR-0007sc-Mj for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:22 -0400 Received: from mail-pl0-x22c.google.com ([2607:f8b0:400e:c01::22c]:46719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzLR-0007sK-HD for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:21 -0400 Received: by mail-pl0-x22c.google.com with SMTP id 30-v6so7999943pld.13 for ; Mon, 02 Jul 2018 06:58:21 -0700 (PDT) Received: from localhost (g90.124-44-6.ppp.wakwak.ne.jp. [124.44.6.90]) by smtp.gmail.com with ESMTPSA id p12-v6sm5628601pfj.21.2018.07.02.06.58.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 06:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zf+D1raeWsoWAsHnT7ef46EOTupNmWqr70cskO2ieC0=; b=WOMSxSE4vhYYTpYFYKjKqRLlNSakkOrNwFynD7ywt+xOcrrsQC+mfGQ6XRKYri4JVQ eY2NRB8SGZKD9z4hkhXIQYqp3vUlv/4GclH4OOHhXpJ8Z0LYwpjx+BAKwVCwk2hHejf7 R5uUqLunjTFR2vWuqNmYYlAj60aWklmuukbXi9O5Sgp6rmggQdCRSE0EwMeew8mkXAx9 f5lMwP7VQ/8P11GWU5GJrQgok5RhGSNjSx+3+vw46JkNRYgLL+GTuhDY4x1P/1JZSKFt F2500LMLKzLfzqjxwLe7hgSUqIffoxeTk3qmRlQk144Y+1tTXjl8F1M1v3n9o/zWNgHK aApg== 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:mime-version:content-transfer-encoding; bh=Zf+D1raeWsoWAsHnT7ef46EOTupNmWqr70cskO2ieC0=; b=U9ynIhwAiQITgVI+Qd+Y04AJkpyfzX+6KWmPu7D4smUKv+Wmprr4XX7Uxasw46/lsy fjLTrykVeQYuVuPImtoF86cVJXRbVe1TSdwDJBhqaRr2ZdCVdTUI7KfCWnhi8nCsoCWa kt/MEIp3tV5NYIYe4NhE18UX3Z9/U/LvAkqYDlK8KsnaNpcn+dmeBh7KyC9H6sR91K/l 8Ecq0XkDjtZ3Pd7mYeP/RChUioS2EPfRbPeeohHa4UoAPoBKftg/Iml3duEh2gkKRE6w K8GVk8pO8wpXkMMN17AObc02J7tlJXHmKN/0e+4D1DSLbL0af05mGmBzR5Oce7WAClT+ tbvg== X-Gm-Message-State: APt69E1IbYvmCWwBsQ6Q2pDhHPk0Yl8CjWZosd4XeDGx+BZU8dAz9OHk ZQaVUVlQ4anAxB0Lavq0skk= X-Google-Smtp-Source: AAOMgpeShJ8Q+SIMNVo5ueUgeaf7VkgjAtVaHd2wcArhplZ7nPOTOMZZTfminnEZ6m+ajISQLIGcVA== X-Received: by 2002:a17:902:7790:: with SMTP id o16-v6mr21377009pll.130.1530539900527; Mon, 02 Jul 2018 06:58:20 -0700 (PDT) From: Stafford Horne To: Peter Maydell Date: Mon, 2 Jul 2018 22:57:44 +0900 Message-Id: <20180702135806.7087-4-shorne@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180702135806.7087-1-shorne@gmail.com> References: <20180702135806.7087-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22c Subject: [Qemu-devel] [PULL 03/25] 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 , Richard Henderson , QEMU Development 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 From: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Signed-off-by: Stafford Horne --- 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 3959671c59..25351d5de3 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 @@ -66,8 +67,27 @@ void openrisc_cpu_do_interrupt(CPUState *cs) env->tlb->cpu_openrisc_map_address_code =3D &cpu_openrisc_get_phys_nom= mu; 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; } @@ -76,7 +96,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