The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6799dd5dc133bd53fd69324500fe10d28a30abff
commit 6799dd5dc133bd53fd69324500fe10d28a30abff Author: Konstantin Belousov <k...@freebsd.org> AuthorDate: 2025-06-28 06:35:49 +0000 Commit: Konstantin Belousov <k...@freebsd.org> CommitDate: 2025-07-14 22:03:28 +0000 amd64 pmap: for la57, copy whole kernel pml5 table to user pmap pm_pml5 table Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51085 --- sys/amd64/amd64/pmap.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index c5f3176f8c37..7de5daafa9f7 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4343,21 +4343,13 @@ void pmap_pinit_pml5(vm_page_t pml5pg) { pml5_entry_t *pm_pml5; + int i; pm_pml5 = (pml5_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml5pg)); - - /* - * Add pml5 entry at top of KVA pointing to existing pml4 table, - * entering all existing kernel mappings into level 5 table. - */ - pm_pml5[pmap_pml5e_index(UPT_MAX_ADDRESS)] = KPML4phys | X86_PG_V | - X86_PG_RW | X86_PG_A | X86_PG_M; - - /* - * Install self-referential address mapping entry. - */ - pm_pml5[PML5PML5I] = VM_PAGE_TO_PHYS(pml5pg) | - X86_PG_RW | X86_PG_V | X86_PG_M | X86_PG_A; + for (i = 0; i < NPML5EPG / 2; i++) + pm_pml5[i] = 0; + for (; i < NPML5EPG; i++) + pm_pml5[i] = kernel_pmap->pm_pmltop[i]; } static void