Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jun 2021 02:32:02 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d16b938e7343 - stable/13 - amd64 efirt: initialize vm_pages backing EFI runtime memory
Message-ID:  <202106240232.15O2W2r4073401@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

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

commit d16b938e734363457225ff92cef68301cbad0fce
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-06-16 01:59:06 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-06-24 02:20:41 +0000

    amd64 efirt: initialize vm_pages backing EFI runtime memory
    
    (cherry picked from commit 0247c33e89adaf0c7159b847ef7bae9566e55395)
---
 sys/amd64/amd64/efirt_machdep.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/amd64/amd64/efirt_machdep.c b/sys/amd64/amd64/efirt_machdep.c
index 1c53caaef601..9f0fb00aa2ef 100644
--- a/sys/amd64/amd64/efirt_machdep.c
+++ b/sys/amd64/amd64/efirt_machdep.c
@@ -180,6 +180,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
 	struct efi_md *p;
 	pt_entry_t *pte;
 	void *pml;
+	vm_page_t m;
 	vm_offset_t va;
 	uint64_t idx;
 	int bits, i, mode;
@@ -247,6 +248,14 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
 		    va += PAGE_SIZE) {
 			pte = efi_1t1_pte(va);
 			pte_store(pte, va | bits);
+
+			m = PHYS_TO_VM_PAGE(va);
+			if (m != NULL && VM_PAGE_TO_PHYS(m) == 0) {
+				vm_page_init_page(m, va, -1);
+				m->order = VM_NFREEORDER + 1; /* invalid */
+				m->pool = VM_NFREEPOOL + 1; /* invalid */
+				pmap_page_set_memattr(m, mode);
+			}
 		}
 		VM_OBJECT_WUNLOCK(obj_1t1_pt);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106240232.15O2W2r4073401>