From nobody Wed Aug 24 19:25:15 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MCbf32Pw2z4ZfdS; Wed, 24 Aug 2022 19:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MCbf31yzNz3Pyr; Wed, 24 Aug 2022 19:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661369115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xGd6koqInFYiQjuZ5Ddjet5y7Weu8CaxSE513FYtKMk=; b=beB7X6rKpKdzDlBirBZEicv1XPvBy6e5jDYKt2BCGQJvHtBcMRHq8RB2ep9+wmI1MUpcDP fAzolHeW2xv9eBggJQSF/I0KvYWT00DAmcWQr+ZZl1dLCOcjq9jlQvjJ2AISKT49jJN2ee 63O/VaHyeyUGPe5W0Bd++fberWLYPlfGAlcnemDJ4HhwzhXix3MjPsb4X8bgDseHL0DDTj zV+0t+rOBGwt3xMfSO4gRWlrXgLE5uT6QiObmosgEN1D+c89nzzPSkuXP/65FNEpK7yfNS wo6dpB+mmG/xOlfUiWPgQnwp4KbmqXEgPn5515g27lPlVUCbQ4IySN7zp5z5RQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MCbf314HczLHh; Wed, 24 Aug 2022 19:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27OJPFVJ069221; Wed, 24 Aug 2022 19:25:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27OJPFl2069220; Wed, 24 Aug 2022 19:25:15 GMT (envelope-from git) Date: Wed, 24 Aug 2022 19:25:15 GMT Message-Id: <202208241925.27OJPFl2069220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0f906b30e6fa - main - i386: print all GPRs, PSL, and CR3 on double fault List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f906b30e6fa5bed3c8468a6cab3847cf6909936 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661369115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xGd6koqInFYiQjuZ5Ddjet5y7Weu8CaxSE513FYtKMk=; b=OEU5hUQgL5susbV2sKGCa0wbH2HLMZ0UwP33ZGqi/ISao5BMFZcYJ8rs9ACh0eQWgdFUN3 uSLbqaI1XgHCS5ZVJupZU8Ww63WNHu+bM7esQNTCrv+y807YBxN+1EPBHSBzAw8upK9sUV UCwUjXf8JSOlzftQDTr3jNk93xUCBuVtTqO9/xEMHcdpNgo09RvkxrSyLZOU8a5kCNpHu0 wCI39RJcXaevvMyC7CFtgsvKszO326aX/50bN7xXGZqBE1Ul+nF+x8WFrM/2/m4PsmErZn 80ciXY7g/W2EanVQtKHebspTrEZtAUnT8XvGoJDQ5Lu0CDzh0iXrSt/3Vgm9fQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661369115; a=rsa-sha256; cv=none; b=K+7DXuner8eMey65JmqqMW/S1mvhzjvmlwMoO3AGjWYMMjpIz0qI9eZbyLi9shDb3sSO5M WKHXSBiZE0iKBPO/PEWGYh5XK3RLuUPBmkAICpsT4GOl8iI+izc9isE/IFuQ09WN7KYbi6 o0rLH85jzy/dRzVlcpqbtq9XoJ9HEcnWxPEPar+GoIeuLaUsMujTzj25Llwnk+DP2vtDFJ Pb+gipNp0UYrAkXMGT9xf20RbSQtwn/V3nc686gN8ckQXvAk77eQT38nsTS/rHUZLdN9Cm 49/1XToQx1HN8njLWck/7Yc49Dde5TlxE69QzQ5X4Cv2tHBSFv6NSEd3nnLkFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0f906b30e6fa5bed3c8468a6cab3847cf6909936 commit 0f906b30e6fa5bed3c8468a6cab3847cf6909936 Author: Konstantin Belousov AuthorDate: 2022-08-18 04:16:09 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-24 19:12:30 +0000 i386: print all GPRs, PSL, and CR3 on double fault Also compactify the printfs, and remove comment about 'two prints'. Their arguments are on same page, so one fault implies another. Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D36302 --- sys/i386/i386/trap.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 578aa0ad49d9..8765bebfd5b9 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -988,18 +988,26 @@ trap_user_dtrace(struct trapframe *frame, int (**hookp)(struct trapframe *)) void dblfault_handler(void) { + struct i386tss *t; + #ifdef KDTRACE_HOOKS if (dtrace_doubletrap_func != NULL) (*dtrace_doubletrap_func)(); #endif printf("\nFatal double fault:\n"); - printf("eip = 0x%x\n", PCPU_GET(common_tssp)->tss_eip); - printf("esp = 0x%x\n", PCPU_GET(common_tssp)->tss_esp); - printf("ebp = 0x%x\n", PCPU_GET(common_tssp)->tss_ebp); + t = PCPU_GET(common_tssp); + printf( + "eip = %#08x esp = %#08x ebp = %#08x eax = %#08x\n" + "edx = %#08x ecx = %#08x edi = %#08x esi = %#08x\n" + "psl = %#08x cs = %#08x ss = %#08x ds = %#08x\n" + "es = %#08x fs = %#08x gs = %#08x cr3 = %#08x\n", + t->tss_eip, t->tss_esp, t->tss_ebp, t->tss_eax, + t->tss_edx, t->tss_ecx, t->tss_edi, t->tss_esi, + t->tss_eflags, t->tss_cs, t->tss_ss, t->tss_ds, + t->tss_es, t->tss_fs, t->tss_gs, t->tss_cr3); #ifdef SMP - /* two separate prints in case of a trap on an unmapped page */ - printf("cpuid = %d; ", PCPU_GET(cpuid)); - printf("apic id = %02x\n", PCPU_GET(apic_id)); + printf("cpuid = %d; apic id = %02x\n", PCPU_GET(cpuid), + PCPU_GET(apic_id)); #endif panic("double fault"); }