From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8753AC54EBC for ; Thu, 12 Jan 2023 12:40:15 +0000 (UTC) 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=Bb2LoOXK5N+V98X+1hW+ZIEa6Wmxnyd1tOo2jrhLc7A=; b=xVfR+CjyudNBfJ X263jSPF2AlEImQehucZ9xQy3TqWjHvxiJJaPburmZA4v1IsCBTVh/1Vmln1szA8Y1QEa+EeNtA8g FpWMQp1pzNQpFPT3Cp0f7NZ3AE85R+R4rIkT5yW1QHJqMJhq4agdfZ9kLeBpR7nbrcExCVJdFxk9K u5Z3+gaxd40idsogjkrgonAE/68ldOYSEQLJKYbSLPdYL4k0cHRam8A/njxtS+5HbsuXyzSsbn3Md uzGrVsBhnkmx6qA/v1QLe154/b7Vw5lPL33LmyvCeInPk5qo9IF3l/jgbNWG8SHH1Tr355d/iILXO Az1BAQqPT3WJS162CbPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFwrU-00F0ln-66; Thu, 12 Jan 2023 12:39:16 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFwrG-00F0hr-8S for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 12:39:03 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 717B8B81E5D; Thu, 12 Jan 2023 12:38:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2239FC433EF; Thu, 12 Jan 2023 12:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673527135; bh=TEld5/eWLZ8WYi+kitrePlcWShsqcZJpPVEOUZjvFFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vEM1wAB4VmrHlB3wy0Rl6rFU9Q5d1dk8qZ8H/1COQWeuz/uTsY4AqHBPLc5qxJqdH zg9aHY6D3oLFdaLLf60jHj/h6CEVYyALEH4cYmu+pwQPkO2bGib6Bj68zkHSF7K5vd HB/o4GO4S1E/j5JEg25mPHY0qUq2I3y121JgFQPPXIgb2wLbSZuhsnCMnwxc5/PGyE 4iHua27VRt3fNhd1ixu78U58BWS8PVrlQcBcOW6Srg59Mw3F3uxWcdX3xt+Jl4NH92 qJj3wBJtlnyeHDSP3syEF8tuU2dAHx0udVR3pRoiBf7YA85VZ4+dXJiG1OKQa1sGPH 6Zg2uUJGW82hg== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pFwr7-001BBa-3w; Thu, 12 Jan 2023 12:38:53 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, , , kvm@vger.kernel.org Cc: D Scott Phillips , Ganapatrao Kulkarni , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH 3/3] KVM: arm64: timers: Don't BUG() on unhandled timer trap Date: Thu, 12 Jan 2023 12:38:29 +0000 Message-Id: <20230112123829.458912-4-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112123829.458912-1-maz@kernel.org> References: <20230112123829.458912-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvmarm@lists.linux.dev, kvm@vger.kernel.org, scott@os.amperecomputing.com, gankulkarni@os.amperecomputing.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_043902_464142_588CD050 X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Although not handling a trap is a pretty bad situation to be in, panicing the kernel isn't useful and provides no valuable information to help debugging the situation. Instead, dump the encoding of the unhandled sysreg, and inject an UNDEF in the guest. At least, this gives a user an opportunity to report the issue with some information to help debugging it. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/sys_regs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index d5ee52d6bf73..32f4e424b9a5 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1049,7 +1049,9 @@ static bool access_arch_timer(struct kvm_vcpu *vcpu, treg = TIMER_REG_CVAL; break; default: - BUG(); + print_sys_reg_msg(p, "%s", "Unhandled trapped timer register"); + kvm_inject_undefined(vcpu); + return false; } if (p->is_write) -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel