Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jul 2026 15:33:14 +0000
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a2f50c4b32d1 - main - amd64 efirt: register all runtime regions as fictitious
Message-ID:  <6a58f9ba.1def4.2967a3d7@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=a2f50c4b32d1c126cf2309dab61d27d6329908f8

commit a2f50c4b32d1c126cf2309dab61d27d6329908f8
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-16 06:49:21 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-07-16 15:32:50 +0000

    amd64 efirt: register all runtime regions as fictitious
    
    This is needed for VM_PHYS_TO_PAGE() to work, which is needed for
    pmap_map_io_transient() to work, which is needed for uiomove_fromphys()
    to work.
    
    PR:     296348
    Reported and tested by: Anton Saietskii <vsasjason@gmail.com>
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D58274
---
 sys/amd64/amd64/efirt_machdep.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c
index f3e3db9cba9c..f5be20e99b40 100644
--- a/sys/amd64/amd64/efirt_machdep.c
+++ b/sys/amd64/amd64/efirt_machdep.c
@@ -54,6 +54,7 @@
 #include <vm/vm_object.h>
 #include <vm/vm_page.h>
 #include <vm/vm_pager.h>
+#include <vm/vm_phys.h>
 #include <vm/vm_radix.h>
 
 /* The EFI regions we're allowed to map. */
@@ -253,6 +254,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
 				    "attributes unsupported\n", i);
 			mode = VM_MEMATTR_UNCACHEABLE;
 		}
+		(void)vm_phys_fictitious_reg_range(p->md_phys, p->md_phys +
+		    p->md_pages * EFI_PAGE_SIZE, mode);
 		bits = pmap_cache_bits(kernel_pmap, mode, false) | X86_PG_RW |
 		    X86_PG_V;
 		VM_OBJECT_WLOCK(obj_1t1_pt);


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a58f9ba.1def4.2967a3d7>