From nobody Tue Jan 30 06:47:56 2024 X-Original-To: bugs@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 4TPG2N6vz1z58Rs3 for ; Tue, 30 Jan 2024 06:47:56 +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 4TPG2N5FBHz4kZH for ; Tue, 30 Jan 2024 06:47:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706597276; 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: in-reply-to:in-reply-to:references:references; bh=vXS9q2/YaTZ8U8S0FKien6qDqG6OrG+pnKUQOB0Gj7A=; b=LcliNiP+wsWqfy1u/aCevCpQ0fmc/IvVVV2IoN6SuAiGoeCMHeYGf+RZoFs9CfyzZJrhua XEenfHiULqpkJ4bL0FCd1x+ZFeTwkVqvIQbQ1o5EzZytlpRXcXBypIzSE6oNA9wXS/1YV/ DUEbx/yQ4c0VQLrxHfzx2O9N8NghDYEcp8KblV0aHqyvhQexDQc5iwQ8G23rQCJC74VDJ3 ygGFrEkipNHta6dWo33y4lM97o6QDXhok0IRf7UaVo5oJZldma5/oFMYJd+xFyd9+BiEnH USPj8U1fieKsGBueM5GiU1WjfjPrZ5aRAweLYBv3iRSbqsIkgbDOw/AW68EXsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706597276; a=rsa-sha256; cv=none; b=KsIYbpxVSFZnCBgnXaKaNx4LhynXlp3S8e/T3lpuRxFGduVpxqKh1ySbbQX5l04SknvY0F ocL1l9Gjo3EwFcIhTR2ATg/oxxvxYOukCfi85Lc+wjKWPXY23R9QfgkEEQiVXN5Gu0RHZ0 7vBTTXVtbgStXh+2PQLAFzP5HVdpo84m4d1cJgjRc6jVay2l1ntvZzwQ3my0nuP0bOJIYu pURpfbPODTCfsTsljCeeqflclvEaA/HUr/GZIqkP1EfLABQ/EJ19eUo3DZxNNeQjH6pKc0 3QC90DVgQMdUXso3gOzFaskWqZh4otNQJrCISHekneMiZ4h+Qgg+e8XxIevsGw== 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 4TPG2N4J0FzQN1 for ; Tue, 30 Jan 2024 06:47:56 +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 40U6lupU018947 for ; Tue, 30 Jan 2024 06:47:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 40U6luIk018943 for bugs@FreeBSD.org; Tue, 30 Jan 2024 06:47:56 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 276426] amd64: microcode update caused a page fault trying to send data to the logger Date: Tue, 30 Jan 2024 06:47:56 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276426 --- Comment #14 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D486b265a8fb6b2aad37f2819fa04feacf= 8184d53 commit 486b265a8fb6b2aad37f2819fa04feacf8184d53 Author: Andriy Gapon AuthorDate: 2024-01-30 06:45:01 +0000 Commit: Andriy Gapon CommitDate: 2024-01-30 06:45:01 +0000 rdmsr_safe/wrmsr_safe: handle pcb_onfault nesting rdmsr_safe and wrmsr_safe can be called while pcb_onfault is already set, so the functions are modified to preserve the handler rather than resetting it before returning. One case where that happens is when AMD microcode update routine is executed on a stack where copyin / copyout was already active. Here is a sample panic message from a crash caused by resetting the handler: <118>Updating CPU Microcode... Fatal trap 12: page fault while in kernel mode cpuid =3D 3; apic id =3D 03 fault virtual address =3D 0x11ed0de6000 fault code =3D supervisor write data, page not present instruction pointer =3D 0x20:0xffffffff80c2df03 stack pointer =3D 0x28:0xfffffe01ce4a4c70 frame pointer =3D 0x28:0xfffffe01ce4a4c70 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 117 (logger) trap number =3D 12 panic: page fault cpuid =3D 3 time =3D 1681462027 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff80615deb =3D db_trace_self_wrapper+0x2b/frame 0xfffffe01ce4a4830 kdb_backtrace() at 0xffffffff80943c77 =3D kdb_backtrace+0x37/frame 0xfffffe01ce4a48e0 vpanic() at 0xffffffff808f5fe5 =3D vpanic+0x185/frame 0xfffffe01ce4a4= 940 panic() at 0xffffffff808f5da3 =3D panic+0x43/frame 0xfffffe01ce4a49a0 trap_fatal() at 0xffffffff80c31849 =3D trap_fatal+0x379/frame 0xfffffe01ce4a4a00 trap_pfault() at 0xffffffff80c318b5 =3D trap_pfault+0x65/frame 0xfffffe01ce4a4a60 trap() at 0xffffffff80c30f5f =3D trap+0x29f/frame 0xfffffe01ce4a4b80 trap_check() at 0xffffffff80c31c29 =3D trap_check+0x29/frame 0xfffffe01ce4a4ba0 calltrap() at 0xffffffff80c07fd8 =3D calltrap+0x8/frame 0xfffffe01ce4= a4ba0 --- trap 0xc, rip =3D 0xffffffff80c2df03, rsp =3D 0xfffffe01ce4a4c70,= rbp =3D 0xfffffe01ce4a4c70 --- copyout_nosmap_std() at 0xffffffff80c2df03 =3D copyout_nosmap_std+0x63/frame 0xfffffe01ce4a4c70 uiomove_faultflag() at 0xffffffff8095f0d5 =3D uiomove_faultflag+0xe5/= frame 0xfffffe01ce4a4cb0 uiomove() at 0xffffffff8095efeb =3D uiomove+0xb/frame 0xfffffe01ce4a4= cc0 pipe_read() at 0xffffffff80968860 =3D pipe_read+0x230/frame 0xfffffe01ce4a4d30 dofileread() at 0xffffffff809653cb =3D dofileread+0x8b/frame 0xfffffe01ce4a4d80 sys_read() at 0xffffffff80964fa0 =3D sys_read+0xc0/frame 0xfffffe01ce= 4a4df0 amd64_syscall() at 0xffffffff80c3221a =3D amd64_syscall+0x18a/frame 0xfffffe01ce4a4f30 fast_syscall_common() at 0xffffffff80c088eb =3D fast_syscall_common+0xf8/frame 0xfffffe01ce4a4f30 --- syscall (3, FreeBSD ELF64, read), rip =3D 0x11ece41cfaa, rsp =3D 0x11ecbec4908, rbp =3D 0x11ecbec4920 --- Uptime: 41s And another one: Fatal trap 12: page fault while in kernel mode cpuid =3D 4; apic id =3D 04 fault virtual address =3D 0x800a22000 fault code =3D supervisor write data, page not present instruction pointer =3D 0x20:0xffffffff80b2c7ca stack pointer =3D 0x28:0xfffffe01c55b5480 frame pointer =3D 0x28:0xfffffe01c55b5480 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 68418 (pfctl) trap number =3D 12 panic: page fault cpuid =3D 4 time =3D 1625184463 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff805c1e8b =3D db_trace_self_wrapper+0x2b/frame 0xfffffe01c55b5040 kdb_backtrace() at 0xffffffff808874b7 =3D kdb_backtrace+0x37/frame 0xfffffe01c55b50f0 vpanic() at 0xffffffff808449d8 =3D vpanic+0x188/frame 0xfffffe01c55b5= 150 panic() at 0xffffffff808445f3 =3D panic+0x43/frame 0xfffffe01c55b51b0 trap_fatal() at 0xffffffff80b300a5 =3D trap_fatal+0x375/frame 0xfffffe01c55b5210 trap_pfault() at 0xffffffff80b30180 =3D trap_pfault+0x80/frame 0xfffffe01c55b5280 trap() at 0xffffffff80b2f729 =3D trap+0x289/frame 0xfffffe01c55b5390 trap_check() at 0xffffffff80b304d9 =3D trap_check+0x29/frame 0xfffffe01c55b53b0 calltrap() at 0xffffffff80b0bb28 =3D calltrap+0x8/frame 0xfffffe01c55= b53b0 --- trap 0xc, rip =3D 0xffffffff80b2c7ca, rsp =3D 0xfffffe01c55b5480,= rbp =3D 0xfffffe01c55b5480 --- copyout_nosmap_std() at 0xffffffff80b2c7ca =3D copyout_nosmap_std+0x15a/frame 0xfffffe01c55b5480 pfioctl() at 0xffffffff85539358 =3D pfioctl+0x4d28/frame 0xfffffe01c5= 5b5940 devfs_ioctl() at 0xffffffff807176cf =3D devfs_ioctl+0xcf/frame 0xfffffe01c55b59a0 VOP_IOCTL_APV() at 0xffffffff80bb26e2 =3D VOP_IOCTL_APV+0x92/frame 0xfffffe01c55b59c0 VOP_IOCTL() at 0xffffffff80928014 =3D VOP_IOCTL+0x34/frame 0xfffffe01c55b5a10 vn_ioctl() at 0xffffffff80923330 =3D vn_ioctl+0xc0/frame 0xfffffe01c5= 5b5b00 devfs_ioctl_f() at 0xffffffff80717bbe =3D devfs_ioctl_f+0x1e/frame 0xfffffe01c55b5b20 fo_ioctl() at 0xffffffff808abc6b =3D fo_ioctl+0xb/frame 0xfffffe01c55= b5b30 kern_ioctl() at 0xffffffff808abc01 =3D kern_ioctl+0x1d1/frame 0xfffffe01c55b5b80 sys_ioctl() at 0xffffffff808ab982 =3D sys_ioctl+0x132/frame 0xfffffe01c55b5c50 syscallenter() at 0xffffffff80b30cc9 =3D syscallenter+0x159/frame 0xfffffe01c55b5ca0 amd64_syscall() at 0xffffffff80b309a5 =3D amd64_syscall+0x15/frame 0xfffffe01c55b5d30 fast_syscall_common() at 0xffffffff80b0c44e =3D fast_syscall_common+0xf8/frame 0xfffffe01c55b5d30 PR: 276426 Reviewed by: kib, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43639 sys/amd64/amd64/support.S | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=