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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4392AC433E0 for ; Fri, 19 Mar 2021 09:51:39 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id AAC4A64F6A for ; Fri, 19 Mar 2021 09:51:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAC4A64F6A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3C97F4B615; Fri, 19 Mar 2021 05:51:38 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rtz6XCMOsgPT; Fri, 19 Mar 2021 05:51:37 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 003B84B562; Fri, 19 Mar 2021 05:51:37 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2CA694B53A for ; Fri, 19 Mar 2021 05:51:36 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pXodEAnFFVQZ for ; Fri, 19 Mar 2021 05:51:35 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id CE04A4B444 for ; Fri, 19 Mar 2021 05:51:34 -0400 (EDT) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 229FC64F6A; Fri, 19 Mar 2021 09:51:32 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lNBn0-002Zpt-2W; Fri, 19 Mar 2021 09:51:30 +0000 Date: Fri, 19 Mar 2021 09:51:29 +0000 Message-ID: <87v99nh3oe.wl-maz@kernel.org> From: Marc Zyngier To: Will Deacon Subject: Re: [PATCH v3 5/5] KVM: arm64: Log source when panicking from nVHE hyp In-Reply-To: <20210318165946.GA7656@willie-the-truck> References: <20210318143311.839894-1-ascull@google.com> <20210318143311.839894-6-ascull@google.com> <20210318165946.GA7656@willie-the-truck> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: will@kernel.org, ascull@google.com, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, suzuki.poulose@arm.com, julien.thierry.kdev@gmail.com, catalin.marinas@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: catalin.marinas@arm.com, kernel-team@android.com, kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Thu, 18 Mar 2021 16:59:47 +0000, Will Deacon wrote: > > On Thu, Mar 18, 2021 at 02:33:11PM +0000, Andrew Scull wrote: > > To aid with debugging, add details of the source of a panic from nVHE > > hyp. This is done by having nVHE hyp exit to nvhe_hyp_panic_handler() > > rather than directly to panic(). The handler will then add the extra > > details for debugging before panicking the kernel. > > > > If the panic was due to a BUG(), look up the metadata to log the file > > and line, if available, otherwise log an address that can be looked up > > in vmlinux. The hyp offset is also logged to allow other hyp VAs to be > > converted, similar to how the kernel offset is logged during a panic. > > > > __hyp_panic_string is now inlined since it no longer needs to be > > referenced as a symbol and the message is free to diverge between VHE > > and nVHE. > > > > The following is an example of the logs generated by a BUG in nVHE hyp. > > > > [ 46.754840] kvm [307]: nVHE hyp BUG at: arch/arm64/kvm/hyp/nvhe/switch.c:242! > > [ 46.755357] kvm [307]: Hyp Offset: 0xfffea6c58e1e0000 > > [ 46.755824] Kernel panic - not syncing: HYP panic: > > [ 46.755824] PS:400003c9 PC:0000d93a82c705ac ESR:f2000800 > > [ 46.755824] FAR:0000000080080000 HPFAR:0000000000800800 PAR:0000000000000000 > > [ 46.755824] VCPU:0000d93a880d0000 > > [ 46.756960] CPU: 3 PID: 307 Comm: kvm-vcpu-0 Not tainted 5.12.0-rc3-00005-gc572b99cf65b-dirty #133 > > [ 46.757459] Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 > > [ 46.758366] Call trace: > > [ 46.758601] dump_backtrace+0x0/0x1b0 > > [ 46.758856] show_stack+0x18/0x70 > > [ 46.759057] dump_stack+0xd0/0x12c > > [ 46.759236] panic+0x16c/0x334 > > [ 46.759426] arm64_kernel_unmapped_at_el0+0x0/0x30 > > [ 46.759661] kvm_arch_vcpu_ioctl_run+0x134/0x750 > > [ 46.759936] kvm_vcpu_ioctl+0x2f0/0x970 > > [ 46.760156] __arm64_sys_ioctl+0xa8/0xec > > [ 46.760379] el0_svc_common.constprop.0+0x60/0x120 > > [ 46.760627] do_el0_svc+0x24/0x90 > > [ 46.760766] el0_svc+0x2c/0x54 > > [ 46.760915] el0_sync_handler+0x1a4/0x1b0 > > [ 46.761146] el0_sync+0x170/0x180 > > [ 46.761889] SMP: stopping secondary CPUs > > [ 46.762786] Kernel Offset: 0x3e1cd2820000 from 0xffff800010000000 > > [ 46.763142] PHYS_OFFSET: 0xffffa9f680000000 > > [ 46.763359] CPU features: 0x00240022,61806008 > > [ 46.763651] Memory Limit: none > > Nice! > > > [ 46.813867] ---[ end Kernel panic - not syncing: HYP panic: > > [ 46.813867] PS:400003c9 PC:0000d93a82c705ac ESR:f2000800 > > [ 46.813867] FAR:0000000080080000 HPFAR:0000000000800800 PAR:0000000000000000 > > [ 46.813867] VCPU:0000d93a880d0000 ]--- > > Why did these last three lines get printed twice? That's the panic string that gets repeated, a standard "feature" of the panic code: root@tiger-roach:~# echo -n 'c' > /proc/sysrq-trigger [250622.941867] sysrq: Trigger a crash [250622.941903] Kernel panic - not syncing: sysrq triggered crash [250622.945515] CPU: 0 PID: 4890 Comm: bash Tainted: G E 5.11.0 #3124 [250622.952930] Hardware name: , BIOS 2021.01-rc2-00012-gde865f7ee1 11/16/2020 [250622.959917] Call trace: [250622.962417] dump_backtrace+0x0/0x1e4 [250622.966126] show_stack+0x24/0x80 [250622.969490] dump_stack+0xc8/0x120 [250622.972940] panic+0x178/0x38c [250622.976045] sysrq_handle_crash+0x28/0x30 [250622.980098] __handle_sysrq+0x98/0x1a4 [250622.983893] write_sysrq_trigger+0x94/0x12c [250622.988120] proc_reg_write+0xb4/0xf0 [250622.991828] vfs_write+0xfc/0x29c [250622.995192] ksys_write+0x74/0x100 [250622.998642] __arm64_sys_write+0x28/0x3c [250623.002610] el0_svc_common.constprop.0+0x80/0x1c0 [250623.007440] do_el0_svc+0x30/0xa0 [250623.010803] el0_svc+0x28/0x70 [250623.013908] el0_sync_handler+0x1a8/0x1ac [250623.017962] el0_sync+0x174/0x180 [250623.021331] SMP: stopping secondary CPUs [250623.025301] Kernel Offset: 0x435917bf0000 from 0xffff800010000000 [250623.031417] PHYS_OFFSET: 0xffff9bc5c0000000 [250623.035643] CPU features: 0x08240022,2aa0a830 [250623.040042] Memory Limit: none [250623.043153] ---[ end Kernel panic - not syncing: sysrq triggered crash ]--- KVM just happens to have a fairly large, multi line panic string. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm