git: 863f3220d097 - main - Support EFIRT on arm64 with a non 4k page size

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 23 Mar 2022 15:30:58 UTC
The branch main has been updated by andrew:

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

commit 863f3220d09716ea2e570fadc6b19dcb6e4c2191
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-03-23 15:18:30 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-03-23 15:18:30 +0000

    Support EFIRT on arm64 with a non 4k page size
    
    When the page size the kernel is built for is not the same as
    EFI_PAGE_SIZE we need to increment the page index at a faster rate.
    
    Add this adjustment to the arm64 EFIRT support in preperation for
    experimental 16k PAGE_SIZE support.
    
    Sponsored by:   The FreeBSD Foundation
---
 sys/arm64/arm64/efirt_machdep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c
index a48fda6d02b8..6e6541900efb 100644
--- a/sys/arm64/arm64/efirt_machdep.c
+++ b/sys/arm64/arm64/efirt_machdep.c
@@ -221,8 +221,8 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
 			l3_attr |= ATTR_S1_XN;
 
 		VM_OBJECT_WLOCK(obj_1t1_pt);
-		for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++,
-		    va += PAGE_SIZE) {
+		for (va = p->md_phys, idx = 0; idx < p->md_pages;
+		    idx += (PAGE_SIZE / EFI_PAGE_SIZE), va += PAGE_SIZE) {
 			l3 = efi_1t1_l3(va);
 			*l3 = va | l3_attr;
 		}