From nobody Thu Nov 21 22:05:59 2024 X-Original-To: dev-commits-src-main@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 4XvXP34vhXz5dftS; Thu, 21 Nov 2024 22:05:59 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XvXP32QCXz4H04; Thu, 21 Nov 2024 22:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732226759; 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=hhZsa1BpnZArkc2tS/hdDPTWjPZRalXEp4Ujr/MhXuM=; b=PgwbcbOo6M1rX/TJkstUM+6vDiMniUJRsvQfbQ4gJXzGUG9PFSRH4R19m26KQuaUk1byd9 HX7AGRlgvTEELWKftG4pX9elDjron3xYRPL9z5Fkg5h1z6Ctwe0wce+oimWWLnWkcVZizH hvm7CzzppnIUw3h4B5CDEY3woPZRouoNYmRvJsbvpS8iY3vyIoXr50U5DO558/MRYGJYt3 mhrP7BFJ6pWis1bZkrh5wE+F8vLK595BF7GnL9dtgrDQWiVX0bKRKw/3NLZSSC0m7uYhHR dk3BpuajuFZznd6rdro7+XWiLQx/Nbo/wWZll4YMe0iA8QKsbEcFk0tIMLbLpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732226759; 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=hhZsa1BpnZArkc2tS/hdDPTWjPZRalXEp4Ujr/MhXuM=; b=Cy5K3g42usu7CJ1gMxl1YtH8q5v2g5PyU5qqyE5AJ+AahhpFPezU1boGZhR/+91eUbrZI8 c6j6xGGybo3fv86/g+A/9vkTvohsQ+9fYFCFamK4XRYKH3qH6KBC1upa5GKlhkxR8a7c7t LCL4LwSQP3mkPFaYeqPPJa0k/wt/qvyeFmPYt7gXIu+YRdz20gh2c6DJA4RHADKQsRw+w+ V0hSoDaZMVwAadTvgOIMjGOM7JWEwFHiw/0jCpxs6ffQ8j83XCmToIx/W2W/cTJYJsLRdS rDjF1SF7uTNQUqmvY2iONeqThSW/Bk/qH1/8Z9X7uu71lNZIXYca0Ygr97amkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732226759; a=rsa-sha256; cv=none; b=ZwmDjiSw2zqBPFnDubBNVn2UHIEZj+VrXpsLpE2/Yys7EhizhBfXY53jcDfoCiJiK3KrVs wjv4dqz5fwHYR/MAdsX8d1CcVijHBZlr99jfbSQq78ZTQxedBX2NDBRwjLw6VjETQrn2F1 ElV/uzTEaXlL7LFT2dwa2aAoDcYFx0QjQh6RyjYwDIP1dumH3PbCdiXEdE2mdcaDibfI3/ e7ZoFTZnTM/LRUal43hvjR6X+gRVato9PAtRyEzGNomT8uZ4ztL2LzxHdidt1P752fSymz +l6M6JiAcsrwVfhqdybAHqYjW5DyTf20lhYmP+rx/GNx6pVJ4eUeNNbELIPrYA== 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 4XvXP3226Qzxl1; Thu, 21 Nov 2024 22:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4ALM5xPQ072388; Thu, 21 Nov 2024 22:05:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ALM5x9F072385; Thu, 21 Nov 2024 22:05:59 GMT (envelope-from git) Date: Thu, 21 Nov 2024 22:05:59 GMT Message-Id: <202411212205.4ALM5x9F072385@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: e6ec41fa86d8 - main - amd64 efi rt: handle #BP List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: e6ec41fa86d88f80bd663e55455a6844619a9b24 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e6ec41fa86d88f80bd663e55455a6844619a9b24 commit e6ec41fa86d88f80bd663e55455a6844619a9b24 Author: Konstantin Belousov AuthorDate: 2024-11-21 04:57:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-21 22:05:28 +0000 amd64 efi rt: handle #BP PR: 282860 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47694 --- sys/amd64/amd64/trap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index a6d6c792ee92..6ceeea41ea91 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -598,6 +598,18 @@ trap(struct trapframe *frame) * FALLTHROUGH (TRCTRAP kernel mode, kernel address) */ case T_BPTFLT: + /* + * Most likely, EFI RT hitting INT3. This + * check prevents kdb from handling + * breakpoints set on the BIOS text, if such + * option is ever needed. + */ + if ((td->td_pflags & TDP_EFIRT) != 0 && + curpcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; + return; + } + /* * If KDB is enabled, let it handle the debugger trap. * Otherwise, debugger traps "can't happen".