From nobody Sun Jul 6 21:01:31 2025 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 4bb0D76zL6z61nl9; Sun, 06 Jul 2025 21:01:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4bb0D73BN2z3cw6; Sun, 06 Jul 2025 21:01:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 566L1VTR082768; Mon, 7 Jul 2025 00:01:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 566L1VTR082768 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 566L1VmB082767; Mon, 7 Jul 2025 00:01:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 7 Jul 2025 00:01:31 +0300 From: Konstantin Belousov To: Ahmad Khalifa Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 85dcdb7aad85 - main - amd64: allow the mapping of other regions for efirt Message-ID: References: <202507061928.566JSLh9096963@gitrepo.freebsd.org> 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=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bb0D73BN2z3cw6 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Sun, Jul 06, 2025 at 01:22:12PM -0700, Ahmad Khalifa wrote: > On Sun Jul 6, 2025 at 11:02 PM +0300, Ahmad Khalifa wrote: > > On Sun Jul 6, 2025 at 10:43 PM +0300, Konstantin Belousov wrote: > >> On Sun, Jul 06, 2025 at 07:28:21PM +0000, Ahmad Khalifa wrote: > >>> The branch main has been updated by vexeduxr: > >>> > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=85dcdb7aad85498b3f497b8752e69b8612b27cb7 > >>> > >>> commit 85dcdb7aad85498b3f497b8752e69b8612b27cb7 > >>> Author: Ahmad Khalifa > >>> AuthorDate: 2025-07-06 19:10:25 +0000 > >>> Commit: Ahmad Khalifa > >>> CommitDate: 2025-07-06 19:26:07 +0000 > >>> > >>> amd64: allow the mapping of other regions for efirt > >>> > >>> Some BIOSes access data outside of regions marked as "runtime" in their > >>> runtime EFI functions. Allow the mapping and preservation of other > >>> regions through a tunable. > >>> > >>> The tunable is a bitmap specifying the regions to map. e.g bit 3 would > >>> be set to map BootServicesCode. > >>> > >>> Currently allowed regions are: > >>> BootServicesCode > >>> BootServicesData > >>> RuntimeServicesCode > >>> RuntimeServicesData > >>> ACPIMemoryNVS > >>> > >>> PR: 287422 > >>> Reviewed by: kib > >>> Approved by: imp (mentor) > >>> Differential Revision: https://reviews.freebsd.org/D51146 > >>> --- > >>> sys/amd64/amd64/efirt_machdep.c | 18 +++++++++++++++++- > >>> sys/amd64/amd64/machdep.c | 8 ++++++-- > >>> sys/amd64/include/efi.h | 4 ++++ > >>> 3 files changed, 27 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c > >>> index 81a28ebe97ee..75c357f6e3df 100644 > >>> --- a/sys/amd64/amd64/efirt_machdep.c > >>> +++ b/sys/amd64/amd64/efirt_machdep.c > >>> @@ -56,6 +56,15 @@ > >>> #include > >>> #include > >>> > >>> +/* The EFI regions we're allowed to map. */ > >>> +#define EFI_ALLOWED_TYPES_MASK ( \ > >>> + 1u << EFI_MD_TYPE_BS_CODE | 1u << EFI_MD_TYPE_BS_DATA | \ > >>> + 1u << EFI_MD_TYPE_RT_CODE | 1u << EFI_MD_TYPE_RT_DATA | \ > >>> + 1u << EFI_MD_TYPE_FIRMWARE \ > >>> +) > >>> + > >>> +uint32_t efi_map_regs; > >>> + > >> > >> Apparently efi_map_regs must be defined in amd64/machdep.c and not in > >> efirt_machdep.c. If efirt is compiled as module, efo_map_regs gets > >> undefined in the kernel. > > > > Ah, nice catch. Review opened. > > Hmm, apparently active_efi_ops has this issue too. I do not think so.