From nobody Thu Nov 28 13:30:09 2024 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 4Xzccf0Gxwz5fj4P; Thu, 28 Nov 2024 13:30:10 +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 4Xzccd6lSCz4mHg; Thu, 28 Nov 2024 13:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732800609; 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=u0EB6PMK0mXZxqo2IeA1Wk+1O3cuYCZI5F0gwM7wnTw=; b=sHbYb85xPM+szwxSFzdaaoLAL+CDFEDajpFjPvhpQnRye18R9iroebTJ1JpkGFg9pGVM5d ELqSejwpL9DTKoH3vJEfG1Df8bPuvBoAc/oCtOt06Ehwy/oYf89khKqhF/35wC7nhA2vkI BNLj4eS6TGjpP+oTreMVs4h3kWa54AraLRTsmgp14BAWph7JBWCGUYrEdKIcORpGcujMNj HL/AFFf7pNKZodMC6JIlZM0Rov5ZaCXbrzkCPye04v0JxzOYleXRpY74H6fg6zot9Ld3Wg 0COzZCCMosCEaG4D/ln7W0DYOr1a/sq677pfoUewIS8qy8KSimRsQbLR4sZYDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732800609; 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=u0EB6PMK0mXZxqo2IeA1Wk+1O3cuYCZI5F0gwM7wnTw=; b=A+PFXYKisdcHB2e5oIMAqNHrNUhm+M+qsOfDx/5jj6d9dj80lMmnN5aHFQd1YvcUtZcRUX kY3PD4Y5O7KohFj9mh9ZEqPEljFVAkZ2ZVETl+3TnZLr2GsBsTpIqShuyGqvLZ5+3OVja2 76u6Jo8iHEAFmVHEDtoz9kBLXnd1ZOr/r/ZAid+Sz3O+7aBvTCS3LdaygsAu3uksQcfF+n skNHN2SEKABmirHLNDwLrFCGFzTBP3aYNQDaY7nmXkBBPH6dDT7BSonR++Vpx/cYFj1P9J rhCsFbpln7zGALgrR+0dDRu02W0xHAZw/5tGhCMA/wJFX2Rp3Gt8U/QZ0iaVxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732800609; a=rsa-sha256; cv=none; b=TiqBpUPpkhVyMbuUBKeL9xDm2dX+5xyBExy7G6jvQbhno57fiWQFOEjD8JwmIgiDfYZpG9 dQGdIo5VhSIgAKnOQ6evepJ+kUBhZXUeGeyIS3hodaZF2ddPF34hAeIfWFE6oD+Ds8unqx kE4GLYHwbMaoK6JQwEauFk1dZkPsnPRSNsXYQVNwx1IlRF7Ylzj8GJi+rmiLGEcsd/udhk CXVMIkSX6EMxxZjPYo+eJPYkv8qssf566ZeLu2mhxJ+WS/nMceQAz7dnpX0KS7koBrgOpH O/D3LKHErGdlxy9PNHzDcXjjN/otDnkh5xnoqcKH/09+P4FELf5PW8HXo8eSTQ== 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 4Xzccd6Lw7zgbK; Thu, 28 Nov 2024 13:30:09 +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 4ASDU9Sr009667; Thu, 28 Nov 2024 13:30:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ASDU9jQ009661; Thu, 28 Nov 2024 13:30:09 GMT (envelope-from git) Date: Thu, 28 Nov 2024 13:30:09 GMT Message-Id: <202411281330.4ASDU9jQ009661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 617e683319be - stable/14 - efirt: mark dynamic region executing the RT code with the TDP_EFIRT flag 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/stable/14 X-Git-Reftype: branch X-Git-Commit: 617e683319bec099e02301c6f1120fd5d065d3ba Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=617e683319bec099e02301c6f1120fd5d065d3ba commit 617e683319bec099e02301c6f1120fd5d065d3ba Author: Konstantin Belousov AuthorDate: 2024-11-21 19:40:18 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-28 12:53:16 +0000 efirt: mark dynamic region executing the RT code with the TDP_EFIRT flag For MFC purposes, the TDP_EFIRT flag is moved to td_pflags2. (cherry picked from commit a03957a706a05bb0c2f627183b19d84f6d96dbb7) --- sys/dev/efidev/efirt.c | 8 +++++++- sys/sys/proc.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index 2d45b4d6ac66..92ffeae12734 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -309,6 +309,9 @@ efi_enter(void) fpu_kern_leave(td, NULL); mtx_unlock(&efi_lock); PMAP_UNLOCK(curpmap); + } else { + MPASS((td->td_pflags2 & TDP2_EFIRT) == 0); + td->td_pflags2 |= TDP2_EFIRT; } return (error); } @@ -319,10 +322,13 @@ efi_leave(void) struct thread *td; pmap_t curpmap; + td = curthread; + MPASS((td->td_pflags2 & TDP2_EFIRT) == 0); + td->td_pflags2 &= ~TDP2_EFIRT; + efi_arch_leave(); curpmap = &curproc->p_vmspace->vm_pmap; - td = curthread; fpu_kern_leave(td, NULL); mtx_unlock(&efi_lock); PMAP_UNLOCK(curpmap); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index f794cbe17442..3815571cd46f 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -567,6 +567,7 @@ enum { #define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ #define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ #define TDP2_ACCT 0x00000004 /* Doing accounting */ +#define TDP2_EFIRT 0x20000000 /* In firmware (EFI RT) call */ /* * Reasons that the current thread can not be run yet.