From nobody Thu Nov 21 22:05:58 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 4XvXP22NHTz5dfgQ; Thu, 21 Nov 2024 22:05:58 +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 4XvXP21gdDz4Gwn; Thu, 21 Nov 2024 22:05:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732226758; 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=SVMfhSnJgWmIWUf8R6ItoiPHFlJFAxUbrINiK+zgGHM=; b=sdmaT/xjpczHcmkps5whLFAOKHXuq3PvXB7TuZ9eWtJICAQjl6Pa+wv1ls7IrUdBsXNDx0 X/5ak7Tcp4M2AES1clNqX5XaWIbDkM3z6bXZc+W0tqyFolp0fY8gso/4hBHsArSlnouO8l 6Ksqc0Ir7Yge6uTh4McGArgu4KfcNeac3rv/J8Be9YybbUBAcsz/41cvupjoc6h4o3/uWg +kTXlUQcN/CJqIEizk5DdR67Ckd27vO5hpPmGNAkzcoMluf6CX2TlFp1WuteiqK4BViXyD AI1lnYL2uBDlJQ0uY9JaHDQm2GRLn8MX9rPf36nVpZnpyEr7Dv2eIKL4QFaW5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732226758; 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=SVMfhSnJgWmIWUf8R6ItoiPHFlJFAxUbrINiK+zgGHM=; b=qQa9Cxkt52d0BGmBhWNdCaXO0Gae+K7i/RkSeHSgswnl5haAkvp5Z5Je9mHpIUKdHjyict OQzuxS2aO9Rn4a9zBGazy0Jds9dsXoCQ97c5L0whibyLfctqLIovYyJae5ZE12fEkFKJct ZAJPQu4Ajlacjf1Nau4KlTxR+HTtfhkNcMZ4S957kMQ5nXLd1vXc8Ux2/QgzDr6pgb019E F3Hos+IJQyPrxZ1nLsJQHctdBIq5UFj4u4P6Ie55V9bYSyKsPmgI9izcJqqYqn/Pqeu+k4 ApA9lVzdjygc00ek+2rXECuNavOy6uA77/ofFZAw9gJcAWfnSzlaNd/bNdm2GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732226758; a=rsa-sha256; cv=none; b=v9BQBnedj59RT6wrPcWkvflWkiZ4QXkxgnAdnFtymL/0Qwl35I2L+PnlcLCwKTX5gzgBdv frCFhL6pNTJ8Sye3K3nx+G3U+IlzxW5YpJ6uU7ar20pXx3aN/RbVkb9Uh1ntgHO7pl9OTq GSBwnUilNA3WzUBUk4BEZAJTePYzv4MCPHKc03uuY+FzzRfgYS7/ZMN7X7a1RrsNDGJX2Y OcIs1cHib9XtYLE8+bN3cVdZG8SbKsfLyGrRL4jYVqRNQ4uLKLMZT3Mb3htkbpfeLG5bcy aZZ9ByicHFYpmWElOy/da3J+wngjw5lJoSbV+vud9/kl83xgRMRjjBv0sdWcpw== 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 4XvXP21H4Wzxxr; Thu, 21 Nov 2024 22:05:58 +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 4ALM5w7U072329; Thu, 21 Nov 2024 22:05:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ALM5wuA072326; Thu, 21 Nov 2024 22:05:58 GMT (envelope-from git) Date: Thu, 21 Nov 2024 22:05:58 GMT Message-Id: <202411212205.4ALM5wuA072326@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: a03957a706a0 - main - efirt: mark dynamic region executing the RT code with the TDP_EFIRT flag 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: a03957a706a05bb0c2f627183b19d84f6d96dbb7 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a03957a706a05bb0c2f627183b19d84f6d96dbb7 commit a03957a706a05bb0c2f627183b19d84f6d96dbb7 Author: Konstantin Belousov AuthorDate: 2024-11-21 19:40:18 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-21 22:05:28 +0000 efirt: mark dynamic region executing the RT code with the TDP_EFIRT flag Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47694 --- sys/dev/efidev/efirt.c | 8 +++++++- sys/sys/proc.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index 2d45b4d6ac66..37b46ec38dad 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_pflags & TDP_EFIRT) == 0); + td->td_pflags |= TDP_EFIRT; } return (error); } @@ -319,10 +322,13 @@ efi_leave(void) struct thread *td; pmap_t curpmap; + td = curthread; + MPASS((td->td_pflags & TDP_EFIRT) == 0); + td->td_pflags &= ~TDP_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 a69eecbb4661..69b6c7a61da0 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -560,7 +560,7 @@ enum { #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ -#define TDP_UNUSED0 0x20000000 /* UNUSED */ +#define TDP_EFIRT 0x20000000 /* In firmware (EFI RT) call */ #define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ #define TDP_SIGFASTPENDING 0x80000000 /* Pending signal due to sigfastblock */