git: d16b938e7343 - stable/13 - amd64 efirt: initialize vm_pages backing EFI runtime memory
Konstantin Belousov
kib at FreeBSD.org
Thu Jun 24 02:32:02 UTC 2021
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=d16b938e734363457225ff92cef68301cbad0fce
commit d16b938e734363457225ff92cef68301cbad0fce
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-06-16 01:59:06 +0000
Commit: Konstantin Belousov <kib at 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);
}
More information about the dev-commits-src-all
mailing list