From nobody Thu Oct 29 01:34:57 2026 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 4jFRcQ6d1Jz6xX29 for ; Thu, 29 Oct 2026 01:35:02 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFRcQ2jytz4DXj for ; Thu, 29 Oct 2026 01:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793237702; 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=TCM6nT1E0CRRn8YB2TWiNJOqLDPo5AUpU1KNyk4iB9s=; b=S+ux3yHnaUqcAAaILHvhaCsElWtWZYpsU9+C1ATfiM8wRlZyy0oQH6qRl2WcQwau8UrOfX TZ4VXBGLgLsE+4cXDUn2urNe8WeYGcVyYt+HbXiWyo/779K1hz7dniPFkIVDfGqweotp2o 9K41E+tFGOz2Fh2QXyQI310OE2NOs93cSOLowkgSJRpvb7v22d5/m5OW94cFuIJdeOwa+O YtbyqgoLkau7xnvG5hnK5qqAXOhL/Lat0sI8dDG3XVlr61Zyoqbdqq0tgjdeDTPinZ8eua dDDir5zCBEd6iurUQfJ68kailm6nT1vZ3s/yWUyZjgmV9al10vUGORnzNYpB/A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793237702; b=GzUDwTz+XOX69d6Vk8h+1osT61Hc88avCMaHUnORTMTIZUn0tG70+WSbu5jqRo3NyVSyhG 3JXHI9UDstGcvoeaRJSKXr9Ywht1Iob5TnW8GTOBVYCEW8BsOqEBeF78+1UALXZL/h+1nH DAQrhWSkNwAQh1BhPbhET71EvaYLuXRHyLAFhdD+maCwzsMowFpDoEArW1s9ZJvrR8F2qA s6VhbRb3l2gSqs0y5Ywwsnl9vmGgsfXypaerTIM53/7P1YjGJawtPh+QryL+4Bv5HhC0mN wM1rUoqBBUDw5FGX0HIGc9lsr5G9PUKGtkcHxGdOrB8j270MnNHJnI5rqjbAZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793237702; 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=TCM6nT1E0CRRn8YB2TWiNJOqLDPo5AUpU1KNyk4iB9s=; b=Y0pfXlW6mT/ryjMpu7IQSznqaTkMweY3mZIwbgdEOs2ePTRct6Zoscmsy3zOi3u9LXzOXS kSFuKq+QleqEyz8Xbyukb+Z2gKz/nKqZdmOe6P+34SdmtsAaFiZskXZ6CM/NLiPgtbn0rK keE1Uc81HVSB0H7oyZ86UpVLpvdzZ6tLCVgimYDVtgTgjmq41S4F8d9bMF29FEPI8d9Zru vQpmqPh4wF84WtPw9rgiSKXVmHz435U14fIxTCNHOHMG4kHINH9C2+fSurGGYfpLns6aco bmKN0GnzQ0bEmTK1428N6oNXnVPaR/IXddiRawb82I4npppJxNrf7ZV13qm/eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFRcQ2PFzzHQC for ; Thu, 29 Oct 2026 01:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45005 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 01:34:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: efb0c54c7694 - main - amd64 FRED: handle in-kernel faults same as IDT List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: efb0c54c7694798214a2c130ec8461a34444e1c4 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 01:34:57 +0000 Message-Id: <6ae2a2c1.45005.1cde860c@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=efb0c54c7694798214a2c130ec8461a34444e1c4 commit efb0c54c7694798214a2c130ec8461a34444e1c4 Author: Konstantin Belousov AuthorDate: 2026-10-28 13:58:49 +0000 Commit: Konstantin Belousov CommitDate: 2026-10-29 01:33:47 +0000 amd64 FRED: handle in-kernel faults same as IDT Pass #MC and #DF directly to corresponding handlers, avoiding EFI pcb_onfault case. If a fault occurs while kdb/ddb is active, handler must call kdb_reenter() and not do the normal processing, which typically ends up in panic() for kernel-mode faults. But #MC and #DF should be excluded there as well. NMI is not an exception, it is delivered as specific event. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/trap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 08485c852cac..f6b595d85af7 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -1766,8 +1766,17 @@ trap_fred_handle_k_exc(struct thread *td, struct trapframe_fred *frame, * there is no sense to enable interrupts. */ - if (exc != IDT_PF && trap_check_pcb_onfault(td, &frame->tf_idt)) - return; + if (exc != IDT_DF && exc != IDT_MC) { +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return; + } +#endif + if (exc != IDT_PF && trap_check_pcb_onfault(td, + &frame->tf_idt)) + return; + } switch (exc) { case IDT_DE: