Message ID | 20240305170858.395836-16-andrew.jones@linux.dev |
---|---|
State | Handled Elsewhere |
Headers | show
Return-Path: <kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=HzCpi66F; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=iG2l4nRZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tq2934kspz23cm for <incoming@patchwork.ozlabs.org>; Wed, 6 Mar 2024 04:09:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MT0i6j4sJQZ/RGJ1vG8gVlup8K9OPzAzoCQ4Ffk+03U=; b=HzCpi66FOHIVR4 EXh8xN9vpOqcxTtC1baOcRK0QqJMrUCGFuE8C6H1ZXfv0jEmBr0P9r8aiYyl6X15oRcwlTzZzDslI 4uFDomx+F7yuAcx7VQiixXhDHuGl3lod7gtikgQU3Zl738901tuK6xuyHn8QEZHPMObHKIHLCmM+8 YzGvFnTh/BV7I8wNFEIiAUyHfej4Dmds7bZu1iuz1yH69d8TBIhaIpK0LwL8od1om+lc6V0kTUGSA D1SdS55NLY5h5DdBu1kMedIGEW48eXyk305FUc9BL5EIMdXGKRvziOHvgKfauV5u7fzZpWXwvO6P7 GNgB0NH73gTSWWBZSHGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhYHu-0000000Ecdz-17oW; Tue, 05 Mar 2024 17:09:10 +0000 Received: from out-176.mta1.migadu.com ([95.215.58.176]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhYHq-0000000EcbB-3IJa for kvm-riscv@lists.infradead.org; Tue, 05 Mar 2024 17:09:08 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1709658543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pyNpBUKcARGpXHjRUw7DJh9Dq78hNbBbT/1+T9CAHjU=; b=iG2l4nRZ+a7QyDVk+XleURCzZV28ZCTeHBUS1A16xBsxWVr2jm5tJQ1IaBQZPnrHPPiV3s jBmiKOQpejihjvMUGCXI7XumtL0OWfQHKJ2U3SrbSTDrZbjI6MUBiTxJ+BCY1/5C7S0HsY zl/ojmL19LEmu0kE+Tf95m9t3TsbrHc= From: Andrew Jones <andrew.jones@linux.dev> To: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Cc: pbonzini@redhat.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH v2 01/13] riscv: Call abort instead of assert on unhandled exceptions Date: Tue, 5 Mar 2024 18:09:00 +0100 Message-ID: <20240305170858.395836-16-andrew.jones@linux.dev> In-Reply-To: <20240305170858.395836-15-andrew.jones@linux.dev> References: <20240305170858.395836-15-andrew.jones@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240305_090907_184240_D269C767 X-CRM114-Status: UNSURE ( 7.09 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: We should call abort() instead of assert() on an unhandled exception since assert() calls abort() anyway after a useless "assert failed: 0" message. We can also skip dumping the exception stack and ju [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <kvm-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/kvm-riscv>, <mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/kvm-riscv/> List-Post: <mailto:kvm-riscv@lists.infradead.org> List-Help: <mailto:kvm-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/kvm-riscv>, <mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kvm-riscv" <kvm-riscv-bounces@lists.infradead.org> Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
Enable EFI support
|
expand
|
diff --git a/lib/riscv/processor.c b/lib/riscv/processor.c index e0904209c0da..6c868b805cf7 100644 --- a/lib/riscv/processor.c +++ b/lib/riscv/processor.c @@ -43,7 +43,8 @@ void do_handle_exception(struct pt_regs *regs) } show_regs(regs); - assert(0); + dump_frame_stack((void *)regs->epc, (void *)regs->s0); + abort(); } void install_exception_handler(unsigned long cause, void (*handler)(struct pt_regs *))
We should call abort() instead of assert() on an unhandled exception since assert() calls abort() anyway after a useless "assert failed: 0" message. We can also skip dumping the exception stack and just unwind from the stack frame where the exception occurred. Signed-off-by: Andrew Jones <andrew.jones@linux.dev> --- lib/riscv/processor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)