From owner-freebsd-bugs@freebsd.org Fri Feb 5 16:23:11 2021 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41AE954B923 for ; Fri, 5 Feb 2021 16:23:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DXLLl1CyNz3jL1 for ; Fri, 5 Feb 2021 16:23:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 27EA654B922; Fri, 5 Feb 2021 16:23:11 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27B0254B744 for ; Fri, 5 Feb 2021 16:23:11 +0000 (UTC) (envelope-from bugzilla-noreply@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 4DXLLl0XNlz3j8B for ; Fri, 5 Feb 2021 16:23:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 0560C21AB9 for ; Fri, 5 Feb 2021 16:23:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 115GNA4b053156 for ; Fri, 5 Feb 2021 16:23:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 115GNAss053155 for bugs@FreeBSD.org; Fri, 5 Feb 2021 16:23:10 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 253272] Page fault in _mca_init during boot Date: Fri, 05 Feb 2021 16:23:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: asomers@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 16:23:11 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253272 Bug ID: 253272 Summary: Page fault in _mca_init during boot Product: Base System Version: 12.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: asomers@FreeBSD.org I saw the following panic during boot on a system running something close to 12.2-RELEASE. It doesn't happen every time. However, I suspect I've hit the same bug a few other times and not known, because the kernel normally reboo= ts immediately since swap is not configured by this point. Fatal trap 12: page fault while in kernel mode cpuid =3D 26; apic id =3D 34 fault virtual address =3D 0xd0 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff8125a009 stack pointer =3D 0x28:0xfffffe0000b65f20 frame pointer =3D 0x28:0xfffffe0000b65f50 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D resume, IOPL =3D 0 current process =3D 11 (idle: cpu26) trap number =3D 12 panic: page fault cpuid =3D 26 time =3D 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0000b65= be0 vpanic() at vpanic+0x17b/frame 0xfffffe0000b65c30 panic() at panic+0x43/frame 0xfffffe0000b65c90 trap_fatal() at trap_fatal+0x391/frame 0xfffffe0000b65cf0 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe0000b65d40 trap() at trap+0x286/frame 0xfffffe0000b65e50 calltrap() at calltrap+0x8/frame 0xfffffe0000b65e50 --- trap 0xc, rip =3D 0xffffffff8125a009, rsp =3D 0xfffffe0000b65f20, rbp = =3D 0xfffffe0000b65f50 --- _mca_init() at _mca_init+0x5d9/frame 0xfffffe0000b65f50 init_secondary_tail() at init_secondary_tail+0xfd/frame 0xfffffe0000b65f80 init_secondary() at init_secondary+0x2d1/frame 0xfffffe0000b65ff0 KDB: enter: panic [ thread pid 11 tid 100029 ] Stopped at kdb_enter+0x37: movq $0,0x12bc1f6(%rip) The bug is caused because only one of my two CPUs reports support for the MCG_CMCI_P bit. On boot, it's random which CPU the kernel queries for supp= ort. If it queries the wrong one, then it doesn't allocate memory for the cmd state, but later calls cmci_setup() for the CPU that does support that bit.= =20 The following command shows the asymmetry between the CPUs: $ for x in $(jot $(sysctl -n hw.ncpu) 0) ; do sudo cpucontrol -m 0x179 /dev/cpuctl$x; done | uniq -c 16 MSR 0x179: 0x00000000 0x0f000c14 16 MSR 0x179: 0x00000000 0x0f000814 --=20 You are receiving this mail because: You are the assignee for the bug.=